diff --git a/docs/api/01__getting__started_8md.html b/docs/api/01__getting__started_8md.html index d3f42127..6d1de24e 100644 --- a/docs/api/01__getting__started_8md.html +++ b/docs/api/01__getting__started_8md.html @@ -29,6 +29,7 @@
GBDK 2020 Docs +  4.0.6
API Documentation for GBDK 2020
diff --git a/docs/api/02__links__and__tools_8md.html b/docs/api/02__links__and__tools_8md.html index 3862d9b2..0190788e 100644 --- a/docs/api/02__links__and__tools_8md.html +++ b/docs/api/02__links__and__tools_8md.html @@ -29,6 +29,7 @@
GBDK 2020 Docs +  4.0.6
API Documentation for GBDK 2020
diff --git a/docs/api/03__using__gbdk_8md.html b/docs/api/03__using__gbdk_8md.html index 30c0e32a..e6dfb189 100644 --- a/docs/api/03__using__gbdk_8md.html +++ b/docs/api/03__using__gbdk_8md.html @@ -29,6 +29,7 @@
GBDK 2020 Docs +  4.0.6
API Documentation for GBDK 2020
diff --git a/docs/api/04__coding__guidelines_8md.html b/docs/api/04__coding__guidelines_8md.html index 86c5f764..31adb736 100644 --- a/docs/api/04__coding__guidelines_8md.html +++ b/docs/api/04__coding__guidelines_8md.html @@ -29,6 +29,7 @@
GBDK 2020 Docs +  4.0.6
API Documentation for GBDK 2020
diff --git a/docs/api/05__banking__mbcs_8md.html b/docs/api/05__banking__mbcs_8md.html index 1c0b1b2e..d95cbc63 100644 --- a/docs/api/05__banking__mbcs_8md.html +++ b/docs/api/05__banking__mbcs_8md.html @@ -29,6 +29,7 @@
GBDK 2020 Docs +  4.0.6
API Documentation for GBDK 2020
diff --git a/docs/api/06__toolchain_8md.html b/docs/api/06__toolchain_8md.html index bf00db4e..73de9e0a 100644 --- a/docs/api/06__toolchain_8md.html +++ b/docs/api/06__toolchain_8md.html @@ -29,6 +29,7 @@
GBDK 2020 Docs +  4.0.6
API Documentation for GBDK 2020
diff --git a/docs/api/06b__supported__consoles_8md.html b/docs/api/06b__supported__consoles_8md.html index 9da7e019..841753ae 100644 --- a/docs/api/06b__supported__consoles_8md.html +++ b/docs/api/06b__supported__consoles_8md.html @@ -29,6 +29,7 @@
GBDK 2020 Docs +  4.0.6
API Documentation for GBDK 2020
diff --git a/docs/api/07__sample__programs_8md.html b/docs/api/07__sample__programs_8md.html index aeb4d3da..55cbf5ae 100644 --- a/docs/api/07__sample__programs_8md.html +++ b/docs/api/07__sample__programs_8md.html @@ -29,6 +29,7 @@
GBDK 2020 Docs +  4.0.6
API Documentation for GBDK 2020
diff --git a/docs/api/08__faq_8md.html b/docs/api/08__faq_8md.html index ce8916f8..6406f85c 100644 --- a/docs/api/08__faq_8md.html +++ b/docs/api/08__faq_8md.html @@ -29,6 +29,7 @@
GBDK 2020 Docs +  4.0.6
API Documentation for GBDK 2020
diff --git a/docs/api/09__migrating__new__versions_8md.html b/docs/api/09__migrating__new__versions_8md.html index 5c5b8af9..055eec70 100644 --- a/docs/api/09__migrating__new__versions_8md.html +++ b/docs/api/09__migrating__new__versions_8md.html @@ -29,6 +29,7 @@
GBDK 2020 Docs +  4.0.6
API Documentation for GBDK 2020
diff --git a/docs/api/10__release__notes_8md.html b/docs/api/10__release__notes_8md.html index 2beddde2..de006bf4 100644 --- a/docs/api/10__release__notes_8md.html +++ b/docs/api/10__release__notes_8md.html @@ -29,6 +29,7 @@
GBDK 2020 Docs +  4.0.6
API Documentation for GBDK 2020
diff --git a/docs/api/20__toolchain__settings_8md.html b/docs/api/20__toolchain__settings_8md.html index a2f8dfe0..8da8b8c4 100644 --- a/docs/api/20__toolchain__settings_8md.html +++ b/docs/api/20__toolchain__settings_8md.html @@ -29,6 +29,7 @@
GBDK 2020 Docs +  4.0.6
API Documentation for GBDK 2020
diff --git a/docs/api/annotated.html b/docs/api/annotated.html index c21eb9bc..34a4efff 100644 --- a/docs/api/annotated.html +++ b/docs/api/annotated.html @@ -29,6 +29,7 @@
GBDK 2020 Docs +  4.0.6
API Documentation for GBDK 2020
diff --git a/docs/api/asm_2gbz80_2stdarg_8h.html b/docs/api/asm_2gbz80_2stdarg_8h.html index 76865cf0..64eefd33 100644 --- a/docs/api/asm_2gbz80_2stdarg_8h.html +++ b/docs/api/asm_2gbz80_2stdarg_8h.html @@ -29,6 +29,7 @@
GBDK 2020 Docs +  4.0.6
API Documentation for GBDK 2020
diff --git a/docs/api/asm_2gbz80_2stdarg_8h_source.html b/docs/api/asm_2gbz80_2stdarg_8h_source.html index e9f12567..adbd5417 100644 --- a/docs/api/asm_2gbz80_2stdarg_8h_source.html +++ b/docs/api/asm_2gbz80_2stdarg_8h_source.html @@ -29,6 +29,7 @@
GBDK 2020 Docs +  4.0.6
API Documentation for GBDK 2020
diff --git a/docs/api/asm_2gbz80_2string_8h.html b/docs/api/asm_2gbz80_2string_8h.html index 6eb90fa2..59c7cf2e 100644 --- a/docs/api/asm_2gbz80_2string_8h.html +++ b/docs/api/asm_2gbz80_2string_8h.html @@ -29,6 +29,7 @@
GBDK 2020 Docs +  4.0.6
API Documentation for GBDK 2020
@@ -98,28 +99,30 @@ $(document).ready(function(){initNavTree('asm_2gbz80_2string_8h.html',''); initR - - - - - - - + + + + + + + - - - - + + + + - - + + + +

Functions

char * strcpy (char *dest, const char *src) OLDCALL __preserves_regs(b
 
int strcmp (const char *s1, const char *s2) OLDCALL __preserves_regs(b
 
void * memcpy (void *dest, const void *src, size_t len) OLDCALL __preserves_regs(b
 
void * memmove (void *dest, const void *src, size_t n)
char * strcpy (char *dest, const char *src) OLDCALL PRESERVES_REGS(b
 
int strcmp (const char *s1, const char *s2) OLDCALL PRESERVES_REGS(b
 
void * memcpy (void *dest, const void *src, size_t len) OLDCALL PRESERVES_REGS(b
 
void * memmove (void *dest, const void *src, size_t n)
 
void * memset (void *s, int c, size_t n) OLDCALL __preserves_regs(b
 
char * reverse (char *s) OLDCALL __preserves_regs(b
 
void * memset (void *s, int c, size_t n) OLDCALL PRESERVES_REGS(b
 
char * reverse (char *s) OLDCALL PRESERVES_REGS(b
 
char * strcat (char *s1, const char *s2)
 
int strlen (const char *s) OLDCALL __preserves_regs(b
 
int strlen (const char *s) OLDCALL PRESERVES_REGS(b
 
char * strncat (char *s1, const char *s2, int n)
 
int strncmp (const char *s1, const char *s2, int n)
 
char * strncpy (char *s1, const char *s2, int n)
 
int memcmp (const void *buf1, const void *buf2, size_t count) OLDCALL
 
@@ -129,8 +132,8 @@ Variables

Detailed Description

Generic string functions.

Function Documentation

- -

◆ strcpy()

+ +

◆ strcpy()

@@ -167,8 +170,8 @@ Variables
- -

◆ strcmp()

+ +

◆ strcmp()

@@ -208,8 +211,8 @@ Variables
- -

◆ memcpy()

+ +

◆ memcpy()

@@ -229,7 +232,7 @@ Variables
- + @@ -273,7 +276,7 @@ Variables - + @@ -287,8 +290,8 @@ Variables - -

◆ memset()

+ +

◆ memset()

@@ -308,7 +311,7 @@ Variables
- + @@ -330,8 +333,8 @@ Variables - -

◆ reverse()

+ +

◆ reverse()

@@ -397,8 +400,8 @@ Variables
- -

◆ strlen()

+ +

◆ strlen()

@@ -499,7 +502,7 @@ Variables

Variables

size_t size_t  len 
size_t size_t  n 
size_t size_t  n 
-

Compare strings (at most n characters):

+

Compare strings (at most n characters):

Parameters
@@ -508,10 +511,11 @@ Variables
s1First string to compare
+

Returns zero if the strings are identical, or non-zero if they are not (see below).

Returns:

@@ -560,6 +564,55 @@ Variables

Warning: If there is no \0 in the first n bytes of s2 then s1 will not be null terminated.

Returns: Pointer to s1

+ + + +

◆ memcmp()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
int memcmp (const void * buf1,
const void * buf2,
size_t count 
)
+
+

Compare up to count bytes in buffers buf1 and buf2

+
Parameters
+ + + + +
buf1Pointer to First buffer to compare
buf2Pointer to Second buffer to compare
countMax number of bytes to compare
+
+
+

Returns zero if the buffers are identical, or non-zero if they are not (see below).

+

Returns:

+

Variable Documentation

diff --git a/docs/api/asm_2gbz80_2string_8h.js b/docs/api/asm_2gbz80_2string_8h.js index ef61ae0d..d9ced55e 100644 --- a/docs/api/asm_2gbz80_2string_8h.js +++ b/docs/api/asm_2gbz80_2string_8h.js @@ -1,15 +1,16 @@ var asm_2gbz80_2string_8h = [ - [ "strcpy", "asm_2gbz80_2string_8h.html#a8d21cab0520a18493e48dab450288f31", null ], - [ "strcmp", "asm_2gbz80_2string_8h.html#a125908e664d4b65f55a49c8faf14784b", null ], - [ "memcpy", "asm_2gbz80_2string_8h.html#a36e8e03da711f0d862ca1d62a001a627", null ], + [ "strcpy", "asm_2gbz80_2string_8h.html#ada128b5ed545214bb397d1399615ec9e", null ], + [ "strcmp", "asm_2gbz80_2string_8h.html#a7172770a053aa1fe0ab46a97ab43a5fa", null ], + [ "memcpy", "asm_2gbz80_2string_8h.html#a6a1a6cbe7fb6102819098340a4986574", null ], [ "memmove", "asm_2gbz80_2string_8h.html#a802c986820d3866639922b6bc9484f90", null ], - [ "memset", "asm_2gbz80_2string_8h.html#af2fcd4c99b3b490e6db059e741676274", null ], - [ "reverse", "asm_2gbz80_2string_8h.html#a31e56ae6ad0e9bd961633507ec1aef6c", null ], + [ "memset", "asm_2gbz80_2string_8h.html#a4bc4146b1a053fc4ec10f1377bb21a4f", null ], + [ "reverse", "asm_2gbz80_2string_8h.html#a476b2b37367c65c6cb36037bfc16b19f", null ], [ "strcat", "asm_2gbz80_2string_8h.html#a8908188ae9fc2f05d993257ef001d553", null ], - [ "strlen", "asm_2gbz80_2string_8h.html#a2db4b83fd1a2889db33d4e0798d33fe2", null ], + [ "strlen", "asm_2gbz80_2string_8h.html#a5e4982e9d2fd4ec328abfda6b1a3f7e5", null ], [ "strncat", "asm_2gbz80_2string_8h.html#af70714f788819be9dbf368a969be23f7", null ], [ "strncmp", "asm_2gbz80_2string_8h.html#ab745ed93c0024648f33dc1d553e9fdcc", null ], [ "strncpy", "asm_2gbz80_2string_8h.html#a21ae87d60fcc456369668093c57db61f", null ], + [ "memcmp", "asm_2gbz80_2string_8h.html#a52701f453c97403ec1b12d286484259b", null ], [ "c", "asm_2gbz80_2string_8h.html#a0b3366755f3276b0243c1e0497471b7a", null ] ]; \ No newline at end of file diff --git a/docs/api/asm_2gbz80_2string_8h_source.html b/docs/api/asm_2gbz80_2string_8h_source.html index ff01cbb4..dea1bbb2 100644 --- a/docs/api/asm_2gbz80_2string_8h_source.html +++ b/docs/api/asm_2gbz80_2string_8h_source.html @@ -29,6 +29,7 @@
GBDK 2020 Docs +  4.0.6
API Documentation for GBDK 2020
@@ -95,46 +96,50 @@ $(document).ready(function(){initNavTree('asm_2gbz80_2string_8h_source.html','')
6 
7 #include <types.h>
8 
-
20 char *strcpy(char *dest, const char *src) OLDCALL __preserves_regs(b, c);
+
20 char *strcpy(char *dest, const char *src) OLDCALL PRESERVES_REGS(b, c);
21 
-
32 int strcmp(const char *s1, const char *s2) OLDCALL __preserves_regs(b, c);
+
32 int strcmp(const char *s1, const char *s2) OLDCALL PRESERVES_REGS(b, c);
33 
-
42 void *memcpy(void *dest, const void *src, size_t len) OLDCALL __preserves_regs(b, c);
+
42 void *memcpy(void *dest, const void *src, size_t len) OLDCALL PRESERVES_REGS(b, c);
43 
46 void *memmove (void *dest, const void *src, size_t n);
47 
-
54 void *memset (void *s, int c, size_t n) OLDCALL __preserves_regs(b, c);
+
54 void *memset (void *s, int c, size_t n) OLDCALL PRESERVES_REGS(b, c);
55 
-
66 char *reverse(char *s) OLDCALL __preserves_regs(b, c);
+
66 char *reverse(char *s) OLDCALL PRESERVES_REGS(b, c);
67 
79 char *strcat(char *s1, const char *s2);
80 
-
87 int strlen(const char *s) OLDCALL __preserves_regs(b, c);
+
87 int strlen(const char *s) OLDCALL PRESERVES_REGS(b, c);
88 
99 char *strncat(char *s1, const char *s2, int n);
100 
-
112 int strncmp(const char *s1, const char *s2, int n);
-
113 
-
129 char *strncpy(char *s1, const char *s2, int n);
-
130 
-
131 #endif
+
115 int strncmp(const char *s1, const char *s2, int n);
+
116 
+
132 char *strncpy(char *s1, const char *s2, int n);
+
133 
+
148 int memcmp(const void *buf1, const void *buf2, size_t count) OLDCALL;
+
149 
+
150 #endif
-
memcpy
void * memcpy(void *dest, const void *src, size_t len) OLDCALL __preserves_regs(b
+
strcpy
char * strcpy(char *dest, const char *src) OLDCALL PRESERVES_REGS(b
types.h
+
reverse
char * reverse(char *s) OLDCALL PRESERVES_REGS(b
+
memcmp
int memcmp(const void *buf1, const void *buf2, size_t count) OLDCALL
c
char c
Definition: string.h:20
-
strlen
int strlen(const char *s) OLDCALL __preserves_regs(b
strncat
char * strncat(char *s1, const char *s2, int n)
-
reverse
char * reverse(char *s) OLDCALL __preserves_regs(b
memmove
void * memmove(void *dest, const void *src, size_t n)
-
strcmp
int strcmp(const char *s1, const char *s2) OLDCALL __preserves_regs(b
+
memset
void * memset(void *s, int c, size_t n) OLDCALL PRESERVES_REGS(b
+
memcpy
void * memcpy(void *dest, const void *src, size_t len) OLDCALL PRESERVES_REGS(b
strncmp
int strncmp(const char *s1, const char *s2, int n)
-
b
void b
Definition: gb.h:585
-
OLDCALL
#define OLDCALL
Definition: types.h:21
+
b
void b
Definition: gb.h:608
+
OLDCALL
#define OLDCALL
Definition: types.h:19
strcat
char * strcat(char *s1, const char *s2)
+
strcmp
int strcmp(const char *s1, const char *s2) OLDCALL PRESERVES_REGS(b
strncpy
char * strncpy(char *s1, const char *s2, int n)
-
strcpy
char * strcpy(char *dest, const char *src) OLDCALL __preserves_regs(b
-
memset
void * memset(void *s, int c, size_t n) OLDCALL __preserves_regs(b
+
PRESERVES_REGS
#define PRESERVES_REGS(...)
Definition: types.h:29
+
strlen
int strlen(const char *s) OLDCALL PRESERVES_REGS(b
- -

◆ size_t

+ +

◆ size_t

- +
typedef int size_ttypedef unsigned int size_t
- -

◆ clock_t

+ +

◆ clock_t

- +
typedef UINT16 clock_ttypedef unsigned int clock_t
-

Returned from clock

See also
clock
+

Returned from clock

See also
clock
diff --git a/docs/api/asm_2gbz80_2types_8h.js b/docs/api/asm_2gbz80_2types_8h.js index b9ffce99..2593fb70 100644 --- a/docs/api/asm_2gbz80_2types_8h.js +++ b/docs/api/asm_2gbz80_2types_8h.js @@ -1,9 +1,5 @@ var asm_2gbz80_2types_8h = [ - [ "NONBANKED", "asm_2gbz80_2types_8h.html#a7ed081d8dfb6902784b2fc730bbb7f96", null ], - [ "BANKED", "asm_2gbz80_2types_8h.html#aa8480aed89a168ec484727f5ac985cd0", null ], - [ "CRITICAL", "asm_2gbz80_2types_8h.html#ae0233515480e60d29bcc731469976e02", null ], - [ "INTERRUPT", "asm_2gbz80_2types_8h.html#ac950c0db046e2f86d15e7ae1f558b017", null ], [ "__SIZE_T_DEFINED", "asm_2gbz80_2types_8h.html#a8de3167f7b52ff5a2f538858cb5e32d3", null ], [ "INT8", "asm_2gbz80_2types_8h.html#a7ebe70ceca856797319175e30bcf003d", null ], [ "UINT8", "asm_2gbz80_2types_8h.html#ab27e9918b538ce9d8ca692479b375b6a", null ], @@ -11,6 +7,6 @@ var asm_2gbz80_2types_8h = [ "UINT16", "asm_2gbz80_2types_8h.html#a805c2c164bdd38d72a30c46e84fb568b", null ], [ "INT32", "asm_2gbz80_2types_8h.html#a516ea33686d40a7f91f5644851ce7b5d", null ], [ "UINT32", "asm_2gbz80_2types_8h.html#a0b39d6d754cb24c708b0f2bdbe88130e", null ], - [ "size_t", "asm_2gbz80_2types_8h.html#a7619b847aeded8a6d14cbfa212b2cdfb", null ], - [ "clock_t", "asm_2gbz80_2types_8h.html#ad666a63cb94701b620ce999f84629d23", null ] + [ "size_t", "asm_2gbz80_2types_8h.html#a7c94ea6f8948649f8d181ae55911eeaf", null ], + [ "clock_t", "asm_2gbz80_2types_8h.html#aeb756bd89bf86769edbefdef8135109f", null ] ]; \ No newline at end of file diff --git a/docs/api/asm_2gbz80_2types_8h_source.html b/docs/api/asm_2gbz80_2types_8h_source.html index f2dc7312..e1efe74e 100644 --- a/docs/api/asm_2gbz80_2types_8h_source.html +++ b/docs/api/asm_2gbz80_2types_8h_source.html @@ -29,6 +29,7 @@
GBDK 2020 Docs +  4.0.6
API Documentation for GBDK 2020
@@ -97,37 +98,41 @@ $(document).ready(function(){initNavTree('asm_2gbz80_2types_8h_source.html','');
9  #error gbz80 only.
10 #endif
11 
-
12 #define NONBANKED __nonbanked
-
13 #define BANKED __banked
-
25 #define CRITICAL __critical
-
26 
-
36 #define INTERRUPT __interrupt
-
37 
-
40 typedef signed char INT8;
-
43 typedef unsigned char UINT8;
-
46 typedef signed int INT16;
-
49 typedef unsigned int UINT16;
-
52 typedef signed long INT32;
-
55 typedef unsigned long UINT32;
-
56 
-
57 #ifndef __SIZE_T_DEFINED
-
58 #define __SIZE_T_DEFINED
-
59 typedef int size_t;
-
60 #endif
-
61 
-
65 typedef UINT16 clock_t;
-
66 
-
67 #endif
+
12 #ifdef __SDCC
+
13 
+
14 #define NONBANKED __nonbanked
+
15 #define BANKED __banked
+
26 #define CRITICAL __critical
+
27 
+
37 #define INTERRUPT __interrupt
+
38 
+
39 #endif
+
40 
+
43 typedef signed char INT8;
+
46 typedef unsigned char UINT8;
+
49 typedef signed int INT16;
+
52 typedef unsigned int UINT16;
+
55 typedef signed long INT32;
+
58 typedef unsigned long UINT32;
+
59 
+
60 #ifndef __SIZE_T_DEFINED
+
61 #define __SIZE_T_DEFINED
+
62 typedef unsigned int size_t;
+
63 #endif
+
64 
+
68 typedef unsigned int clock_t;
+
69 
+
70 #endif
-
UINT8
unsigned char UINT8
Definition: types.h:43
-
INT16
signed int INT16
Definition: types.h:46
-
UINT16
unsigned int UINT16
Definition: types.h:49
-
INT32
signed long INT32
Definition: types.h:52
-
UINT32
unsigned long UINT32
Definition: types.h:55
-
clock_t
UINT16 clock_t
Definition: types.h:65
-
size_t
int size_t
Definition: types.h:59
-
INT8
signed char INT8
Definition: types.h:40
+
UINT8
unsigned char UINT8
Definition: types.h:46
+
INT16
signed int INT16
Definition: types.h:49
+
UINT16
unsigned int UINT16
Definition: types.h:52
+
INT32
signed long INT32
Definition: types.h:55
+
size_t
unsigned int size_t
Definition: types.h:62
+
UINT32
unsigned long UINT32
Definition: types.h:58
+
INT8
signed char INT8
Definition: types.h:43
+
clock_t
unsigned int clock_t
Definition: types.h:68
+
+ + +

◆ PRESERVES_REGS

+ +
+
+ + + + + + + + +
#define PRESERVES_REGS( ...)
+
+ +
+
+ +

◆ NAKED

+ +
+
+ + + + +
#define NAKED
+
+ +
+
+ +

◆ SFR

+ +
+
+ + + + +
#define SFR
+
+ +
+
+ +

◆ AT

+ +
+
+ + + + + + + + +
#define AT( A)
+
+
diff --git a/docs/api/asm_2types_8h.js b/docs/api/asm_2types_8h.js index 7dd82a20..99cba9d6 100644 --- a/docs/api/asm_2types_8h.js +++ b/docs/api/asm_2types_8h.js @@ -2,6 +2,10 @@ var asm_2types_8h = [ [ "_fixed", "union__fixed.html", "union__fixed" ], [ "OLDCALL", "asm_2types_8h.html#a0971918860055db2e50dacea4da8f3bc", null ], + [ "PRESERVES_REGS", "asm_2types_8h.html#acb825e83a33fcc06482c59b4ab2cf961", null ], + [ "NAKED", "asm_2types_8h.html#a7a18c4884994b9b520ae535b6d9579d3", null ], + [ "SFR", "asm_2types_8h.html#afb3731986211fded0a874086c98ffcc4", null ], + [ "AT", "asm_2types_8h.html#a66d3e9555a86fa871932c5f60834c67e", null ], [ "NONBANKED", "asm_2types_8h.html#a7ed081d8dfb6902784b2fc730bbb7f96", null ], [ "BANKED", "asm_2types_8h.html#aa8480aed89a168ec484727f5ac985cd0", null ], [ "CRITICAL", "asm_2types_8h.html#ae0233515480e60d29bcc731469976e02", null ], diff --git a/docs/api/asm_2types_8h_source.html b/docs/api/asm_2types_8h_source.html index 472511d5..193b26b0 100644 --- a/docs/api/asm_2types_8h_source.html +++ b/docs/api/asm_2types_8h_source.html @@ -29,6 +29,7 @@
GBDK 2020 Docs +  4.0.6
API Documentation for GBDK 2020
@@ -93,96 +94,96 @@ $(document).ready(function(){initNavTree('asm_2types_8h_source.html',''); initRe
4 #ifndef ASM_TYPES_INCLUDE
5 #define ASM_TYPES_INCLUDE
6 
-
7 #ifdef __PORT_gbz80
-
8  #include <asm/gbz80/types.h>
-
9 #else
-
10  #ifdef __PORT_z80
-
11  #include <asm/z80/types.h>
-
12  #else
-
13  #error Unrecognised port
-
14  #endif
-
15 #endif
-
16 
-
17 #ifndef OLDCALL
-
18 #if __SDCC_REVISION >= 12608
-
19 #define OLDCALL __sdcccall(0)
-
20 #else
-
21 #define OLDCALL
-
22 #endif
-
23 #endif
-
24 
-
25 #ifndef NONBANKED
-
26 #define NONBANKED
-
27 #endif
-
28 #ifndef BANKED
-
29 #define BANKED
-
30 #endif
-
31 #ifndef CRITICAL
-
32 #define CRITICAL
+
7 #if defined(__PORT_gbz80)
+
8 #include <asm/gbz80/types.h>
+
9 #elif defined(__PORT_z80)
+
10 #include <asm/z80/types.h>
+
11 #else
+
12 #error Unrecognised port
+
13 #endif
+
14 
+
15 #ifndef OLDCALL
+
16 #if __SDCC_REVISION >= 12608
+
17 #define OLDCALL __sdcccall(0)
+
18 #else
+
19 #define OLDCALL
+
20 #endif
+
21 #endif
+
22 
+
23 #ifdef __SDCC
+
24 #define PRESERVES_REGS(...) __preserves_regs(__VA_ARGS__)
+
25 #define NAKED __naked
+
26 #define SFR __sfr
+
27 #define AT(A) __at(A)
+
28 #else
+
29 #define PRESERVES_REGS(...)
+
30 #define NAKED
+
31 #define SFR
+
32 #define AT(A)
33 #endif
-
34 #ifndef INTERRUPT
-
35 #define INTERRUPT
-
36 #endif
-
37 
-
41 typedef INT8 BOOLEAN;
-
42 
-
43 #if BYTE_IS_UNSIGNED
-
44 
-
45 typedef UINT8 BYTE;
-
46 typedef UINT16 WORD;
-
47 typedef UINT32 DWORD;
-
48 
-
49 #else
-
50 
-
53 typedef INT8 BYTE;
-
56 typedef UINT8 UBYTE;
-
58 typedef INT16 WORD;
-
60 typedef UINT16 UWORD;
-
62 typedef INT32 LWORD;
-
64 typedef UINT32 ULWORD;
-
66 typedef INT32 DWORD;
-
68 typedef UINT32 UDWORD;
-
69 
-
76 typedef union _fixed {
-
77  struct {
-
78  UBYTE l;
-
79  UBYTE h;
-
80  };
-
81  struct {
-
82  UBYTE l;
-
83  UBYTE h;
-
84  } b;
-
85  UWORD w;
-
86 } fixed;
-
87 
-
88 #endif
+
34 
+
35 #ifndef NONBANKED
+
36 #define NONBANKED
+
37 #endif
+
38 #ifndef BANKED
+
39 #define BANKED
+
40 #endif
+
41 #ifndef CRITICAL
+
42 #define CRITICAL
+
43 #endif
+
44 #ifndef INTERRUPT
+
45 #define INTERRUPT
+
46 #endif
+
47 
+
51 typedef INT8 BOOLEAN;
+
52 
+
55 typedef INT8 BYTE;
+
58 typedef UINT8 UBYTE;
+
60 typedef INT16 WORD;
+
62 typedef UINT16 UWORD;
+
64 typedef INT32 LWORD;
+
66 typedef UINT32 ULWORD;
+
68 typedef INT32 DWORD;
+
70 typedef UINT32 UDWORD;
+
71 
+
78 typedef union _fixed {
+
79  struct {
+
80  UBYTE l;
+
81  UBYTE h;
+
82  };
+
83  struct {
+
84  UBYTE l;
+
85  UBYTE h;
+
86  } b;
+
87  UWORD w;
+
88 } fixed;
89 
90 #endif
-
UINT8
unsigned char UINT8
Definition: types.h:43
-
INT16
signed int INT16
Definition: types.h:46
-
UINT16
unsigned int UINT16
Definition: types.h:49
+
UINT8
unsigned char UINT8
Definition: types.h:46
+
INT16
signed int INT16
Definition: types.h:49
+
UINT16
unsigned int UINT16
Definition: types.h:52
fixed
union _fixed fixed
-
DWORD
INT32 DWORD
Definition: types.h:66
-
BYTE
INT8 BYTE
Definition: types.h:53
-
INT32
signed long INT32
Definition: types.h:52
-
UINT32
unsigned long UINT32
Definition: types.h:55
-
ULWORD
UINT32 ULWORD
Definition: types.h:64
+
DWORD
INT32 DWORD
Definition: types.h:68
+
BYTE
INT8 BYTE
Definition: types.h:55
+
INT32
signed long INT32
Definition: types.h:55
+
UINT32
unsigned long UINT32
Definition: types.h:58
+
ULWORD
UINT32 ULWORD
Definition: types.h:66
types.h
-
_fixed::w
UWORD w
Definition: types.h:85
+
_fixed::w
UWORD w
Definition: types.h:87
types.h
-
UBYTE
UINT8 UBYTE
Definition: types.h:56
-
UDWORD
UINT32 UDWORD
Definition: types.h:68
-
WORD
INT16 WORD
Definition: types.h:58
-
_fixed::l
UBYTE l
Definition: types.h:78
-
BOOLEAN
INT8 BOOLEAN
Definition: types.h:41
-
_fixed::h
UBYTE h
Definition: types.h:79
-
LWORD
INT32 LWORD
Definition: types.h:62
-
UWORD
UINT16 UWORD
Definition: types.h:60
+
UBYTE
UINT8 UBYTE
Definition: types.h:58
+
UDWORD
UINT32 UDWORD
Definition: types.h:70
+
WORD
INT16 WORD
Definition: types.h:60
+
_fixed::l
UBYTE l
Definition: types.h:80
+
BOOLEAN
INT8 BOOLEAN
Definition: types.h:51
+
_fixed::h
UBYTE h
Definition: types.h:81
+
LWORD
INT32 LWORD
Definition: types.h:64
+
UWORD
UINT16 UWORD
Definition: types.h:62
_fixed::b
struct _fixed::@2 b
-
INT8
signed char INT8
Definition: types.h:40
-
_fixed
Definition: types.h:76
+
INT8
signed char INT8
Definition: types.h:43
+
_fixed
Definition: types.h:78
- -

◆ memset()

+ +

◆ memset()

@@ -302,7 +305,7 @@ Functions - size_t  + size_t  n  @@ -554,6 +557,54 @@ Functions

Warning: If there is no \0 in the first n bytes of s2 then s1 will not be null terminated.

Returns: Pointer to s1

+
+
+ +

◆ memcmp()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
int memcmp (const void * buf1,
const void * buf2,
size_t count 
)
+
+

Compares buffers

+
Parameters
+ + + + +
buf1First buffer to compare
buf2Second buffer to compare
countBuffer length
+
+
+

Returns:

+
diff --git a/docs/api/asm_2z80_2string_8h.js b/docs/api/asm_2z80_2string_8h.js index 70388841..046f0554 100644 --- a/docs/api/asm_2z80_2string_8h.js +++ b/docs/api/asm_2z80_2string_8h.js @@ -4,11 +4,12 @@ var asm_2z80_2string_8h = [ "strcmp", "asm_2z80_2string_8h.html#a11bd144d7d44914099a3aeddf1c8567d", null ], [ "memcpy", "asm_2z80_2string_8h.html#abec66c0a707472b9090ea4cd0402d648", null ], [ "memmove", "asm_2z80_2string_8h.html#a854ba725a4e429439ccf93b1f5ad7b3a", null ], - [ "memset", "asm_2z80_2string_8h.html#a558614036595364d1ddea9e8a4d6d475", null ], + [ "memset", "asm_2z80_2string_8h.html#a6491121b0087a8848354d9de3aa2444b", null ], [ "reverse", "asm_2z80_2string_8h.html#a81863156a28fd2eefeee6859d768bdb1", null ], [ "strcat", "asm_2z80_2string_8h.html#a13c88f5a8475fd7de5d81553cb29724a", null ], [ "strlen", "asm_2z80_2string_8h.html#ac952c3ccec84a458a4d385c5273c1ca0", null ], [ "strncat", "asm_2z80_2string_8h.html#a168580a0ddcb7fe754a711309966c99d", null ], [ "strncmp", "asm_2z80_2string_8h.html#a861dba2d93de82f087707bb795f5c602", null ], - [ "strncpy", "asm_2z80_2string_8h.html#a796a9459c4f362e51c00307044c40ed5", null ] + [ "strncpy", "asm_2z80_2string_8h.html#a796a9459c4f362e51c00307044c40ed5", null ], + [ "memcmp", "asm_2z80_2string_8h.html#add78645dba711c548ab16d056fb83b7e", null ] ]; \ No newline at end of file diff --git a/docs/api/asm_2z80_2string_8h_source.html b/docs/api/asm_2z80_2string_8h_source.html index f561006e..55322f89 100644 --- a/docs/api/asm_2z80_2string_8h_source.html +++ b/docs/api/asm_2z80_2string_8h_source.html @@ -29,6 +29,7 @@
GBDK 2020 Docs +  4.0.6
API Documentation for GBDK 2020
@@ -95,46 +96,50 @@ $(document).ready(function(){initNavTree('asm_2z80_2string_8h_source.html','');
6 
7 #include <types.h>
8 
-
20 char *strcpy(char *dest, const char *src) OLDCALL;
+
20 char *strcpy(char *dest, const char *src) OLDCALL;
21 
-
32 int strcmp(const char *s1, const char *s2);
+
32 int strcmp(const char *s1, const char *s2);
33 
-
42 void *memcpy(void *dest, const void *src, size_t len) OLDCALL;
+
42 void *memcpy(void *dest, const void *src, size_t len) OLDCALL;
43 
46 void *memmove (void *dest, const void *src, size_t n) OLDCALL;
47 
-
54 void *memset (void *s, int c, size_t n) __z88dk_callee;
+
54 void *memset (void *s, int c, size_t n) Z88DK_CALLEE;
55 
-
66 char *reverse(char *s) NONBANKED;
+
66 char *reverse(char *s) NONBANKED;
67 
-
79 char *strcat(char *s1, const char *s2) NONBANKED;
+
79 char *strcat(char *s1, const char *s2) NONBANKED;
80 
-
87 int strlen(const char *s) OLDCALL;
+
87 int strlen(const char *s) OLDCALL;
88 
-
99 char *strncat(char *s1, const char *s2, int n) NONBANKED;
+
99 char *strncat(char *s1, const char *s2, int n) NONBANKED;
100 
-
112 int strncmp(const char *s1, const char *s2, int n) NONBANKED;
+
112 int strncmp(const char *s1, const char *s2, int n) NONBANKED;
113 
-
129 char *strncpy(char *s1, const char *s2, int n) NONBANKED;
+
129 char *strncpy(char *s1, const char *s2, int n) NONBANKED;
130 
-
131 #endif
+
142 int memcmp(const void *buf1, const void *buf2, size_t count) Z88DK_CALLEE;
+
143 
+
144 #endif
-
memcpy
void * memcpy(void *dest, const void *src, size_t len) OLDCALL __preserves_regs(b
+
strcpy
char * strcpy(char *dest, const char *src) OLDCALL PRESERVES_REGS(b
types.h
+
reverse
char * reverse(char *s) OLDCALL PRESERVES_REGS(b
+
memcmp
int memcmp(const void *buf1, const void *buf2, size_t count) OLDCALL
c
char c
Definition: string.h:20
-
strlen
int strlen(const char *s) OLDCALL __preserves_regs(b
strncat
char * strncat(char *s1, const char *s2, int n)
-
reverse
char * reverse(char *s) OLDCALL __preserves_regs(b
+
Z88DK_CALLEE
#define Z88DK_CALLEE
Definition: types.h:42
memmove
void * memmove(void *dest, const void *src, size_t n)
-
strcmp
int strcmp(const char *s1, const char *s2) OLDCALL __preserves_regs(b
+
memset
void * memset(void *s, int c, size_t n) OLDCALL PRESERVES_REGS(b
+
memcpy
void * memcpy(void *dest, const void *src, size_t len) OLDCALL PRESERVES_REGS(b
strncmp
int strncmp(const char *s1, const char *s2, int n)
-
OLDCALL
#define OLDCALL
Definition: types.h:21
+
OLDCALL
#define OLDCALL
Definition: types.h:19
strcat
char * strcat(char *s1, const char *s2)
-
NONBANKED
#define NONBANKED
Definition: types.h:12
+
strcmp
int strcmp(const char *s1, const char *s2) OLDCALL PRESERVES_REGS(b
strncpy
char * strncpy(char *s1, const char *s2, int n)
-
strcpy
char * strcpy(char *dest, const char *src) OLDCALL __preserves_regs(b
-
memset
void * memset(void *s, int c, size_t n) OLDCALL __preserves_regs(b
+
NONBANKED
#define NONBANKED
Definition: types.h:36
+
strlen
int strlen(const char *s) OLDCALL PRESERVES_REGS(b
-
UINT8
unsigned char UINT8
Definition: types.h:43
-
INT16
signed int INT16
Definition: types.h:46
-
UINT16
unsigned int UINT16
Definition: types.h:49
-
INT32
signed long INT32
Definition: types.h:52
-
UINT32
unsigned long UINT32
Definition: types.h:55
-
clock_t
UINT16 clock_t
Definition: types.h:65
-
size_t
int size_t
Definition: types.h:59
-
INT8
signed char INT8
Definition: types.h:40
+
UINT8
unsigned char UINT8
Definition: types.h:46
+
INT16
signed int INT16
Definition: types.h:49
+
UINT16
unsigned int UINT16
Definition: types.h:52
+
INT32
signed long INT32
Definition: types.h:55
+
size_t
unsigned int size_t
Definition: types.h:62
+
UINT32
unsigned long UINT32
Definition: types.h:58
+
INT8
signed char INT8
Definition: types.h:43
+
clock_t
unsigned int clock_t
Definition: types.h:68
-
-Macros | -Functions
bgb_emu.h File Reference
-
#include <types.h>
+
#include <gb/emu_debug.h>

Go to the source code of this file.

- - - - - - - - - - - - -

-Macros

#define BGB_MESSAGE(message_text)   BGB_MESSAGE1(BGB_MACRONAME(__LINE__), message_text)
 
#define BGB_PROFILE_BEGIN(MSG)   BGB_MESSAGE_SUFFIX(MSG, "%ZEROCLKS%");
 
#define BGB_PROFILE_END(MSG)   BGB_MESSAGE_SUFFIX(MSG,"%-8+LASTCLKS%");
 
#define BGB_TEXT(MSG)   BGB_MESSAGE(MSG)
 
#define BGB_BREAKPOINT   __asm__("ld b, b");
 
- - - - - -

-Functions

void BGB_profiler_message ()
 
void BGB_printf (const char *format,...) OLDCALL
 

Detailed Description

-

Debug window logging and profiling support for the BGB emulator.

-

Also see the bgb_debug example project included with gbdk.

-

See the BGB Manual for more information ("expressions, breakpoint conditions, and debug messages") http://bgb.bircd.org/manual.html#expressions

-

Macro Definition Documentation

- -

◆ BGB_MESSAGE

- -
-
- - - - - - - - -
#define BGB_MESSAGE( message_text)   BGB_MESSAGE1(BGB_MACRONAME(__LINE__), message_text)
-
-

Macro to display a message in the BGB emulator debug message window

-
Parameters
- - -
message_textQuoted text string to display in the debug message window
-
-
-

The following special parameters can be used when bracketed with "%" characters.

    -
  • CPU registers: AF, BC, DE, HL, SP, PC, B, C, D, E, H, L, A, ZERO, ZF, Z, CARRY, CY, IME, ALLREGS
  • -
  • Other state values: ROMBANK, XRAMBANK, SRAMBANK, WRAMBANK, VRAMBANK, TOTALCLKS, LASTCLKS, CLKS2VBLANK
  • -
-

Example: print a message along with the currently active ROM bank.

BGB_MESSAGE("Current ROM Bank is: %ROMBANK%");
-

See the BGB Manual for more information ("expressions, breakpoint conditions, and debug messages") http://bgb.bircd.org/manual.html#expressions

-
See also
BGB_PROFILE_BEGIN(), BGB_PROFILE_END()
- -
-
- -

◆ BGB_PROFILE_BEGIN

- -
-
- - - - - - - - -
#define BGB_PROFILE_BEGIN( MSG)   BGB_MESSAGE_SUFFIX(MSG, "%ZEROCLKS%");
-
-

Macro to Start a profiling block for the BGB emulator

-
Parameters
- - -
MSGQuoted text string to display in the debug message window along with the result
-
-
-

To complete the profiling block and print the result call BGB_PROFILE_END.

-
See also
BGB_PROFILE_END(), BGB_MESSAGE()
- -
-
- -

◆ BGB_PROFILE_END

- -
-
- - - - - - - - -
#define BGB_PROFILE_END( MSG)   BGB_MESSAGE_SUFFIX(MSG,"%-8+LASTCLKS%");
-
-

Macro to End a profiling block and print the results in the BGB emulator debug message window

-
Parameters
- - -
MSGQuoted text string to display in the debug message window along with the result
-
-
-

This should only be called after a previous call to BGB_PROFILE_BEGIN()

-

The results are in BGB clock units, which are "1 nop in [CGB] doublespeed mode".

-

So when running in Normal Speed mode (i.e. non-CGB doublespeed) the printed result should be divided by 2 to get the actual ellapsed cycle count.

-

If running in CB Double Speed mode use the below call instead, it correctly compensates for the speed difference. In this scenario, the result does not need to be divided by 2 to get the ellapsed cycle count.

BGB_MESSAGE("NOP TIME: %-4+LASTCLKS%");
-
See also
BGB_PROFILE_BEGIN(), BGB_MESSAGE()
- -
-
- -

◆ BGB_TEXT

- -
-
- - - - - - - - -
#define BGB_TEXT( MSG)   BGB_MESSAGE(MSG)
-
- -
-
- -

◆ BGB_BREAKPOINT

- -
-
- - - - -
#define BGB_BREAKPOINT   __asm__("ld b, b");
-
-

BGB will break into debugger when encounters this line

- -
-
-

Function Documentation

- -

◆ BGB_profiler_message()

- -
-
- - - - - - - -
void BGB_profiler_message ()
-
-

Display preset debug information in the BGB debug messages window.

-

This function is equivalent to:

BGB_MESSAGE("PROFILE,%(SP+$0)%,%(SP+$1)%,%A%,%TOTALCLKS%,%ROMBANK%,%WRAMBANK%");
-
-
-
- -

◆ BGB_printf()

- -
-
- - - - - - - - - - - - - - - - - - -
void BGB_printf (const char * format,
 ... 
)
-
-

Print the string and arguments given by format to the BGB emulator debug message window

-
Parameters
- - -
formatThe format string as per printf
-
-
-

Does not return the number of characters printed. Result string MUST BE LESS OR EQUAL THAN 128 BYTES LONG, INCLUDING THE TRAILIG ZERO BYTE!

-

Currently supported:

    -
  • %hx (char as hex)
  • -
  • %hu (unsigned char)
  • -
  • %hd (signed char)
  • -
  • %c (character)
  • -
  • %u (unsigned int)
  • -
  • %d (signed int)
  • -
  • %x (unsigned int as hex)
  • -
  • %s (string)
  • -
-

Warning: to correctly pass chars for printing as chars, they must be explicitly re-cast as such when calling the function. See docs_chars_varargs for more details.

- -
-
-
+

Shim for legacy use of bgb_emu.h which has been migrated to emu_debug.h

+

See the emu_debug example project included with gbdk.

+
-
BGB_MESSAGE
#define BGB_MESSAGE(message_text)
Definition: bgb_emu.h:40
Go to the documentation of this file.
1 
-
12 #ifndef __BGB_EMU_INCLUDE
-
13 #define __BGB_EMU_INCLUDE
-
14 
-
15 #include <types.h>
-
16 
-
40 #define BGB_MESSAGE(message_text) BGB_MESSAGE1(BGB_MACRONAME(__LINE__), message_text)
-
41 #define BGB_MACRONAME(A) BGB_MACRONAME1(A)
-
43 #define BGB_MACRONAME1(A) BGBLOG##A
-
44 
-
45 #define BGB_MESSAGE1(name, message_text) \
-
46 __asm \
-
47 .MACRO name msg_t, ?llbl\
-
48  ld d, d \
-
49  jr llbl \
-
50  .dw 0x6464 \
-
51  .dw 0x0000 \
-
52  .ascii msg_t \
-
53 llbl: \
-
54 .ENDM \
-
55 name ^/message_text/ \
-
56 __endasm
-
57 
-
58 #define BGB_MESSAGE_SUFFIX(message_text, message_suffix) BGB_MESSAGE3(BGB_MACRONAME(__LINE__), message_text, message_suffix)
-
59 #define BGB_MESSAGE3(name, message_text, message_suffix) \
-
60 __asm \
-
61 .MACRO name msg_t, msg_s, ?llbl\
-
62  ld d, d \
-
63  jr llbl \
-
64  .dw 0x6464 \
-
65  .dw 0x0000 \
-
66  .ascii msg_t \
-
67  .ascii msg_s \
-
68 llbl: \
-
69 .ENDM \
-
70 name ^/message_text/, ^/message_suffix/ \
-
71 __endasm
-
72 
-
84 #define BGB_PROFILE_BEGIN(MSG) BGB_MESSAGE_SUFFIX(MSG, "%ZEROCLKS%");
-
85 
-
110 #define BGB_PROFILE_END(MSG) BGB_MESSAGE_SUFFIX(MSG,"%-8+LASTCLKS%");
-
111 #define BGB_TEXT(MSG) BGB_MESSAGE(MSG)
-
112 
- -
122 
-
144 void BGB_printf(const char *format, ...) OLDCALL;
-
145 
-
146 static void * __BGB_PROFILER_INIT = &BGB_profiler_message;
-
147 
-
150 #define BGB_BREAKPOINT __asm__("ld b, b");
-
151 
-
152 #endif
+
8 #ifndef __BGB_EMU_INCLUDE
+
9 #define __BGB_EMU_INCLUDE
+
10 
+
11 #include <gb/emu_debug.h>
+
12 
+
13 #endif
-
OLDCALL
#define OLDCALL
Definition: types.h:21
-
BGB_printf
void BGB_printf(const char *format,...) OLDCALL
-
BGB_profiler_message
void BGB_profiler_message()
+
emu_debug.h
Go to the documentation of this file.
1 
-
15 #ifndef __CRASH_HEANDLER_INCLUDE
-
16 #define __CRASH_HEANDLER_INCLUDE
+
15 #ifndef __CRASH_HANDLER_INCLUDE
+
16 #define __CRASH_HANDLER_INCLUDE
17 
-
23 static void * __CRASH_HEANDLER_INIT = &__HandleCrash;
+
23 static void * __CRASH_HANDLER_INIT = &__HandleCrash;
24 
25 #endif
diff --git a/docs/api/ctype_8h.html b/docs/api/ctype_8h.html index 3d3a4546..62d01968 100644 --- a/docs/api/ctype_8h.html +++ b/docs/api/ctype_8h.html @@ -29,6 +29,7 @@
GBDK 2020 Docs +  4.0.6
API Documentation for GBDK 2020
diff --git a/docs/api/ctype_8h_source.html b/docs/api/ctype_8h_source.html index 2a14dea8..6e6489c4 100644 --- a/docs/api/ctype_8h_source.html +++ b/docs/api/ctype_8h_source.html @@ -29,6 +29,7 @@
GBDK 2020 Docs +  4.0.6
API Documentation for GBDK 2020
diff --git a/docs/api/dir_287c0c0afb5e0fce0a7974866b95ef94.html b/docs/api/dir_287c0c0afb5e0fce0a7974866b95ef94.html index 25da82d3..6c0589b6 100644 --- a/docs/api/dir_287c0c0afb5e0fce0a7974866b95ef94.html +++ b/docs/api/dir_287c0c0afb5e0fce0a7974866b95ef94.html @@ -29,6 +29,7 @@
GBDK 2020 Docs +  4.0.6
API Documentation for GBDK 2020
diff --git a/docs/api/dir_49e56c817e5e54854c35e136979f97ca.html b/docs/api/dir_49e56c817e5e54854c35e136979f97ca.html index 4e36373a..dae5f77d 100644 --- a/docs/api/dir_49e56c817e5e54854c35e136979f97ca.html +++ b/docs/api/dir_49e56c817e5e54854c35e136979f97ca.html @@ -29,6 +29,7 @@
GBDK 2020 Docs +  4.0.6
API Documentation for GBDK 2020
diff --git a/docs/api/dir_68ce43fa3f06453c3f79ef8becebb3b2.html b/docs/api/dir_68ce43fa3f06453c3f79ef8becebb3b2.html index 4fd90aea..4b8c45b1 100644 --- a/docs/api/dir_68ce43fa3f06453c3f79ef8becebb3b2.html +++ b/docs/api/dir_68ce43fa3f06453c3f79ef8becebb3b2.html @@ -29,6 +29,7 @@
GBDK 2020 Docs +  4.0.6
API Documentation for GBDK 2020
diff --git a/docs/api/dir_7a84f275fead463a4aefdc90fba00235.html b/docs/api/dir_7a84f275fead463a4aefdc90fba00235.html index be1aef02..3ca6aebc 100644 --- a/docs/api/dir_7a84f275fead463a4aefdc90fba00235.html +++ b/docs/api/dir_7a84f275fead463a4aefdc90fba00235.html @@ -29,6 +29,7 @@
GBDK 2020 Docs +  4.0.6
API Documentation for GBDK 2020
diff --git a/docs/api/dir_9a64cddab8e5f6fe5be80d8f39cb6a1f.html b/docs/api/dir_9a64cddab8e5f6fe5be80d8f39cb6a1f.html index ea7bfa50..7a5ae06e 100644 --- a/docs/api/dir_9a64cddab8e5f6fe5be80d8f39cb6a1f.html +++ b/docs/api/dir_9a64cddab8e5f6fe5be80d8f39cb6a1f.html @@ -29,6 +29,7 @@
GBDK 2020 Docs +  4.0.6
API Documentation for GBDK 2020
diff --git a/docs/api/dir_aedcfcf321a7f13aa34b51e3093299b2.html b/docs/api/dir_aedcfcf321a7f13aa34b51e3093299b2.html index 5973eff2..eee23f3c 100644 --- a/docs/api/dir_aedcfcf321a7f13aa34b51e3093299b2.html +++ b/docs/api/dir_aedcfcf321a7f13aa34b51e3093299b2.html @@ -29,6 +29,7 @@
GBDK 2020 Docs +  4.0.6
API Documentation for GBDK 2020
diff --git a/docs/api/dir_bdfe001eb73b667f67d57fb851301eb1.html b/docs/api/dir_bdfe001eb73b667f67d57fb851301eb1.html index d8c8ab05..ce4988cc 100644 --- a/docs/api/dir_bdfe001eb73b667f67d57fb851301eb1.html +++ b/docs/api/dir_bdfe001eb73b667f67d57fb851301eb1.html @@ -29,6 +29,7 @@
GBDK 2020 Docs +  4.0.6
API Documentation for GBDK 2020
@@ -102,6 +103,8 @@ Files   file  drawing.h [code]   +file  emu_debug.h [code] +  file  gb.h [code]   file  gbdecompress.h [code] diff --git a/docs/api/dir_bdfe001eb73b667f67d57fb851301eb1.js b/docs/api/dir_bdfe001eb73b667f67d57fb851301eb1.js index ee332574..60bafb0c 100644 --- a/docs/api/dir_bdfe001eb73b667f67d57fb851301eb1.js +++ b/docs/api/dir_bdfe001eb73b667f67d57fb851301eb1.js @@ -1,10 +1,11 @@ var dir_bdfe001eb73b667f67d57fb851301eb1 = [ [ "bcd.h", "bcd_8h.html", "bcd_8h" ], - [ "bgb_emu.h", "bgb__emu_8h.html", "bgb__emu_8h" ], + [ "bgb_emu.h", "bgb__emu_8h.html", null ], [ "cgb.h", "cgb_8h.html", "cgb_8h" ], [ "crash_handler.h", "crash__handler_8h.html", "crash__handler_8h" ], [ "drawing.h", "drawing_8h.html", "drawing_8h" ], + [ "emu_debug.h", "emu__debug_8h.html", "emu__debug_8h" ], [ "gb.h", "gb_8h.html", "gb_8h" ], [ "gbdecompress.h", "gb_2gbdecompress_8h.html", "gb_2gbdecompress_8h" ], [ "hardware.h", "gb_2hardware_8h.html", "gb_2hardware_8h" ], diff --git a/docs/api/dir_ef3b2545113449f8f25e623a543d64e3.html b/docs/api/dir_ef3b2545113449f8f25e623a543d64e3.html index aaa00114..04e53fa6 100644 --- a/docs/api/dir_ef3b2545113449f8f25e623a543d64e3.html +++ b/docs/api/dir_ef3b2545113449f8f25e623a543d64e3.html @@ -29,6 +29,7 @@
GBDK 2020 Docs +  4.0.6
API Documentation for GBDK 2020
diff --git a/docs/api/docs__index_8md.html b/docs/api/docs__index_8md.html index ead5d138..608aeab1 100644 --- a/docs/api/docs__index_8md.html +++ b/docs/api/docs__index_8md.html @@ -29,6 +29,7 @@
GBDK 2020 Docs +  4.0.6
API Documentation for GBDK 2020
diff --git a/docs/api/docs_coding_guidelines.html b/docs/api/docs_coding_guidelines.html index 68edc19c..1f010637 100644 --- a/docs/api/docs_coding_guidelines.html +++ b/docs/api/docs_coding_guidelines.html @@ -29,6 +29,7 @@
GBDK 2020 Docs +  4.0.6
API Documentation for GBDK 2020
@@ -89,42 +90,42 @@ $(document).ready(function(){initNavTree('docs_coding_guidelines.html',''); init
Coding Guidelines
-

+

Learning C / C fundamentals

Writing games and other programs with GBDK will be much easier with a basic understanding of the C language. In particular, understanding how to use C on "Embedded Platforms" (small computing systems, such as the Game Boy) can help you write better code (smaller, faster, less error prone) and avoid common pitfals.

-

+

General C tutorials

-

+

Embedded C introductions

-

+

Game Boy games in C

-

+

Understanding the hardware

In addition to understanding the C language it's important to learn how the Game Boy hardware works. What it is capable of doing, what it isn't able to do, and what resources are available to work with. A good way to do this is by reading the Pandocs and checking out the awesome_gb list.

-

+

Writing optimal C code for the Game Boy and SDCC

The following guidelines can result in better code for the Game Boy, even though some of the guidance may be contrary to typical advice for general purpose computers that have more resources and speed.

-

+

Tools

-

+

GBTD / GBMB, Arrays and the "const" keyword

Important: The old GBTD/GBMB fails to include the const keyword when exporting to C source files for GBDK. That causes arrays to be created in RAM instead of ROM, which wastes RAM, uses a lot of ROM to initialize the RAM arrays and slows the compiler down a lot.

__Use of toxa's updated GBTD/GBMB is highly recommended.__

If you wish to use the original tools, you must add the const keyword every time the graphics are re-exported to C source files.

-

+

Variables

  • Use 8-bit values as much as possible. They will be much more efficient and compact than 16 and 32 bit types.
  • @@ -162,12 +163,12 @@ Variables

... // Use only the upper 8 bits for setting the sprite position move_sprite(0, player[0].h ,player[1].h); -

+

Code structure

GBDK includes several example programs both in C and in assembly. They are located in the examples directory, and in its subdirectories. They can be built by typing make in the correnponding directory.

-

+

banks (various projects)

There are several different projects showing how to use ROM banking with GBDK.

-

+

comm

Illustrates how to use communication routines.

-

+

crash

Demonstrates how to use the optional GBDK crash handler which dumps debug info to the Game Boy screen in the event of a program crash.

-

+

colorbar

The colorbar program, written by Mr. N.U. of TeamKNOx, illustrates the use of colors on a Color GameBoy.

-

+

dscan

Deep Scan is a game written by Mr. N.U. of TeamKNOx that supports the Color GameBoy. Your aim is to destroy the submarines from your boat, and to avoid the projectiles that they send to you. The game should be self-explanatory. The following keys are used:

RIGHT/LEFT   : Move your boat
 A/B          : Send a bomb from one side of your boat
@@ -113,28 +114,28 @@ When game is paused:
 SELECT       : Invert A and B buttons
 RIGHT/LEFT   : Change speed
 UP/DOWN      : Change level
-

+

filltest

Demonstrates various graphics routines.

-

+

fonts

Examples of how to work with the built in font and printing features.

-

+

galaxy

A C translation of the space.s assembly program.

-

+

gb-dtmf

The gb-dtmf, written by Osamu Ohashi, is a Dual Tone Multi-Frequency (DTMF) generator.

-

+

gbdecompress

Demonstrates using gbdecompress to load a compressed tile set into vram.

-

+

irq

Illustrates how to install interrupt handlers.

-

+

large map

Shows how to scroll with maps larger than 32 x 32 tiles using set_bkg_submap(). It fills rows and columns at the edges of the visible viewport (of the hardware Background Map) with the desired sub-region of the large map as it scrolls.

-

+

metasprites

Demonstrates using the metasprite features to move and animate a large sprite.

  • Press A button to show / hide the metasprite
  • @@ -142,31 +143,31 @@ metasprites
  • Press SELECT button to cycle the metasprite through Normal / Flip-Y / Flip-XY / Flip-X
  • Up / Down / Left / Right to move the metasprite
-

+

lcd isr wobble

An example of how to use the LCD ISR for visual special effects

-

+

paint

The paint example is a painting program. It supports different painting tools, drawing modes, and colors. At the moment, it only paints individual pixels. This program illustrates the use of the full-screen drawing library. It also illustrates the use of generic structures and big sprites.

Arrow keys : Move the cursor
 SELECT     : Display/hide the tools palette
 A          : Select tool
-

+

rand

The rand program, written by Luc Van den Borre, illustrates the use of the GBDK random generator.

-

+

ram_fn

The ram_fn example illustrates how to copy functions to RAM or HIRAM, and how to call them from C.

-

+

rpn

A basic RPN calculator. Try entering expressions like 12 134* and then 1789+.

-

+

samptest

Demonstration of playing a sound sample.

-

+

sgb (various)

A collection of examples showing how to use the Super Game Boy API features.

-

+

sound

The sound example is meant for experimenting with the soung generator of the GameBoy (to use on a real GameBoy). The four different sound modes of the GameBoy are available. It also demonstrates the use of bit fields in C (it's a quick hack, so don't expect too much from the code). The following keys are used:

UP/DOWN      : Move the cursor
 RIGHT/LEFT   : Increment/decrement the value
@@ -176,14 +177,14 @@ START        : Play the current mode's sound (or all modes if in control screen)
 START+A      : Play a little music with the current mode's sound
 SELECT       : Change the sound mode (1, 2, 3, 4 and control)
 SELECT+A     : Dump the sound registers to the screen
-

+

space

The space example is an assembly program that demonstrates the use of sprites, window, background, fixed-point values and more. The following keys are used:

Arrow keys     : Change the speed (and direction) of the sprite
 Arrow keys + A : Change the speed (and direction) of the window
 Arrow keys + B : Change the speed (and direction) of the background
 START          : Open/close the door
 SELECT         : Basic fading effect
-

+

templates

Two basic template examples are provided as a starting place for writing your GBDK programs.

diff --git a/docs/api/docs_faq.html b/docs/api/docs_faq.html index 879aa8b1..7caeef0d 100644 --- a/docs/api/docs_faq.html +++ b/docs/api/docs_faq.html @@ -29,6 +29,7 @@
GBDK 2020 Docs +  4.0.6
API Documentation for GBDK 2020
@@ -90,17 +91,30 @@ $(document).ready(function(){initNavTree('docs_faq.html',''); initResizable(); }

-

+

General

+

+Graphics and Resources

+ -

+


+

+

ROM Header Settings

diff --git a/docs/api/docs_links_and_tools.html b/docs/api/docs_links_and_tools.html index 0385b385..04409e4d 100644 --- a/docs/api/docs_links_and_tools.html +++ b/docs/api/docs_links_and_tools.html @@ -29,6 +29,7 @@
GBDK 2020 Docs +  4.0.6
API Documentation for GBDK 2020
@@ -91,7 +92,7 @@ $(document).ready(function(){initNavTree('docs_links_and_tools.html',''); initRe

This is a brief list of useful tools and information. It is not meant to be complete or exhaustive, for a larger list see the Awesome Game Boy Development list.

-

+

SDCC Compiler Suite User Manual

-

+

Getting Help

-

+

Game Boy Documentation

-

+

Sega Master System / Game Gear Documentation

-

+

Tutorials

-

+

Example code

-

+

Graphics Tools

-

+

Music drivers and tools

-

+

Emulators

-

+

Debugging tools

-

+

Continuous Integration and Deployment

This section contains information that may be useful to know or important when upgrading to a newer GBDK release.

-

+

GBDK 2020 versions

-

+

+Porting to GBDK 2020 4.0.6

+
    +
  • Renamed bgb_emu.h to emu_debug.h and BGB_* functions to EMU_*
      +
    • Aliases for the BGB_* ones and a bgb_emu.h shim are present for backward compatibility, but updating to the new naming is recommended
    • +
    +
  • +
+

Porting to GBDK 2020 4.0.5

  • GBDK now requires SDCC 12259 or higher with GBDK-2020 patches
  • @@ -108,18 +117,18 @@ Porting to GBDK 2020 4.0.5
-

+

Porting to GBDK 2020 4.0.4

  • GBDK now requires SDCC 12238 or higher
  • Made sample.h, cgb.h and sgb.h independent from gb.h
-

+

Porting to GBDK 2020 4.0.3

  • No significant changes required
-

+

Porting to GBDK 2020 4.0.2

  • The default font has been reduced from 256 to 96 characters.
      @@ -128,7 +137,7 @@ Porting to GBDK 2020 4.0.2
-

+

Porting to GBDK 2020 4.0.1

  • Important! : The WRAM memory region is no longer automatically initialized to zeros during startup.
      @@ -140,7 +149,7 @@ Porting to GBDK 2020 4.0.1
    • In .ihx files, multiple writes to the same ROM address are now warned about using ihxcheck.
    • set_*_tiles() now wrap maps around horizontal and vertical boundaries correctly. Code relying on it not wrapping correctly may be affected.
    -

    +

    Porting to GBDK 2020 4.0

    • GBDK now requires SDCC 4.0.3 or higher
    • @@ -152,22 +161,22 @@ Porting to GBDK 2020 4.0
    • Setting ROM bytes directly with -Wl-yp0x<address>=0x<value> is no longer supported. Instead use makebin flags. For example, use -Wm-yC instead of -Wl-yp0x143=0xC0. See faq_gb_type_header_setting.
    • OAM symbol has been renamed to _shadow_OAM, that allows accessing shadow OAM directly from C code
    -

    +

    Porting to GBDK 2020 3.2

    • No significant changes required
    -

    +

    Porting to GBDK 2020 3.1.1

    • No significant changes required
    -

    +

    Porting to GBDK 2020 3.1

    -

    +

    Porting to GBDK 2020 3.0.1

    • LCC was upgraded to use SDCC v4.0. Makefile changes may be required
        @@ -184,9 +193,9 @@ Porting to GBDK 2020 3.0.1

      -

      +

      Historical GBDK versions

      -

      +

      GBDK 1.1 to GBDK 2.0

      • Change your int variables to long if they have to be bigger than 255. If they should only contain values between 0 and 255, use an unsigned int.
      • diff --git a/docs/api/docs_releases.html b/docs/api/docs_releases.html index 2d5c1ee0..c5a8faf4 100644 --- a/docs/api/docs_releases.html +++ b/docs/api/docs_releases.html @@ -29,6 +29,7 @@
        GBDK 2020 Docs +  4.0.6
        API Documentation for GBDK 2020
        @@ -90,9 +91,80 @@ $(document).ready(function(){initNavTree('docs_releases.html',''); initResizable

The GBDK 2020 releases can be found on Github: https://github.com/gbdk-2020/gbdk-2020/releases

-

+

GBDK 2020 Release Notes

-

+

+GBDK 2020 4.0.6

+

2022/xx

    +
  • Building GBDK
      +
    • Changed to target older version of macOS (10.10) when building for better compatibility
    • +
    +
  • +
  • Platforms +
  • +
  • Library
      +
    • Added memcmp()
    • +
    • Added add_low_priority_TIM() function for timer interrupts which allow nesting for GB/CGB
    • +
    • Added set_bkg_based_tiles(), set_bkg_based_submap(), set_win_based_tiles(), set_win_based_submap() for when a map's tiles don't start at VRAM index zero
    • +
    • Added clock() for SMS/GG
    • +
    • Added macro definitions for SDCC features:
        +
      • #define SFR __sfr
      • +
      • #define AT(A) __at(A)
      • +
      +
    • +
    • Added check for OAM overflow to metasprite calls for GB/CGB
    • +
    • Added constant definitions PSG_LATCH, PSG_CH0, PSG_CH1, PSG_CH2, PSG_CH3, PSG_VOLUME for SMS/GG
    • +
    • Renamed bgb_emu.h to emu_debug.h and BGB_* functions to EMU_*.
        +
      • Aliases for the BGB_* ones and a bgb_emu.h shim are present for backward compatibility
      • +
      +
    • +
    • Changed headers to wrap SDCC specific features (such as NONBANKED) with #ifdef __SDCC
    • +
    • Changed rand() and arand() to return uint8_t instead of int8_t (closer to the standard)
    • +
    • Fixed declaration for PCM_SAMPLE and definition for AUD3WAVE
    • +
    • Fixed definition of size_t to be unsigned int instead of int
    • +
    • Fixed vmemcpy() and memmove() for SMS/GG
    • +
    • Fixed random number generation for SMS/GG
    • +
    • Fixed letter U appearing as K for min font
    • +
    • Fixed define name in crash_handler.h
    • +
    • Exposed __rand_seed
    • +
    +
  • +
  • Toolchain / Utilities
      +
    • png2asset
        +
      • Added SMS/GG graphics format support
      • +
      • Added 4bpp and SGB borders
      • +
      • Added warning when image size is not an even multiple of tile size
      • +
      • Added -tile_origin offset option for when map tiles do not start at tile 0 in VRAM
      • +
      • Added *_TILE_COUNT definition to output
      • +
      • Fixed CGB ...s_map_attributes type definition in output
      • +
      • Fixed values for num_palettes in output
      • +
      • Fixed incorrect TILE_COUNT value when not -using_structs
      • +
      +
    • +
    • lcc
        +
      • Changed makebin flags to turn off Nintendo logo copy for GB/CGB (use version in crt instead)
      • +
      • Fixed lcc handling of makebin -x* arguments
      • +
      +
    • +
    +
  • +
  • Examples
      +
    • Added logo example (cross-platform)
    • +
    • Added ISR_VECTOR example of a raw ISR vector with no dispatcher for GB/CGB
    • +
    • Changed sgb_border example to use png2asset for graphics
    • +
    • Changed use of set_interrupts() in examples so it's outside critical sections (since it disables/enables interrupts)
    • +
    • Changed cross-platform auto-banks example to use .h header files
    • +
    • Changed SGB border example to also work with SGB on PAL SNES
    • +
    +
  • +
  • Docs
      +
    • Added new section: Migrating From Pre-GBDK-2020 Tutorials
    • +
    +
  • +
+

GBDK 2020 4.0.5

2021/09

@@ -177,16 +249,16 @@ GBDK 2020 4.0.5 -

+

GBDK 2020 4.0.4

2021/06

-

+

GBDK 2020 4.0.3

2021/03

-

+

GBDK 2020 4.0.1

2020/11/14

  • Updated API documentation
  • @@ -300,7 +372,7 @@ GBDK 2020 4.0.1
  • new fill_*_rect() functions to clear rectangle areas
  • runtime initialization code now does not initialize whole WRAM with zeros anymore, that allows BGB to raise exceptions when code tries to read WRAM that was not written before.
  • enhanced SGB support
  • @@ -316,7 +388,7 @@ GBDK 2020 4.0.1
-

+

GBDK 2020 4.0

2020/10/01

  • GBDK now requires SDCC 4.0.3 or higher, that has fully working toolchain. Old link-gbz80 linker is not used anymore, sdldgb and makebin are used to link objects and produce binary roms; maccer tool is no longer needed either
      @@ -345,19 +417,19 @@ GBDK 2020 4.0
-

+

GBDK 2020 3.2

2020/06/05

  • Fixed OAM initialization that was causing a bad access to VRAM
  • Interrupt handlers now wait for lcd controller mode 0 or 1 by default to prevent access to inaccessible VRAM in several functions (like set_bkg_tiles)
  • Several optimizations here and there
-

+

GBDK 2020 3.1.1

2020/05/17

  • Fixed issues with libgcc_s_dw2-1.dll
-

+

GBDK 2020 3.1

2020/05/16

  • Banked functions are working! The patcher is fully integrated in link-gbz80, no extra tools are needed. It is based on Toxa's work
      @@ -375,21 +447,21 @@ GBDK 2020 3.1
-

+

GBDK 2020 3.0.1

2020/04/12

  • Updated SDCC to v.4.0
  • Updated LCC to work with the new compiler
-

+

GBDK 2020 3.0

2020/04/12

  • Initial GBDK 2020 release
    Updated SDCC to v4.0 The new linker is not working so the old version is still there There is an issue with sdagb compiling drawing.s (the JP in line 32 after ".org .MODE_TABLE+4*.G_MODE" it's writing more than 4 bytes invading some addresses required by input.s:41) Because of this, all .s files in libc have been assembled with the old as-gbz80 and that's why it is still included
-

+

Historical GBDK Release Notes

-

+

GBDK 2.96

17 April, 2000
Many changes.
@@ -399,7 +471,7 @@ GBDK 2.96

  • Added full 32 bit long support.
  • Still no floating pt support.
  • -

    +

    GBDK 2.95-3

    19th August, 2000

    @@ -411,7 +483,7 @@ GBDK 2.95-3

    This is an experimental release for those who feel keen. The main change is a new lexer (the first part in the compilation process which recognises words and symbols like '!=' and 'char' and turns them into a token number) which speeds up compilation of large initialised arrays like tile data by a factor of three. Please report any bugs that show up - this is a big change.

    I have also included a 'minimal' release for win32 users which omits the documentation, library sources, and examples. If this is useful I will keep doing it.

    -

    +

    GBDK 2.95-2

    5th August, 2000
    Just a small update. From the README:

    @@ -421,7 +493,7 @@ GBDK 2.95-2
  • Changed the ways globals are exported, reducing the amount of extra junk linked in.
  • Turned on the optimisations in flex. Large constant arrays like tile data should compile a bit faster.
  • -

    +

    GBDK 2.95

    22nd July, 2000

    • Fixed 'a << c' for c = [9..15]
    • @@ -443,7 +515,7 @@ GBDK 2.95

      7th July, 2000
      Information on float and long support. Someone asked about the state of float/long support recently. Heres my reply:

      long support is partly there, as is float support. The compiler will correctly recognise the long and float keywords, and will generate the code for most basic ops (+, -, &, | etc) for longs correctly and will generate the function calls for floats and hard long operations (*, /, %) correctly. However it wont generate float constants in the correct format, nor will it 'return' a long or float - gbdk doesn't yet support returning types of 4 bytes. Unfortunately its not going to make it into 2.95 as there's too much else to do, but I should be able to complete long support for 2.96

      -

      +

      GBDK 2.94

      7th May, 2000
      Many fixes - see the README for more.

      @@ -460,7 +532,7 @@ GBDK 2.94
    -

    +

    GBDK 2.93

    6th April, 2000
    From the README

    @@ -473,7 +545,7 @@ GBDK 2.93
  • The dscan demo now fully works (with a hack :)
  • There is a bug with cached computed values which are later used as pointers. When the value is first used as a BYTE arg, then later as a pointer the pointer fails as the high byte was never computed and is now missing. A temporary fix is to declare something appropriate as 'volatile' to stop the value being cached. See dscan.c/bombs() for an example.
  • -

    +

    GBDK 2.92-2 for win32

    26th March, 2000
    This is a maintenance release for win32 which fixes some of the niggly install problems, especially:

      @@ -492,7 +564,7 @@ GBDK 2.92-2 for win32 Problems with the installer. It seems that the demo of InstallVISE has an unreasonably short time limit. I had planed to use the demo until the license key came through, but there's no sign of the key yet and the 3 day evaluation is up. If anyone knows of a free Windows installer with the ability to modify environment variables, please contact me. I hear that temporarily setting you clock back to the 15th works...

      18th March, 2000
      libc5 version available / "Error creating temp file" Thanks to Rodrigo Couto there is now a Linux/libc5 version of gbdk3-2.92 available - follow the download link above. At least it will be there when the main sourceforge site comes back up... Also some people have reported a bug where the compiler reports '*** Error creating temp file'. Try typing "mkdir c: tmp" from a DOS prompt and see if that helps.

      -

      +

      GBDK 2.92

      8th March, 2000
      Better than 2.91 :). Can now be installed anywhere. All the demos work. See the README for more.

        @@ -507,7 +579,7 @@ GBDK 2.92
    -

    +

    GBDK 2.91

    27th Feb, 2000
    Better than 2.90 and includes Linux, win32 and a source tar ball. Some notes:

    @@ -522,11 +594,11 @@ GBDK 2.91 Icehawk wrote "I did write some rumble pack routines. Just make sure to remind people to add -Wl-yt0x1C or -Wl-yt0x1D or -Wl-yt0x1E depending on sram and battery usage. Find the routines on my site (as usual). =)"

    18th Oct, 1999
    Bug tracking / FAQ up. Try the link on the left to report any bugs with GBDK. It's also the first place to look if your having problems.

    -

    +

    GBDK 2.1.5

    17th Oct, 1999

    -

    The compiler is the same, but some of the libraries have been improved. memset() and memcpy() are much faster, malloc() is fixed, and a high speed fixed block alternative malloc() was added.

    +

    The compiler is the same, but some of the libraries have been improved. memset() and memcpy() are much faster, malloc() is fixed, and a high speed fixed block alternative malloc() was added.

    diff --git a/docs/api/docs_rombanking_mbcs.html b/docs/api/docs_rombanking_mbcs.html index b36c9062..e3147fdb 100644 --- a/docs/api/docs_rombanking_mbcs.html +++ b/docs/api/docs_rombanking_mbcs.html @@ -29,6 +29,7 @@
    GBDK 2020 Docs +  4.0.6
    API Documentation for GBDK 2020
    @@ -89,20 +90,20 @@ $(document).ready(function(){initNavTree('docs_rombanking_mbcs.html',''); initRe
    ROM/RAM Banking and MBCs
    -

    +

    ROM/RAM Banking and MBCs (Memory Bank Controllers)

    The standard Game Boy cartridge with no MBC has a fixed 32K bytes of ROM. In order to make cartridges with larger ROM sizes (to store more code and graphics) MBCs can be used. They allow switching between multiple ROM banks that use the same memory region. Only one of the banks can be selected as active at a given time, while all the other banks are inactive (and so, inaccessible).

    -

    +

    Non-banked cartridges

    Cartridges with no MBC controller are non-banked, they have 32K bytes of fixed ROM space and no switchable banks. For these cartridges the ROM space between 0000h and 7FFFh can be treated as a single large bank of 32K bytes, or as two contiguous banks of 16K bytes in Bank 0 at 0000h - 3FFFh and Bank 1 at 4000h to 7FFFh.

    -

    +

    MBC Banked cartridges (Memory Bank Controllers)

    Cartridges with MBCs allow the the Game Boy to work with ROMS up to 8MB in size and with RAM up to 128kB. Each bank is 16K Bytes.

    • Bank 0 of the ROM is located in the region at 0000h - 3FFFh. It is usually fixed (non-banked) and cannot be switched out for another bank.
    • The higher region at 4000h to 7FFFh is used for switching between different ROM banks.

    See the Pandocs for more details about the individual MBCs and their capabilities.

    -

    +

    Working with Banks

    To assign code and constant data (such as graphics) to a ROM bank and use it:

    • Place the code for your ROM bank in one or several source files.
    • @@ -110,7 +111,7 @@ Working with Banks

  • Specify the number of banks and MBC type during link time.
  • When the program is running and wants to use data or call a function that is in a given bank, manually or automatically set the desired bank to active.
  • -

    +

    Setting the ROM bank for a Source file

    The ROM and RAM bank for a source file can be set in a couple different ways. Multiple different banks cannot be assigned inside the same source file (unless the __addressmod method is used), but multiple source files can share the same bank.

    If no ROM and RAM bank are speciied for a file then the default _CODE, _BSS and _DATA segments are used.

    @@ -120,13 +121,13 @@ Setting the ROM bank for a Source file
  • Using rom_autobanking
  • Note: You can use the NONBANKED keyword to define a function as non-banked if it resides in a source file which has been assigned a bank.

    -

    +

    Setting the RAM bank for a Source file

    -

    +

    Setting the MBC and number of ROM & RAM banks available

    At the link stage this is done with lcc using pass-through switches for makebin.

    +

    The MBC settings below are available when using the makebin MBC switch.

    +

    Additional details available at Pandocs

    +
    # From Makebin source:
    #
    #-Wl-yt<NN> where <NN> is one of the numbers below
    #
    @@ -155,17 +161,17 @@ Setting the MBC and number of ROM & RAM banks available
    # F-ROM+MBC3+TIMER+BATT FF - Hudson HuC-1
    # 10-ROM+MBC3+TIMER+RAM+BATT
    # 11-ROM+MBC3
    -

    +

    Getting Bank Numbers

    The bank number for a banked function, variable or source file can be stored and retrieved using the following macros:

    -

    +

    Banking and Functions

    -

    +

    BANKED/NONBANKED keywords

    Currently active bank: _current_bank

    The global variable _current_bank is updated automatically when calling SWITCH_ROM(), SWITCH_ROM_MBC1() and SWITCH_ROM_MBC5, or when a BANKED function is called.

    -

    +

    +

    Auto-Banking

    -

    A ROM bank auto-assignment feature was added in GBDK 2020 4.0.2.

    +

    A ROM bank auto-assignment feature was added in GBDK 2020 4.0.2.

    Instead of having to manually specify which bank a source file will reside it, the banks can be assigned automatically to make the best use of space. The bank assignment operates on object files, after compiling/assembling and before linking.

    To turn on auto-banking, use the -autobank argument with lcc

    For a source example see the banks_autobank project.

    @@ -279,20 +286,20 @@ Auto-Banking
  • For example consider a fixed-bank source file growing too large to share a bank with an auto-banked source file that was previously assigned to it. To avoid a bank overflow it would be important to have the auto-banked file check every time whether it can share that bank or not.
  • See bankpack for more options and settings
  • -

    +

    Errors related to banking (overflow, multiple writes to same location)

    A bank overflow during compile/link time (in makebin) is when more code and data are allocated to a ROM bank than it has capacity for. The address for any overflowed data will be incorrect and the data is potentially unreachable since it now resides at the start of a different bank instead of the end of the expected bank.

    See the FAQ entry about bank overflow errors.

    The current toolchain can only detect and warn (using ihxcheck) when one bank overflows into another bank that has data at its start. It cannot warn if a bank overflows into an empty one. For more complete detection, you can use the third-party romusage tool.

    -

    +

    Bank space usage

    In order to see how much space is used or remains available in a bank, you can use the third-party romusage tool.

    -

    +

    Other important notes

    -

    +

    Banking example projects

    There are several projects in the GBDK 2020 examples folder which demonstrate different ways to use banking.

    -

    +

    Console Hardware Properties

    Constants that describe properties of the console hardware are listed below. Their values will change to reflect the current console target that is being built.

    -

    +

    Using <gbdk/...> headers

    Some include files under <gbdk/..> are cross platform and others allow the build process to auto-select the correct include file for the current target port and platform (console).

    For example, the following can be used

    #include <gbdk/platform.h>
    @@ -198,14 +216,18 @@ Using <gbdk/...> headers
     

    and

    #include <sms/sms.h>
     #include <sms/metasprites.h>
     

    -

    +

    Cross Platform Example Projects

    GBDK includes an number of cross platform example projects. These projects show how to write code that can be compiled and run on multiple different consoles (for example Game Boy and Game Gear) with, in some cases, minimal differences.

    They also show how to build for multiple target consoles with a single build command and Makefile. The Makefile.targets allows selecting different port and plat settings when calling the build stages.

    -

    +

    +Cross Platform Asset Example

    +

    The cross-platform Logo example project shows how assets can be managed for multiple different console targets together.

    +

    In the example utility_png2asset is used to generate assets in the native format for each console at compile-time from separate source PNG images. The Makefile is set to use the source PNG folder which matches the current console being compiled, and the source code uses set_native_tile_data() to load the assets tiles in native format.

    +

    Porting From Game Boy to Analogue Pocket

    The Analogue Pocket is (for practical purposes) functionally identical to the Game Boy / Color, but has a couple altered register flag and address definitions and a different boot logo. In order for software to be easily ported to the Analogue Pocket, or to run on both, use the following practices.

    -

    +

    Registers and Flags

    Use API defined registers and register flags instead of hardwired ones

    -

    +

    Boot logo

    As long as the target console is set during build time then the correct boot logo will be automatically selected.

    -

    +

    +Porting From Game Boy to Mega Duck / Cougar Boy

    +

    The Mega Duck is fairly similar to the classic Game Boy. It has a couple altered register flag and address definitions, no boot logo and a different startup/entry-point address. In order for software to be easily ported to the Mega Duck, or to run on both, use the following practices.

    +

    +Registers and Flags

    +

    Use API defined registers and register flags instead of hardwired ones

    +

    Porting From Game Boy to SMS/GG

    -

    +

    Tile Data and Tile Map loading

    -

    +

    Tile and Map Data in 2bpp Game Boy Format

    -

    +

    Tile and Map Data in Native Format

    Use the following api calls when assets are avaialble in the native format for each platform.

    set_native_tile_data()

    There are also bit-depth specific API calls:

    -

    +

    Emulated Game Boy Color map attributes on the SMS/Game Gear

    On the Game Boy Color, VBK_REG is used to select between the regular background tile map and the background attribute tile map (for setting tile color palette and other properties).

    This behavior is emulated for the SMS/GG when using set_bkg_tiles() and VBK_REG. It allows writing a 1-byte tile map separately from a 1-byte attributes map.

    Note
    Tile map attributes on SMS/Game Gear use different control bits than the Game Boy Color, so a modified attribute map must be used.
    -

    +

    Hardware Comparison

    The specs below reflect the typical configuration of hardware when used with GBDK and is not meant as a complete list of their capabilities.

    GB/AP

    -

    +

    Safe VRAM / Display Controller Access

    GB/AP

    -

    +

    sdasgb

    SDCC Assembler for the gameboy

    For detailed settings see sdasgb-settings

    @@ -209,7 +210,7 @@ sdasgb
  • Arguments can be passed to it through lcc using -Wa-<argument>
  • -

    +

    bankpack

    Automatic Bank packer

    For detailed settings see bankpack-settings

    @@ -219,7 +220,7 @@ bankpack
  • Arguments can be passed to it through lcc using -Wb-<argument>
  • -

    +

    sdldgb

    The SDCC linker for the gameboy.

    For detailed settings see sdldgb-settings

    @@ -227,7 +228,7 @@ sdldgb
  • Arguments can be passed to it through lcc using -Wl-<argument>
  • -

    +

    ihxcheck

    IHX file validator

    For detailed settings see ihxcheck-settings

    @@ -236,48 +237,52 @@ ihxcheck
  • Arguments can be passed to it through lcc using -Wi-<argument>
  • -

    +

    makebin

    IHX to ROM converter

    -

    For detailed settings see makebin-settings

    -

    Converts .ihx files produced by sdldgb into ROM files (.gb, .gbc).

    -

    +

    Meta sprites

    By default the png will be converted to metasprites. The image will be subdivided into meta sprites of -sw x -sh. In this case png2asset will generate:

    +

    +Super Game Boy Borders (SGB)

    +

    Screen border assets for the Super Game Boy can be generated using png2asset.

    +

    The following flags should be used to perform the conversion:

    +

    See the sgb_border example project for more details.

    diff --git a/docs/api/docs_toolchain_settings.html b/docs/api/docs_toolchain_settings.html index d69dadba..16670cf1 100644 --- a/docs/api/docs_toolchain_settings.html +++ b/docs/api/docs_toolchain_settings.html @@ -29,6 +29,7 @@
    GBDK 2020 Docs +  4.0.6
    API Documentation for GBDK 2020
    @@ -90,7 +91,7 @@ $(document).ready(function(){initNavTree('docs_toolchain_settings.html',''); ini

    -

    +

    lcc settings

    ./lcc [ option | file ]...
    except for -l, options are processed left-to-right before files
    @@ -108,7 +109,7 @@ lcc settings
    -Idir add `dir' to the beginning of the list of #include directories
    -K don't run ihxcheck test on linker ihx output
    -lx search library `x'
    -
    -m select port and platform: "-m[port]:[plat]" ports:gbz80,z80 plats:ap,gb,sms,gg
    +
    -m select port and platform: "-m[port]:[plat]" ports:gbz80,z80 plats:ap,duck,gb,sms,gg
    -N do not search the standard directories for #include files
    -n emit code to check for dereferencing zero pointers
    -no-crt do not auto-include the gbdk crt0.o runtime in linker list
    @@ -129,7 +130,7 @@ lcc settings
    -Woarg specify system-specific `arg'
    -W[pfablim]arg pass `arg' to the preprocessor, compiler, assembler, bankpack, linker, ihxcheck, or makebin

    -

    +

    sdcc settings

    SDCC : z80/gbz80 4.1.6 #12539 (Linux)
    published under GNU General Public License (GPL)
    @@ -244,8 +245,6 @@ sdcc settings
    Special options for the z80 port:
    --callee-saves-bc Force a called function to always save BC
    --portmode= Determine PORT I/O mode (z80/z180)
    -
    -bo <num> use code bank <num>
    -
    -ba <num> use data bank <num>
    --asm= Define assembler name (rgbds/asxxxx/isas/z80asm/gas)
    --codeseg <name> use this name for the code segment
    --constseg <name> use this name for the const segment
    @@ -269,7 +268,7 @@ sdcc settings
    --no-std-crt0 For the z80/gbz80 do not link default crt0.rel
    --legacy-banking Use legacy method to call banked functions

    -

    +

    sdasgb settings

    sdas Assembler V02.00 + NoICE + SDCC mods (GameBoy Z80-like CPU)
    @@ -305,7 +304,7 @@ sdasgb settings
    removing

    -

    +

    sdasz80 settings

    sdas Assembler V02.00 + NoICE + SDCC mods (GameBoy Z80-like CPU)
    @@ -341,7 +340,7 @@ sdasz80 settings
    removing

    -

    +

    bankpack settings

    bankalloc [options] objfile1 objfile2 etc
    Use: Read .o files and auto-assign areas with bank=255.
    @@ -378,7 +377,7 @@ bankpack settings
    S ___bank_<const name> Def0000FF
    (Above can be made by: const void __at(255) __bank_<const name>;

    -

    +

    sdldgb settings

    sdld Linker V03.00 + NoICE + sdld
    @@ -415,7 +414,7 @@ sdldgb settings
    End:
    -e or null line terminates input

    -

    +

    sdldz80 settings

    sdld Linker V03.00 + NoICE + sdld
    @@ -452,7 +451,7 @@ sdldz80 settings
    End:
    -e or null line terminates input

    -

    +

    ihxcheck settings

    ihx_check input_file.ihx [options]
    @@ -463,9 +462,9 @@ ihxcheck settings
    Use: Read a .ihx and warn about overlapped areas.
    Example: "ihx_check build/MyProject.ihx"

    -

    +

    makebin settings

    -
    makebin: convert a Intel IHX file to binary or GameBoy format binary.
    +

    Also see setting_mbc_and_rom_ram_banks

    makebin: convert a Intel IHX file to binary or GameBoy format binary.
    Usage: makebin [options] [<in_file> [<out_file>]]
    Options:
    -p pack mode: the binary file size will be truncated to the last occupied byte
    @@ -494,7 +493,7 @@ makebin settings
    <in_file> optional IHX input file, '-' means stdin. (default: stdin)
    <out_file> optional output file, '-' means stdout. (default: stdout)

    -

    +

    gbcompress settings

    gbcompress [options] infile outfile
    Use: compress a binary file and write it out.
    @@ -506,7 +505,7 @@ gbcompress settings
    --cin : Read input as .c source format (8 bit char ONLY, uses first array found)
    --cout : Write output in .c / .h source format (8 bit char ONLY)
    --varname=<NAME> : specify variable name for c source output
    -
    --alg=<type> : specify compression type. 'rle', 'gb' (default)
    +
    --alg=<type> : specify compression type: 'rle', 'gb' (default)
    Example: "gbcompress binaryfile.bin compressed.bin"
    Example: "gbcompress -d compressedfile.bin decompressed.bin"
    Example: "gbcompress --alg=rle binaryfile.bin compressed.bin"
    @@ -514,7 +513,7 @@ gbcompress settings
    The default compression (gb) is the type used by gbtd/gbmb
    The rle compression is Amiga IFF style

    -

    +

    png2asset settings

    usage: png2asset <file>.png [options]
    -c ouput file (default: <png file>.c)
    @@ -532,7 +531,11 @@ png2asset settings
    -noflip disable tile flip
    -map Export as map (tileset + bg)
    -use_map_attributes Use CGB BG Map attributes (default: palettes are stored for each tile in a separate array)
    -
    -use_structs Group the exported info into structs (default: false)
    +
    -use_structs Group the exported info into structs (default: false) (used by ZGB Game Engine)
    +
    -bpp bits per pixel: 2, 4 (default: 2)
    +
    -max_palettes maximum number of palettes allowed (default: 2)
    +
    -pack_mode gb, sgb or sms (default:GB)
    +
    -tile_origin tile index offset for maps (instead of zero)
    diff --git a/docs/api/docs_using_gbdk.html b/docs/api/docs_using_gbdk.html index 2d37729a..2216054c 100644 --- a/docs/api/docs_using_gbdk.html +++ b/docs/api/docs_using_gbdk.html @@ -29,6 +29,7 @@
    GBDK 2020 Docs +  4.0.6
    API Documentation for GBDK 2020
    @@ -89,15 +90,15 @@ $(document).ready(function(){initNavTree('docs_using_gbdk.html',''); initResizab
    Using GBDK
    -

    +

    Interrupts

    Interrupts allow execution to jump to a different part of your code as soon as an external event occurs - for example the LCD entering the vertical blank period, serial data arriving or the timer reaching its end count. For an example see the irq.c sample project.

    -

    Interrupts in GBDK are handled using the functions disable_interrupts(), enable_interrupts(), set_interrupts(uint8_t ier) and the interrupt service routine (ISR) linkers add_VBL(), add_TIM, add_LCD, add_SIO and add_JOY which add interrupt handlers for the vertical blank, timer, LCD, serial link and joypad interrupts respectively.

    +

    Interrupts in GBDK are handled using the functions disable_interrupts(), enable_interrupts(), set_interrupts(uint8_t ier) and the interrupt service routine (ISR) linkers add_VBL(), add_TIM, add_LCD, add_SIO and add_JOY which add interrupt handlers for the vertical blank, timer, LCD, serial link and joypad interrupts respectively.

    Since an interrupt can occur at any time an Interrupt Service Request (ISR) cannot take any arguments or return anything. Its only way of communicating with the greater program is through the global variables. When interacting with those shared ISR global variables from main code outside the interrupt, it is a good idea to wrap them in a critical {} section in case the interrupt occurs and modifies the variable while it is being used.

    Interrupts should be disabled before adding ISRs. To use multiple interrupts, logical OR the relevant IFLAGs together.

    ISRs should be kept as small and short as possible, do not write an ISR so long that the Game Boy hardware spends all of its time servicing interrupts and has no time spare for the main code.

    For more detail on the Game Boy interrupts consider reading about them in the Pandocs.

    -

    +

    Available Interrupts

    The GameBoy hardware can generate 5 types of interrupts. Custom Interrupt Service Routines (ISRs) can be added in addition to the built-in ones available in GBDK.

      @@ -130,55 +131,56 @@ Available Interrupts

    -

    +

    Adding your own interrupt handler

    It is possible to install your own interrupt handlers (in C or in assembly) for any of these interrupts. Up to 4 chained handlers may be added, with the last added being called last. If the remove_VBL() function is to be called, only three may be added for VBL.

    Interrupt handlers are called in sequence. To install a new interrupt handler, do the following:

    1. Write a function (say foo()) that takes no parameters, and that returns nothing. Remember that the code executed in an interrupt handler must be short.
    2. Inside a __critical { ... } section, install your interrupt handling routines using the add_XXX() function, where XXX is the interrupt that you want to handle.
    3. -
    4. Enable interrupts for the IRQ you want to handle, using the set_interrupts() function. Note that the VBL interrupt is already enabled before the main() function is called. If you want to set the interrupts before main() is called, you must install an initialization routine.
    5. +
    6. Enable interrupts for the IRQ you want to handle, using the set_interrupts() function. Note that the VBL interrupt is already enabled before the main() function is called. If you want to set the interrupts before main() is called, you must install an initialization routine.

    See the irq example project for additional details for a complete example.

    -

    +

    Using your own Interrupt Dispatcher

    If you want to use your own Interrupt Dispatcher instead of the GBDK chained dispatcher (for improved performance), then don't call the add_...() function for the respective interrupt and it's dispatcher won't be installed.

    Then, ISR_VECTOR() or ISR_NESTED_VECTOR() can be used to install a custom ISR handler.

    -

    +

    Returning from Interrupts and STAT mode

    By default when an Interrupt handler completes and is ready to exit it will check STAT_REG and only return at the BEGINNING of either LCD Mode 0 or Mode 1. This helps prevent graphical glitches caused when an ISR interrupts a graphics operation in one mode but returns in a different mode for which that graphics operation is not allowed.

    You can change this behavior using nowait_int_handler() which does not check STAT_REG before returning. Also see wait_int_handler().

    -

    +

    What GBDK does automatically and behind the scenes

    -

    +

    OAM (VRAM Sprite Attribute Table)

    GBDK sets up a Shadow OAM which gets copied automatically to the hardware OAM by the default V-Blank ISR. The Shadow OAM allows updating sprites without worrying about whether it is safe to write to them or not based on the hardware LCD mode.

    -

    +

    Font tiles when using stdio.h

    Including stdio.h and using functions such as printf() will use a large number of the background tiles for font characters. If stdio.h is not included then that space will be available for use with other tiles instead.

    -

    +

    Default Interrupt Service Handlers (ISRs)

    -

    +

    Copying Functions to RAM and HIRAM

    -

    The ram_function example project included with GBDK demonstrates copying functions to RAM and HIRAM.

    -

    It is possible to copy functions to RAM and HIRAM (using the memcpy() and hiramcpy() functions), and execute them from C. The compiler automatically generates two symbols for the start and the end of each function, named start_X and end_X (where X is the name of the function). This enables to calculate the length of a function when copying it to RAM. Ensure you have enough free space in RAM or HIRAM for copying a function.

    +

    See the ram_function example project included with GBDK demonstrates copying functions to RAM and HIRAM.

    +

    Warning! Copying of functions is generally not safe since they may contain jumps to absolute addresses that will not be converted to match the new location.

    +

    It is possible to copy functions to RAM and HIRAM (using the memcpy() and hiramcpy() functions), and execute them from C. Ensure you have enough free space in RAM or HIRAM for copying a function.

    There are basically two ways for calling a function located in RAM, HIRAM, or ROM:

    The second approach is slightly more efficient. Both approaches are demonstrated in the ram_function.c example.

    -

    +

    Mixing C and Assembly

    You can mix C and assembly (ASM) in two ways as described below. For additional detail see the links_sdcc_docs.

    -

    +

    Inline ASM within C source files

    Example:

       __asm__("nop");
    @@ -190,7 +192,7 @@ Inline ASM within C source files
             (ASM code goes here)
         __endasm;
       }
    -

    +

    In Separate ASM files

    Todo:
    This is from GBDK 2.x docs, verify it with GBDK-2020 and modern SDCC

    It is possible to assemble and link files written in ASM alongside files written in C.

    @@ -230,13 +232,13 @@ LD D,H LD E,L ; There is no register to restore RET ; Return result in DE -

    +

    Including binary files in C source with incbin

    Data from binary files can be included in C source files as a const array using the INCBIN() macro.

    See the incbin example project for a demo of how to use it.

    -

    +

    Known Issues and Limitations

    -

    +

    SDCC

    + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    + +
    + +
    + +
    +
    emu_debug.h File Reference
    +
    +
    +
    #include <types.h>
    +
    +

    Go to the source code of this file.

    + + + + + + + + + + + + + + + + + + + + + + + + + + +

    +Macros

    #define EMU_MESSAGE(message_text)   EMU_MESSAGE1(EMU_MACRONAME(__LINE__), message_text)
     
    #define BGB_MESSAGE(message_text)   EMU_MESSAGE(message_text)
     
    #define EMU_PROFILE_BEGIN(MSG)   EMU_MESSAGE_SUFFIX(MSG, "%ZEROCLKS%");
     
    #define BGB_PROFILE_BEGIN(MSG)   EMU_PROFILE_BEGIN(MSG)
     
    #define EMU_PROFILE_END(MSG)   EMU_MESSAGE_SUFFIX(MSG,"%-8+LASTCLKS%");
     
    #define BGB_PROFILE_END(MSG)   EMU_PROFILE_END(MSG)
     
    #define EMU_TEXT(MSG)   EMU_MESSAGE(MSG)
     
    #define BGB_TEXT(MSG)   EMU_TEXT(MSG)
     
    #define BGB_profiler_message()   EMU_profiler_message()
     
    #define BGB_printf(...)   EMU_printf(__VA_ARGS__)
     
    #define EMU_BREAKPOINT   __asm__("ld b, b");
     
    #define BGB_BREAKPOINT   EMU_BREAKPOINT
     
    + + + + + +

    +Functions

    void EMU_profiler_message ()
     
    void EMU_printf (const char *format,...) OLDCALL
     
    +

    Detailed Description

    +

    Debug window logging and profiling support for emulators (BGB, Emulicious, etc).

    +

    Also see the emu_debug example project included with gbdk.

    +

    See the BGB Manual for more information ("expressions, breakpoint conditions, and debug messages") http://bgb.bircd.org/manual.html#expressions

    +

    Macro Definition Documentation

    + +

    ◆ EMU_MESSAGE

    + +
    +
    + + + + + + + + +
    #define EMU_MESSAGE( message_text)   EMU_MESSAGE1(EMU_MACRONAME(__LINE__), message_text)
    +
    +

    Macro to display a message in the emulator debug message window

    +
    Parameters
    + + +
    message_textQuoted text string to display in the debug message window
    +
    +
    +

    The following special parameters can be used when bracketed with "%" characters.

      +
    • CPU registers: AF, BC, DE, HL, SP, PC, B, C, D, E, H, L, A, ZERO, ZF, Z, CARRY, CY, IME, ALLREGS
    • +
    • Other state values: ROMBANK, XRAMBANK, SRAMBANK, WRAMBANK, VRAMBANK, TOTALCLKS, LASTCLKS, CLKS2VBLANK
    • +
    +

    Example: print a message along with the currently active ROM bank.

    EMU_MESSAGE("Current ROM Bank is: %ROMBANK%");
    +

    See the BGB Manual for more information ("expressions, breakpoint conditions, and debug messages") http://bgb.bircd.org/manual.html#expressions

    +
    See also
    EMU_PROFILE_BEGIN(), EMU_PROFILE_END()
    + +
    +
    + +

    ◆ BGB_MESSAGE

    + +
    +
    + + + + + + + + +
    #define BGB_MESSAGE( message_text)   EMU_MESSAGE(message_text)
    +
    + +
    +
    + +

    ◆ EMU_PROFILE_BEGIN

    + +
    +
    + + + + + + + + +
    #define EMU_PROFILE_BEGIN( MSG)   EMU_MESSAGE_SUFFIX(MSG, "%ZEROCLKS%");
    +
    +

    Macro to Start a profiling block for the emulator (BGB, Emulicious, etc)

    +
    Parameters
    + + +
    MSGQuoted text string to display in the debug message window along with the result
    +
    +
    +

    To complete the profiling block and print the result call EMU_PROFILE_END.

    +
    See also
    EMU_PROFILE_END(), EMU_MESSAGE()
    + +
    +
    + +

    ◆ BGB_PROFILE_BEGIN

    + +
    +
    + + + + + + + + +
    #define BGB_PROFILE_BEGIN( MSG)   EMU_PROFILE_BEGIN(MSG)
    +
    + +
    +
    + +

    ◆ EMU_PROFILE_END

    + +
    +
    + + + + + + + + +
    #define EMU_PROFILE_END( MSG)   EMU_MESSAGE_SUFFIX(MSG,"%-8+LASTCLKS%");
    +
    +

    Macro to End a profiling block and print the results in the emulator debug message window

    +
    Parameters
    + + +
    MSGQuoted text string to display in the debug message window along with the result
    +
    +
    +

    This should only be called after a previous call to EMU_PROFILE_BEGIN()

    +

    The results are in Emulator clock units, which are "1 nop in [CGB] doublespeed mode".

    +

    So when running in Normal Speed mode (i.e. non-CGB doublespeed) the printed result should be divided by 2 to get the actual ellapsed cycle count.

    +

    If running in CB Double Speed mode use the below call instead, it correctly compensates for the speed difference. In this scenario, the result does not need to be divided by 2 to get the ellapsed cycle count.

    EMU_MESSAGE("NOP TIME: %-4+LASTCLKS%");
    +
    See also
    EMU_PROFILE_BEGIN(), EMU_MESSAGE()
    + +
    +
    + +

    ◆ BGB_PROFILE_END

    + +
    +
    + + + + + + + + +
    #define BGB_PROFILE_END( MSG)   EMU_PROFILE_END(MSG)
    +
    + +
    +
    + +

    ◆ EMU_TEXT

    + +
    +
    + + + + + + + + +
    #define EMU_TEXT( MSG)   EMU_MESSAGE(MSG)
    +
    + +
    +
    + +

    ◆ BGB_TEXT

    + +
    +
    + + + + + + + + +
    #define BGB_TEXT( MSG)   EMU_TEXT(MSG)
    +
    + +
    +
    + +

    ◆ BGB_profiler_message

    + +
    +
    + + + + + + + +
    #define BGB_profiler_message()   EMU_profiler_message()
    +
    + +
    +
    + +

    ◆ BGB_printf

    + +
    +
    + + + + + + + + +
    #define BGB_printf( ...)   EMU_printf(__VA_ARGS__)
    +
    + +
    +
    + +

    ◆ EMU_BREAKPOINT

    + +
    +
    + + + + +
    #define EMU_BREAKPOINT   __asm__("ld b, b");
    +
    +

    The Emulator will break into debugger when encounters this line

    + +
    +
    + +

    ◆ BGB_BREAKPOINT

    + +
    +
    + + + + +
    #define BGB_BREAKPOINT   EMU_BREAKPOINT
    +
    + +
    +
    +

    Function Documentation

    + +

    ◆ EMU_profiler_message()

    + +
    +
    + + + + + + + +
    void EMU_profiler_message ()
    +
    +

    Display preset debug information in the Emulator debug messages window.

    +

    This function is equivalent to:

    EMU_MESSAGE("PROFILE,%(SP+$0)%,%(SP+$1)%,%A%,%TOTALCLKS%,%ROMBANK%,%WRAMBANK%");
    +
    +
    +
    + +

    ◆ EMU_printf()

    + +
    +
    + + + + + + + + + + + + + + + + + + +
    void EMU_printf (const char * format,
     ... 
    )
    +
    +

    Print the string and arguments given by format to the emulator debug message window

    +
    Parameters
    + + +
    formatThe format string as per printf
    +
    +
    +

    Does not return the number of characters printed. Result string MUST BE LESS OR EQUAL THAN 128 BYTES LONG, INCLUDING THE TRAILIG ZERO BYTE!

    +

    Currently supported:

      +
    • %hx (char as hex)
    • +
    • %hu (unsigned char)
    • +
    • %hd (signed char)
    • +
    • %c (character)
    • +
    • %u (unsigned int)
    • +
    • %d (signed int)
    • +
    • %x (unsigned int as hex)
    • +
    • %s (string)
    • +
    +

    Warning: to correctly pass chars for printing as chars, they must be explicitly re-cast as such when calling the function. See docs_chars_varargs for more details.

    + +
    +
    +
    +
    +
    EMU_MESSAGE
    #define EMU_MESSAGE(message_text)
    Definition: emu_debug.h:40
    + + + + + diff --git a/docs/api/emu__debug_8h.js b/docs/api/emu__debug_8h.js new file mode 100644 index 00000000..58d2d27e --- /dev/null +++ b/docs/api/emu__debug_8h.js @@ -0,0 +1,17 @@ +var emu__debug_8h = +[ + [ "EMU_MESSAGE", "emu__debug_8h.html#a5624be3849bf5308c6cc05bc4a624557", null ], + [ "BGB_MESSAGE", "emu__debug_8h.html#aabd48c83af8f69ed624bb8a83347fa39", null ], + [ "EMU_PROFILE_BEGIN", "emu__debug_8h.html#a5359c3e6ddab89f41f1de770cc3640d4", null ], + [ "BGB_PROFILE_BEGIN", "emu__debug_8h.html#ab5b05deda52856c84f274fb28578b6ee", null ], + [ "EMU_PROFILE_END", "emu__debug_8h.html#acce78126775a7ca3c862459e28203aba", null ], + [ "BGB_PROFILE_END", "emu__debug_8h.html#ab43f94064dc523e99c4aefb440e2c3ed", null ], + [ "EMU_TEXT", "emu__debug_8h.html#ad1ca656789d7d285b352afeaa4cc56bd", null ], + [ "BGB_TEXT", "emu__debug_8h.html#a6afa665bd7d093e7ca2d310cc92b08a9", null ], + [ "BGB_profiler_message", "emu__debug_8h.html#a47c147586d9a21282ce72a83947508e9", null ], + [ "BGB_printf", "emu__debug_8h.html#a892ddea0cd396141c1ae05e384303cbf", null ], + [ "EMU_BREAKPOINT", "emu__debug_8h.html#a9e856b4691d63bb41c5148b9097bd2bb", null ], + [ "BGB_BREAKPOINT", "emu__debug_8h.html#a95c9ae3faadfe6f93a3cac87085b3481", null ], + [ "EMU_profiler_message", "emu__debug_8h.html#a1e2adc0111203ce0f551bcb1d99395df", null ], + [ "EMU_printf", "emu__debug_8h.html#a586ce1ddfba9c35726887ca31f933963", null ] +]; \ No newline at end of file diff --git a/docs/api/emu__debug_8h_source.html b/docs/api/emu__debug_8h_source.html new file mode 100644 index 00000000..b0278dcf --- /dev/null +++ b/docs/api/emu__debug_8h_source.html @@ -0,0 +1,164 @@ + + + + + + + + + +GBDK 2020 Docs: gb/emu_debug.h Source File + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    GBDK 2020 Docs +  4.0.6 +
    +
    API Documentation for GBDK 2020
    +
    +
    + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    + +
    + +
    +
    +
    emu_debug.h
    +
    +
    +Go to the documentation of this file.
    1 
    +
    12 #ifndef __EMU_DEBUG_INCLUDE
    +
    13 #define __EMU_DEBUG_INCLUDE
    +
    14 
    +
    15 #include <types.h>
    +
    16 
    +
    40 #define EMU_MESSAGE(message_text) EMU_MESSAGE1(EMU_MACRONAME(__LINE__), message_text)
    +
    41 #define BGB_MESSAGE(message_text) EMU_MESSAGE(message_text)
    +
    42 
    +
    44 #define EMU_MACRONAME(A) EMU_MACRONAME1(A)
    +
    45 #define EMU_MACRONAME1(A) EMULOG##A
    +
    46 
    +
    47 #define EMU_MESSAGE1(name, message_text) \
    +
    48 __asm \
    +
    49 .MACRO name msg_t, ?llbl\
    +
    50  ld d, d \
    +
    51  jr llbl \
    +
    52  .dw 0x6464 \
    +
    53  .dw 0x0000 \
    +
    54  .ascii msg_t \
    +
    55 llbl: \
    +
    56 .ENDM \
    +
    57 name ^/message_text/ \
    +
    58 __endasm
    +
    59 
    +
    60 #define EMU_MESSAGE_SUFFIX(message_text, message_suffix) EMU_MESSAGE3(EMU_MACRONAME(__LINE__), message_text, message_suffix)
    +
    61 #define EMU_MESSAGE3(name, message_text, message_suffix) \
    +
    62 __asm \
    +
    63 .MACRO name msg_t, msg_s, ?llbl\
    +
    64  ld d, d \
    +
    65  jr llbl \
    +
    66  .dw 0x6464 \
    +
    67  .dw 0x0000 \
    +
    68  .ascii msg_t \
    +
    69  .ascii msg_s \
    +
    70 llbl: \
    +
    71 .ENDM \
    +
    72 name ^/message_text/, ^/message_suffix/ \
    +
    73 __endasm
    +
    74 
    +
    86 #define EMU_PROFILE_BEGIN(MSG) EMU_MESSAGE_SUFFIX(MSG, "%ZEROCLKS%");
    +
    87 #define BGB_PROFILE_BEGIN(MSG) EMU_PROFILE_BEGIN(MSG)
    +
    88 
    +
    113 #define EMU_PROFILE_END(MSG) EMU_MESSAGE_SUFFIX(MSG,"%-8+LASTCLKS%");
    +
    114 #define BGB_PROFILE_END(MSG) EMU_PROFILE_END(MSG)
    +
    115 
    +
    116 #define EMU_TEXT(MSG) EMU_MESSAGE(MSG)
    +
    117 #define BGB_TEXT(MSG) EMU_TEXT(MSG)
    +
    118 
    + +
    128 #define BGB_profiler_message() EMU_profiler_message()
    +
    129 
    +
    151 void EMU_printf(const char *format, ...) OLDCALL;
    +
    152 #define BGB_printf(...) EMU_printf(__VA_ARGS__)
    +
    153 
    +
    154 static void * __EMU_PROFILER_INIT = &EMU_profiler_message;
    +
    155 
    +
    158 #define EMU_BREAKPOINT __asm__("ld b, b");
    +
    159 #define BGB_BREAKPOINT EMU_BREAKPOINT
    +
    160 
    +
    161 #endif
    +
    +
    +
    EMU_printf
    void EMU_printf(const char *format,...) OLDCALL
    +
    EMU_profiler_message
    void EMU_profiler_message()
    +
    OLDCALL
    #define OLDCALL
    Definition: types.h:19
    + + + + + diff --git a/docs/api/far__ptr_8h.html b/docs/api/far__ptr_8h.html index f7681552..65be77bb 100644 --- a/docs/api/far__ptr_8h.html +++ b/docs/api/far__ptr_8h.html @@ -29,6 +29,7 @@
    GBDK 2020 Docs +  4.0.6
    API Documentation for GBDK 2020
    diff --git a/docs/api/far__ptr_8h_source.html b/docs/api/far__ptr_8h_source.html index 23ea65c9..0d2437d1 100644 --- a/docs/api/far__ptr_8h_source.html +++ b/docs/api/far__ptr_8h_source.html @@ -29,6 +29,7 @@
    GBDK 2020 Docs +  4.0.6
    API Documentation for GBDK 2020
    @@ -140,7 +141,7 @@ $(document).ready(function(){initNavTree('far__ptr_8h_source.html',''); initResi
    __call_banked_addr
    volatile void * __call_banked_addr
    uint16_t
    unsigned short int uint16_t
    Definition: stdint.h:52
    stdint.h
    -
    OLDCALL
    #define OLDCALL
    Definition: types.h:21
    +
    OLDCALL
    #define OLDCALL
    Definition: types.h:19
    __far_ptr::fn
    void(* fn)()
    Definition: far_ptr.h:80
    __far_ptr::seg
    uint16_t seg
    Definition: far_ptr.h:77
    __far_ptr
    Definition: far_ptr.h:73
    diff --git a/docs/api/files.html b/docs/api/files.html index 1da36ae6..cdee239b 100644 --- a/docs/api/files.html +++ b/docs/api/files.html @@ -29,6 +29,7 @@
    GBDK 2020 Docs +  4.0.6
    API Documentation for GBDK 2020
    @@ -111,46 +112,47 @@ $(document).ready(function(){initNavTree('files.html',''); initResizable(); });  cgb.h  crash_handler.h  drawing.h - gb.h - gbdecompress.h - hardware.h - isr.h - metasprites.h - sgb.h -  gbdk - bcd.h - console.h - far_ptr.h - font.h - gbdecompress.h - gbdk-lib.h - incbin.h - metasprites.h - platform.h - rledecompress.h - version.h -  sms - gbdecompress.h - hardware.h - metasprites.h - sms.h - stdarg.h - string.h - types.h - assert.h - ctype.h - limits.h - rand.h - setjmp.h - stdatomic.h - stdbool.h - stddef.h - stdint.h - stdio.h - stdlib.h - stdnoreturn.h - time.h - typeof.h + emu_debug.h + gb.h + gbdecompress.h + hardware.h + isr.h + metasprites.h + sgb.h +  gbdk + bcd.h + console.h + far_ptr.h + font.h + gbdecompress.h + gbdk-lib.h + incbin.h + metasprites.h + platform.h + rledecompress.h + version.h +  sms + gbdecompress.h + hardware.h + metasprites.h + sms.h + stdarg.h + string.h + types.h + assert.h + ctype.h + limits.h + rand.h + setjmp.h + stdatomic.h + stdbool.h + stddef.h + stdint.h + stdio.h + stdlib.h + stdnoreturn.h + time.h + typeof.h diff --git a/docs/api/font_8h.html b/docs/api/font_8h.html index b2b6b20b..45a330a4 100644 --- a/docs/api/font_8h.html +++ b/docs/api/font_8h.html @@ -29,6 +29,7 @@
    GBDK 2020 Docs +  4.0.6
    API Documentation for GBDK 2020
    diff --git a/docs/api/font_8h_source.html b/docs/api/font_8h_source.html index 62ccadf7..1323b967 100644 --- a/docs/api/font_8h_source.html +++ b/docs/api/font_8h_source.html @@ -29,6 +29,7 @@
    GBDK 2020 Docs +  4.0.6
    API Documentation for GBDK 2020
    @@ -143,7 +144,7 @@ $(document).ready(function(){initNavTree('font_8h_source.html',''); initResizabl
    font_set
    font_t font_set(font_t font_handle) OLDCALL
    font_t
    uint16_t font_t
    Definition: font.h:24
    stdint.h
    -
    OLDCALL
    #define OLDCALL
    Definition: types.h:21
    +
    OLDCALL
    #define OLDCALL
    Definition: types.h:19
    sfont_handle::first_tile
    uint8_t first_tile
    Definition: font.h:71
    font_ibm
    uint8_t font_ibm[]
    Definition: font.h:32
    pmfont_handle
    struct sfont_handle * pmfont_handle
    Definition: font.h:66
    diff --git a/docs/api/functions.html b/docs/api/functions.html index 43947e5e..ce41bf1a 100644 --- a/docs/api/functions.html +++ b/docs/api/functions.html @@ -29,6 +29,7 @@
    GBDK 2020 Docs +  4.0.6
    API Documentation for GBDK 2020
    diff --git a/docs/api/functions_vars.html b/docs/api/functions_vars.html index 937d8c6e..29d694b4 100644 --- a/docs/api/functions_vars.html +++ b/docs/api/functions_vars.html @@ -29,6 +29,7 @@
    GBDK 2020 Docs +  4.0.6
    API Documentation for GBDK 2020
    diff --git a/docs/api/gb_2gbdecompress_8h.html b/docs/api/gb_2gbdecompress_8h.html index 035a1866..61a241fb 100644 --- a/docs/api/gb_2gbdecompress_8h.html +++ b/docs/api/gb_2gbdecompress_8h.html @@ -29,6 +29,7 @@
    GBDK 2020 Docs +  4.0.6
    API Documentation for GBDK 2020
    @@ -92,20 +93,21 @@ $(document).ready(function(){initNavTree('gb_2gbdecompress_8h.html',''); initRes
    gbdecompress.h File Reference
    -
    #include <stdint.h>
    +
    #include <types.h>
    +#include <stdint.h>

    Go to the source code of this file.

    - - - - - - - - + + + + + + + +

    Functions

    uint16_t gb_decompress (const uint8_t *sour, uint8_t *dest) OLDCALL __preserves_regs(b
     
    void gb_decompress_bkg_data (uint8_t first_tile, const uint8_t *sour) OLDCALL __preserves_regs(b
     
    void gb_decompress_win_data (uint8_t first_tile, const uint8_t *sour) OLDCALL __preserves_regs(b
     
    void gb_decompress_sprite_data (uint8_t first_tile, const uint8_t *sour) OLDCALL __preserves_regs(b
     
    uint16_t gb_decompress (const uint8_t *sour, uint8_t *dest) OLDCALL PRESERVES_REGS(b
     
    void gb_decompress_bkg_data (uint8_t first_tile, const uint8_t *sour) OLDCALL PRESERVES_REGS(b
     
    void gb_decompress_win_data (uint8_t first_tile, const uint8_t *sour) OLDCALL PRESERVES_REGS(b
     
    void gb_decompress_sprite_data (uint8_t first_tile, const uint8_t *sour) OLDCALL PRESERVES_REGS(b
     
    @@ -116,8 +118,8 @@ Variables

    GB-Compress decompressor Compatible with the compression used in GBTD

    See also
    utility_gbcompress "gbcompress"

    GB-Compress decompressor Compatible with the compression used in GBTD

    Function Documentation

    - -

    ◆ gb_decompress()

    + +

    ◆ gb_decompress()

    @@ -149,12 +151,12 @@ Variables

    Variables

    -
    See also
    gb_decompress_bkg_data, gb_decompress_win_data, gb_decompress_sprite_data
    +
    See also
    gb_decompress_bkg_data, gb_decompress_win_data, gb_decompress_sprite_data
    - -

    ◆ gb_decompress_bkg_data()

    + +

    ◆ gb_decompress_bkg_data()

    @@ -187,12 +189,12 @@ Variables

    Note: This function avoids writes during modes 2 & 3

    -
    See also
    gb_decompress_bkg_data, gb_decompress_win_data, gb_decompress_sprite_data
    +
    See also
    gb_decompress_bkg_data, gb_decompress_win_data, gb_decompress_sprite_data
    - -

    ◆ gb_decompress_win_data()

    + +

    ◆ gb_decompress_win_data()

    @@ -224,14 +226,14 @@ Variables -

    This is the same as gb_decompress_bkg_data, since the Window Layer and Background Layer share the same Tile pattern data.

    +

    This is the same as gb_decompress_bkg_data, since the Window Layer and Background Layer share the same Tile pattern data.

    Note: This function avoids writes during modes 2 & 3

    -
    See also
    gb_decompress, gb_decompress_bkg_data, gb_decompress_sprite_data
    +
    See also
    gb_decompress, gb_decompress_bkg_data, gb_decompress_sprite_data
    - -

    ◆ gb_decompress_sprite_data()

    + +

    ◆ gb_decompress_sprite_data()

    @@ -264,7 +266,7 @@ Variables

    Note: This function avoids writes during modes 2 & 3

    -
    See also
    gb_decompress, gb_decompress_bkg_data, gb_decompress_win_data
    +
    See also
    gb_decompress, gb_decompress_bkg_data, gb_decompress_win_data
    diff --git a/docs/api/gb_2gbdecompress_8h.js b/docs/api/gb_2gbdecompress_8h.js index 40e1b026..f4e5f912 100644 --- a/docs/api/gb_2gbdecompress_8h.js +++ b/docs/api/gb_2gbdecompress_8h.js @@ -1,8 +1,8 @@ var gb_2gbdecompress_8h = [ - [ "gb_decompress", "gb_2gbdecompress_8h.html#a076bf72dee1edf05f7aaf542003f349a", null ], - [ "gb_decompress_bkg_data", "gb_2gbdecompress_8h.html#add300dcc2e13630d907441f3f0b78544", null ], - [ "gb_decompress_win_data", "gb_2gbdecompress_8h.html#af81d6d4e6fa886f54ce77c26bea85d78", null ], - [ "gb_decompress_sprite_data", "gb_2gbdecompress_8h.html#a7a57b6a4ce5efc5e5f143844003b947d", null ], + [ "gb_decompress", "gb_2gbdecompress_8h.html#a3370eefd9a88fdefed71eeb92e6861f2", null ], + [ "gb_decompress_bkg_data", "gb_2gbdecompress_8h.html#aed0cb0f1604a80ca5e7fb771b04114d8", null ], + [ "gb_decompress_win_data", "gb_2gbdecompress_8h.html#a85d2eaf4a7c268fe1496fa2b9c626284", null ], + [ "gb_decompress_sprite_data", "gb_2gbdecompress_8h.html#aa4ac6ffb1dc949051e0e72e2aba8e6ff", null ], [ "c", "gb_2gbdecompress_8h.html#a0b3366755f3276b0243c1e0497471b7a", null ] ]; \ No newline at end of file diff --git a/docs/api/gb_2gbdecompress_8h_source.html b/docs/api/gb_2gbdecompress_8h_source.html index f31f3fa0..a14f2a24 100644 --- a/docs/api/gb_2gbdecompress_8h_source.html +++ b/docs/api/gb_2gbdecompress_8h_source.html @@ -29,6 +29,7 @@
    GBDK 2020 Docs +  4.0.6
    API Documentation for GBDK 2020
    @@ -93,32 +94,34 @@ $(document).ready(function(){initNavTree('gb_2gbdecompress_8h_source.html','');
    8 #ifndef __GBDECOMPRESS_H_INCLUDE
    9 #define __GBDECOMPRESS_H_INCLUDE
    10 
    -
    11 #include <stdint.h>
    -
    12 
    -
    20 uint16_t gb_decompress(const uint8_t * sour, uint8_t * dest) OLDCALL __preserves_regs(b, c);
    -
    21 
    +
    11 #include <types.h>
    +
    12 #include <stdint.h>
    +
    13 
    +
    21 uint16_t gb_decompress(const uint8_t * sour, uint8_t * dest) OLDCALL PRESERVES_REGS(b, c);
    22 
    -
    32 void gb_decompress_bkg_data(uint8_t first_tile, const uint8_t * sour) OLDCALL __preserves_regs(b, c);
    -
    33 
    +
    23 
    +
    33 void gb_decompress_bkg_data(uint8_t first_tile, const uint8_t * sour) OLDCALL PRESERVES_REGS(b, c);
    34 
    -
    47 void gb_decompress_win_data(uint8_t first_tile, const uint8_t * sour) OLDCALL __preserves_regs(b, c);
    -
    48 
    +
    35 
    +
    48 void gb_decompress_win_data(uint8_t first_tile, const uint8_t * sour) OLDCALL PRESERVES_REGS(b, c);
    49 
    -
    59 void gb_decompress_sprite_data(uint8_t first_tile, const uint8_t * sour) OLDCALL __preserves_regs(b, c);
    -
    60 
    -
    61 #endif
    +
    50 
    +
    60 void gb_decompress_sprite_data(uint8_t first_tile, const uint8_t * sour) OLDCALL PRESERVES_REGS(b, c);
    +
    61 
    +
    62 #endif
    uint8_t
    unsigned char uint8_t
    Definition: stdint.h:51
    +
    gb_decompress_win_data
    void gb_decompress_win_data(uint8_t first_tile, const uint8_t *sour) OLDCALL PRESERVES_REGS(b
    uint16_t
    unsigned short int uint16_t
    Definition: stdint.h:52
    -
    gb_decompress_sprite_data
    void gb_decompress_sprite_data(uint8_t first_tile, const uint8_t *sour) OLDCALL __preserves_regs(b
    -
    gb_decompress
    uint16_t gb_decompress(const uint8_t *sour, uint8_t *dest) OLDCALL __preserves_regs(b
    -
    gb_decompress_bkg_data
    void gb_decompress_bkg_data(uint8_t first_tile, const uint8_t *sour) OLDCALL __preserves_regs(b
    +
    gb_decompress_bkg_data
    void gb_decompress_bkg_data(uint8_t first_tile, const uint8_t *sour) OLDCALL PRESERVES_REGS(b
    stdint.h
    -
    gb_decompress_win_data
    void gb_decompress_win_data(uint8_t first_tile, const uint8_t *sour) OLDCALL __preserves_regs(b
    -
    b
    void b
    Definition: gb.h:585
    -
    OLDCALL
    #define OLDCALL
    Definition: types.h:21
    -
    c
    uint16_t c
    Definition: gbdecompress.h:20
    +
    b
    void b
    Definition: gb.h:608
    +
    OLDCALL
    #define OLDCALL
    Definition: types.h:19
    +
    gb_decompress
    uint16_t gb_decompress(const uint8_t *sour, uint8_t *dest) OLDCALL PRESERVES_REGS(b
    +
    gb_decompress_sprite_data
    void gb_decompress_sprite_data(uint8_t first_tile, const uint8_t *sour) OLDCALL PRESERVES_REGS(b
    +
    c
    uint16_t c
    Definition: gbdecompress.h:21
    +
    PRESERVES_REGS
    #define PRESERVES_REGS(...)
    Definition: types.h:29
    + +

    ◆ PCM_SAMPLE

    + +
    +
    + + + + +
    __BYTE_REG PCM_SAMPLE[16]
    +
    +
    diff --git a/docs/api/gb_2hardware_8h.js b/docs/api/gb_2hardware_8h.js index c903f364..190fd9e0 100644 --- a/docs/api/gb_2hardware_8h.js +++ b/docs/api/gb_2hardware_8h.js @@ -249,6 +249,7 @@ var gb_2hardware_8h = [ "NR51_REG", "gb_2hardware_8h.html#ab28f97eabd5f32d48ea27d97bd5dc64f", null ], [ "NR52_REG", "gb_2hardware_8h.html#ac429365dce851ca57d8fe4f7c54a1caa", null ], [ "AUD3WAVE", "gb_2hardware_8h.html#a2fe41a6e0abb211cc00a8fca90543966", null ], + [ "PCM_SAMPLE", "gb_2hardware_8h.html#a271367a0bf840e5422b3a7ed541776f8", null ], [ "LCDC_REG", "gb_2hardware_8h.html#a6515fdfaa50eeb7e63faeea54f77cd6b", null ], [ "STAT_REG", "gb_2hardware_8h.html#ad40ebf3b29add46cdd310a7e0802bc6b", null ], [ "SCY_REG", "gb_2hardware_8h.html#a244b162cf13bbcb4fe842d7e298b39c2", null ], diff --git a/docs/api/gb_2hardware_8h_source.html b/docs/api/gb_2hardware_8h_source.html index 761d93e0..2f6c0849 100644 --- a/docs/api/gb_2hardware_8h_source.html +++ b/docs/api/gb_2hardware_8h_source.html @@ -29,6 +29,7 @@
    GBDK 2020 Docs +  4.0.6
    API Documentation for GBDK 2020
    @@ -97,7 +98,7 @@ $(document).ready(function(){initNavTree('gb_2hardware_8h_source.html',''); init
    11 
    12 #define __BYTES extern UBYTE
    13 #define __BYTE_REG extern volatile UBYTE
    -
    14 #define __REG extern volatile __sfr
    +
    14 #define __REG extern volatile SFR
    15 
    18 __BYTES _VRAM[];
    19 __BYTES _VRAM8000[];
    @@ -237,317 +238,344 @@ $(document).ready(function(){initNavTree('gb_2hardware_8h_source.html',''); init
    157 #define AUDENA_OFF 0b00000000
    158 
    159 __BYTE_REG AUD3WAVE[16];
    -
    160 
    -
    161 __REG LCDC_REG;
    -
    162 #define rLCDC LCDC_REG
    -
    163 
    -
    164 #ifdef __TARGET_ap
    -
    165 #define LCDCF_OFF 0b00000000
    -
    166 #define LCDCF_ON 0b00000001
    -
    167 #define LCDCF_WIN9800 0b00000000
    -
    168 #define LCDCF_WIN9C00 0b00000010
    -
    169 #define LCDCF_WINOFF 0b00000000
    -
    170 #define LCDCF_WINON 0b00000100
    -
    171 #define LCDCF_BG8800 0b00000000
    -
    172 #define LCDCF_BG8000 0b00001000
    -
    173 #define LCDCF_BG9800 0b00000000
    -
    174 #define LCDCF_BG9C00 0b00010000
    -
    175 #define LCDCF_OBJ8 0b00000000
    -
    176 #define LCDCF_OBJ16 0b00100000
    -
    177 #define LCDCF_OBJOFF 0b00000000
    -
    178 #define LCDCF_OBJON 0b01000000
    -
    179 #define LCDCF_BGOFF 0b00000000
    -
    180 #define LCDCF_BGON 0b10000000
    -
    181 #define LCDCF_B_ON 0
    -
    182 #define LCDCF_B_WIN9C00 1
    -
    183 #define LCDCF_B_WINON 2
    -
    184 #define LCDCF_B_BG8000 3
    -
    185 #define LCDCF_B_BG9C00 4
    -
    186 #define LCDCF_B_OBJ16 5
    -
    187 #define LCDCF_B_OBJON 6
    -
    188 #define LCDCF_B_BGON 7
    -
    189 #else
    -
    190 #define LCDCF_OFF 0b00000000
    -
    191 #define LCDCF_ON 0b10000000
    -
    192 #define LCDCF_WIN9800 0b00000000
    -
    193 #define LCDCF_WIN9C00 0b01000000
    -
    194 #define LCDCF_WINOFF 0b00000000
    -
    195 #define LCDCF_WINON 0b00100000
    -
    196 #define LCDCF_BG8800 0b00000000
    -
    197 #define LCDCF_BG8000 0b00010000
    -
    198 #define LCDCF_BG9800 0b00000000
    -
    199 #define LCDCF_BG9C00 0b00001000
    -
    200 #define LCDCF_OBJ8 0b00000000
    -
    201 #define LCDCF_OBJ16 0b00000100
    -
    202 #define LCDCF_OBJOFF 0b00000000
    -
    203 #define LCDCF_OBJON 0b00000010
    -
    204 #define LCDCF_BGOFF 0b00000000
    -
    205 #define LCDCF_BGON 0b00000001
    -
    206 #define LCDCF_B_ON 7
    -
    207 #define LCDCF_B_WIN9C00 6
    -
    208 #define LCDCF_B_WINON 5
    -
    209 #define LCDCF_B_BG8000 4
    -
    210 #define LCDCF_B_BG9C00 3
    -
    211 #define LCDCF_B_OBJ16 2
    -
    212 #define LCDCF_B_OBJON 1
    -
    213 #define LCDCF_B_BGON 0
    -
    214 #endif
    -
    215 
    -
    216 __REG STAT_REG;
    -
    217 #define rSTAT STAT_REG
    -
    218 
    -
    219 #ifdef __TARGET_ap
    -
    220 #define STATF_LYC 0b00000010
    -
    221 #define STATF_MODE10 0b00000100
    -
    222 #define STATF_MODE01 0b00001000
    -
    223 #define STATF_MODE00 0b00010000
    -
    224 #define STATF_LYCF 0b00100000
    -
    225 #define STATF_HBL 0b00000000
    -
    226 #define STATF_VBL 0b10000000
    -
    227 #define STATF_OAM 0b01000000
    -
    228 #define STATF_LCD 0b11000000
    -
    229 #define STATF_BUSY 0b01000000
    -
    230 #define STATF_B_LYC 1
    -
    231 #define STATF_B_MODE10 2
    -
    232 #define STATF_B_MODE01 3
    -
    233 #define STATF_B_MODE00 4
    -
    234 #define STATF_B_LYCF 5
    -
    235 #define STATF_B_VBL 7
    -
    236 #define STATF_B_OAM 6
    -
    237 #define STATF_B_BUSY 6
    -
    238 #else
    -
    239 #define STATF_LYC 0b01000000
    -
    240 #define STATF_MODE10 0b00100000
    -
    241 #define STATF_MODE01 0b00010000
    -
    242 #define STATF_MODE00 0b00001000
    -
    243 #define STATF_LYCF 0b00000100
    -
    244 #define STATF_HBL 0b00000000
    -
    245 #define STATF_VBL 0b00000001
    -
    246 #define STATF_OAM 0b00000010
    -
    247 #define STATF_LCD 0b00000011
    -
    248 #define STATF_BUSY 0b00000010
    -
    249 #define STATF_B_LYC 6
    -
    250 #define STATF_B_MODE10 5
    -
    251 #define STATF_B_MODE01 4
    -
    252 #define STATF_B_MODE00 3
    -
    253 #define STATF_B_LYCF 2
    -
    254 #define STATF_B_VBL 0
    -
    255 #define STATF_B_OAM 1
    -
    256 #define STATF_B_BUSY 1
    -
    257 #endif
    -
    258 
    -
    259 __REG SCY_REG;
    -
    260 #define rSCY
    -
    261 __REG SCX_REG;
    -
    262 #define rSCX SCX_REG
    -
    263 __REG LY_REG;
    -
    264 #define rLY LY_REG
    -
    265 __REG LYC_REG;
    -
    266 #define rLYC LYC_REG
    -
    267 __REG DMA_REG;
    -
    268 #define rDMA DMA_REG
    -
    269 __REG BGP_REG;
    -
    270 #define rBGP BGP_REG
    -
    271 __REG OBP0_REG;
    -
    272 #define rOBP0 OBP0_REG
    -
    273 __REG OBP1_REG;
    -
    274 #define rOBP1 OBP1_REG
    -
    275 __REG WY_REG;
    -
    276 #define rWY WY_REG
    -
    277 __REG WX_REG;
    -
    278 #define rWX WX_REG
    -
    279 __REG KEY1_REG;
    -
    280 #define rKEY1 KEY1_REG
    -
    281 #define rSPD KEY1_REG
    -
    282 
    -
    283 #define KEY1F_DBLSPEED 0b10000000
    -
    284 #define KEY1F_PREPARE 0b00000001
    -
    285 
    -
    286 __REG VBK_REG;
    -
    287 #define rVBK VBK_REG
    -
    288 __REG HDMA1_REG;
    -
    289 #define rHDMA1 HDMA1_REG
    -
    290 __REG HDMA2_REG;
    -
    291 #define rHDMA2 HDMA2_REG
    -
    292 __REG HDMA3_REG;
    -
    293 #define rHDMA3 HDMA3_REG
    -
    294 __REG HDMA4_REG;
    -
    295 #define rHDMA4 HDMA4_REG
    -
    296 __REG HDMA5_REG;
    -
    297 #define rHDMA5 HDMA5_REG
    -
    298 
    -
    299 #define HDMA5F_MODE_GP 0b00000000
    -
    300 #define HDMA5F_MODE_HBL 0b10000000
    -
    301 
    -
    302 #define HDMA5F_BUSY 0b10000000
    -
    303 
    -
    304 __REG RP_REG;
    -
    305 #define rRP RP_REG
    -
    306 
    -
    307 #define RPF_ENREAD 0b11000000
    -
    308 #define RPF_DATAIN 0b00000010
    -
    309 #define RPF_WRITE_HI 0b00000001
    -
    310 #define RPF_WRITE_LO 0b00000000
    +
    160 __BYTE_REG PCM_SAMPLE[16];
    +
    161 
    +
    162 __REG LCDC_REG;
    +
    163 #define rLCDC LCDC_REG
    +
    164 
    +
    165 #if defined(__TARGET_ap)
    +
    166 #define LCDCF_OFF 0b00000000
    +
    167 #define LCDCF_ON 0b00000001
    +
    168 #define LCDCF_WIN9800 0b00000000
    +
    169 #define LCDCF_WIN9C00 0b00000010
    +
    170 #define LCDCF_WINOFF 0b00000000
    +
    171 #define LCDCF_WINON 0b00000100
    +
    172 #define LCDCF_BG8800 0b00000000
    +
    173 #define LCDCF_BG8000 0b00001000
    +
    174 #define LCDCF_BG9800 0b00000000
    +
    175 #define LCDCF_BG9C00 0b00010000
    +
    176 #define LCDCF_OBJ8 0b00000000
    +
    177 #define LCDCF_OBJ16 0b00100000
    +
    178 #define LCDCF_OBJOFF 0b00000000
    +
    179 #define LCDCF_OBJON 0b01000000
    +
    180 #define LCDCF_BGOFF 0b00000000
    +
    181 #define LCDCF_BGON 0b10000000
    +
    182 #define LCDCF_B_ON 0
    +
    183 #define LCDCF_B_WIN9C00 1
    +
    184 #define LCDCF_B_WINON 2
    +
    185 #define LCDCF_B_BG8000 3
    +
    186 #define LCDCF_B_BG9C00 4
    +
    187 #define LCDCF_B_OBJ16 5
    +
    188 #define LCDCF_B_OBJON 6
    +
    189 #define LCDCF_B_BGON 7
    +
    190 #elif defined(__TARGET_duck)
    +
    191 #define LCDCF_OFF 0b00000000
    +
    192 #define LCDCF_ON 0b10000000
    +
    193 #define LCDCF_WIN9800 0b00000000
    +
    194 #define LCDCF_WIN9C00 0b00001000
    +
    195 #define LCDCF_WINOFF 0b00000000
    +
    196 #define LCDCF_WINON 0b00100000
    +
    197 #define LCDCF_BG8800 0b00000000
    +
    198 #define LCDCF_BG8000 0b00010000
    +
    199 #define LCDCF_BG9800 0b00000000
    +
    200 #define LCDCF_BG9C00 0b00000100
    +
    201 #define LCDCF_OBJ8 0b00000000
    +
    202 #define LCDCF_OBJ16 0b00000010
    +
    203 #define LCDCF_OBJOFF 0b00000000
    +
    204 #define LCDCF_OBJON 0b00000001
    +
    205 #define LCDCF_BGOFF 0b00000000
    +
    206 #define LCDCF_BGON 0b01000000
    +
    207 #define LCDCF_B_ON 7
    +
    208 #define LCDCF_B_WIN9C00 3
    +
    209 #define LCDCF_B_WINON 5
    +
    210 #define LCDCF_B_BG8000 4
    +
    211 #define LCDCF_B_BG9C00 2
    +
    212 #define LCDCF_B_OBJ16 1
    +
    213 #define LCDCF_B_OBJON 0
    +
    214 #define LCDCF_B_BGON 6
    +
    215 #else
    +
    216 #define LCDCF_OFF 0b00000000
    +
    217 #define LCDCF_ON 0b10000000
    +
    218 #define LCDCF_WIN9800 0b00000000
    +
    219 #define LCDCF_WIN9C00 0b01000000
    +
    220 #define LCDCF_WINOFF 0b00000000
    +
    221 #define LCDCF_WINON 0b00100000
    +
    222 #define LCDCF_BG8800 0b00000000
    +
    223 #define LCDCF_BG8000 0b00010000
    +
    224 #define LCDCF_BG9800 0b00000000
    +
    225 #define LCDCF_BG9C00 0b00001000
    +
    226 #define LCDCF_OBJ8 0b00000000
    +
    227 #define LCDCF_OBJ16 0b00000100
    +
    228 #define LCDCF_OBJOFF 0b00000000
    +
    229 #define LCDCF_OBJON 0b00000010
    +
    230 #define LCDCF_BGOFF 0b00000000
    +
    231 #define LCDCF_BGON 0b00000001
    +
    232 #define LCDCF_B_ON 7
    +
    233 #define LCDCF_B_WIN9C00 6
    +
    234 #define LCDCF_B_WINON 5
    +
    235 #define LCDCF_B_BG8000 4
    +
    236 #define LCDCF_B_BG9C00 3
    +
    237 #define LCDCF_B_OBJ16 2
    +
    238 #define LCDCF_B_OBJON 1
    +
    239 #define LCDCF_B_BGON 0
    +
    240 #endif
    +
    241 
    +
    242 __REG STAT_REG;
    +
    243 #define rSTAT STAT_REG
    +
    244 
    +
    245 #if defined(__TARGET_ap)
    +
    246 #define STATF_LYC 0b00000010
    +
    247 #define STATF_MODE10 0b00000100
    +
    248 #define STATF_MODE01 0b00001000
    +
    249 #define STATF_MODE00 0b00010000
    +
    250 #define STATF_LYCF 0b00100000
    +
    251 #define STATF_HBL 0b00000000
    +
    252 #define STATF_VBL 0b10000000
    +
    253 #define STATF_OAM 0b01000000
    +
    254 #define STATF_LCD 0b11000000
    +
    255 #define STATF_BUSY 0b01000000
    +
    256 #define STATF_B_LYC 1
    +
    257 #define STATF_B_MODE10 2
    +
    258 #define STATF_B_MODE01 3
    +
    259 #define STATF_B_MODE00 4
    +
    260 #define STATF_B_LYCF 5
    +
    261 #define STATF_B_VBL 7
    +
    262 #define STATF_B_OAM 6
    +
    263 #define STATF_B_BUSY 6
    +
    264 #else
    +
    265 #define STATF_LYC 0b01000000
    +
    266 #define STATF_MODE10 0b00100000
    +
    267 #define STATF_MODE01 0b00010000
    +
    268 #define STATF_MODE00 0b00001000
    +
    269 #define STATF_LYCF 0b00000100
    +
    270 #define STATF_HBL 0b00000000
    +
    271 #define STATF_VBL 0b00000001
    +
    272 #define STATF_OAM 0b00000010
    +
    273 #define STATF_LCD 0b00000011
    +
    274 #define STATF_BUSY 0b00000010
    +
    275 #define STATF_B_LYC 6
    +
    276 #define STATF_B_MODE10 5
    +
    277 #define STATF_B_MODE01 4
    +
    278 #define STATF_B_MODE00 3
    +
    279 #define STATF_B_LYCF 2
    +
    280 #define STATF_B_VBL 0
    +
    281 #define STATF_B_OAM 1
    +
    282 #define STATF_B_BUSY 1
    +
    283 #endif
    +
    284 
    +
    285 __REG SCY_REG;
    +
    286 #define rSCY
    +
    287 __REG SCX_REG;
    +
    288 #define rSCX SCX_REG
    +
    289 __REG LY_REG;
    +
    290 #define rLY LY_REG
    +
    291 __REG LYC_REG;
    +
    292 #define rLYC LYC_REG
    +
    293 __REG DMA_REG;
    +
    294 #define rDMA DMA_REG
    +
    295 __REG BGP_REG;
    +
    296 #define rBGP BGP_REG
    +
    297 __REG OBP0_REG;
    +
    298 #define rOBP0 OBP0_REG
    +
    299 __REG OBP1_REG;
    +
    300 #define rOBP1 OBP1_REG
    +
    301 __REG WY_REG;
    +
    302 #define rWY WY_REG
    +
    303 __REG WX_REG;
    +
    304 #define rWX WX_REG
    +
    305 __REG KEY1_REG;
    +
    306 #define rKEY1 KEY1_REG
    +
    307 #define rSPD KEY1_REG
    +
    308 
    +
    309 #define KEY1F_DBLSPEED 0b10000000
    +
    310 #define KEY1F_PREPARE 0b00000001
    311 
    -
    312 __REG BCPS_REG;
    -
    313 #define rBCPS BCPS_REG
    -
    314 
    -
    315 #define BCPSF_AUTOINC 0b10000000
    -
    316 __REG BCPD_REG;
    -
    317 #define rBCPD BCPD_REG
    -
    318 __REG OCPS_REG;
    -
    319 #define rOCPS OCPS_REG
    -
    320 
    -
    321 #define OCPSF_AUTOINC 0b10000000
    -
    322 __REG OCPD_REG;
    -
    323 #define rOCPD OCPD_REG
    -
    324 __REG SVBK_REG;
    -
    325 #define rSVBK SVBK_REG
    -
    326 #define rSMBK SVBK_REG
    +
    312 __REG VBK_REG;
    +
    313 #define rVBK VBK_REG
    +
    314 __REG HDMA1_REG;
    +
    315 #define rHDMA1 HDMA1_REG
    +
    316 __REG HDMA2_REG;
    +
    317 #define rHDMA2 HDMA2_REG
    +
    318 __REG HDMA3_REG;
    +
    319 #define rHDMA3 HDMA3_REG
    +
    320 __REG HDMA4_REG;
    +
    321 #define rHDMA4 HDMA4_REG
    +
    322 __REG HDMA5_REG;
    +
    323 #define rHDMA5 HDMA5_REG
    +
    324 
    +
    325 #define HDMA5F_MODE_GP 0b00000000
    +
    326 #define HDMA5F_MODE_HBL 0b10000000
    327 
    -
    328 __REG PCM12_REG;
    -
    329 #define rPCM12 PCM12_REG
    -
    330 
    -
    331 __REG PCM34_REG;
    -
    332 #define rPCM34 PCM34_REG
    -
    333 
    -
    334 __REG IE_REG;
    -
    335 #define rIE IE_REG
    -
    336 
    -
    337 #define IEF_HILO 0b00010000
    -
    338 #define IEF_SERIAL 0b00001000
    -
    339 #define IEF_TIMER 0b00000100
    -
    340 #define IEF_STAT 0b00000010
    -
    341 #define IEF_VBLANK 0b00000001
    -
    342 
    -
    343 
    -
    344 /* Square wave duty cycle */
    -
    345 #define AUDLEN_DUTY_12_5 0b00000000
    -
    346 #define AUDLEN_DUTY_25 0b01000000
    -
    347 #define AUDLEN_DUTY_50 0b10000000
    -
    348 #define AUDLEN_DUTY_75 0b11000000
    -
    349 #define AUDLEN_LENGTH(x) (x)
    -
    350 
    -
    351 /* Audio envelope flags */
    -
    352 #define AUDENV_VOL(x) ((x) << 4)
    -
    353 #define AUDENV_UP 0b00001000
    -
    354 #define AUDENV_DOWN 0b00000000
    -
    355 #define AUDENV_LENGTH(x) (x)
    +
    328 #define HDMA5F_BUSY 0b10000000
    +
    329 
    +
    330 __REG RP_REG;
    +
    331 #define rRP RP_REG
    +
    332 
    +
    333 #define RPF_ENREAD 0b11000000
    +
    334 #define RPF_DATAIN 0b00000010
    +
    335 #define RPF_WRITE_HI 0b00000001
    +
    336 #define RPF_WRITE_LO 0b00000000
    +
    337 
    +
    338 __REG BCPS_REG;
    +
    339 #define rBCPS BCPS_REG
    +
    340 
    +
    341 #define BCPSF_AUTOINC 0b10000000
    +
    342 __REG BCPD_REG;
    +
    343 #define rBCPD BCPD_REG
    +
    344 __REG OCPS_REG;
    +
    345 #define rOCPS OCPS_REG
    +
    346 
    +
    347 #define OCPSF_AUTOINC 0b10000000
    +
    348 __REG OCPD_REG;
    +
    349 #define rOCPD OCPD_REG
    +
    350 __REG SVBK_REG;
    +
    351 #define rSVBK SVBK_REG
    +
    352 #define rSMBK SVBK_REG
    +
    353 
    +
    354 __REG PCM12_REG;
    +
    355 #define rPCM12 PCM12_REG
    356 
    -
    357 /* Audio trigger flags */
    -
    358 #define AUDHIGH_RESTART 0b10000000
    -
    359 #define AUDHIGH_LENGTH_ON 0b01000000
    -
    360 #define AUDHIGH_LENGTH_OFF 0b00000000
    -
    361 
    -
    362 /* OAM attributes flags */
    -
    363 #define OAMF_PRI 0b10000000
    -
    364 #define OAMF_YFLIP 0b01000000
    -
    365 #define OAMF_XFLIP 0b00100000
    -
    366 #define OAMF_PAL0 0b00000000
    -
    367 #define OAMF_PAL1 0b00010000
    -
    368 #define OAMF_BANK0 0b00000000
    -
    369 #define OAMF_BANK1 0b00001000
    -
    371 #define OAMF_CGB_PAL0 0b00000000
    -
    372 #define OAMF_CGB_PAL1 0b00000001
    -
    373 #define OAMF_CGB_PAL2 0b00000010
    -
    374 #define OAMF_CGB_PAL3 0b00000011
    -
    375 #define OAMF_CGB_PAL4 0b00000100
    -
    376 #define OAMF_CGB_PAL5 0b00000101
    -
    377 #define OAMF_CGB_PAL6 0b00000110
    -
    378 #define OAMF_CGB_PAL7 0b00000111
    -
    380 #define OAMF_PALMASK 0b00000111
    -
    382 #define DEVICE_SCREEN_X_OFFSET 0
    -
    383 #define DEVICE_SCREEN_Y_OFFSET 0
    -
    384 #define DEVICE_SCREEN_WIDTH 20
    -
    385 #define DEVICE_SCREEN_HEIGHT 18
    -
    386 #define DEVICE_SCREEN_BUFFER_WIDTH 32
    -
    387 #define DEVICE_SCREEN_BUFFER_HEIGHT 32
    -
    388 #define DEVICE_SCREEN_MAP_ENTRY_SIZE 1
    -
    389 #define DEVICE_SPRITE_PX_OFFSET_X 8
    -
    390 #define DEVICE_SPRITE_PX_OFFSET_Y 16
    -
    391 #define DEVICE_SCREEN_PX_WIDTH (DEVICE_SCREEN_WIDTH * 8)
    -
    392 #define DEVICE_SCREEN_PX_HEIGHT (DEVICE_SCREEN_HEIGHT * 8)
    -
    394 #endif
    +
    357 __REG PCM34_REG;
    +
    358 #define rPCM34 PCM34_REG
    +
    359 
    +
    360 __REG IE_REG;
    +
    361 #define rIE IE_REG
    +
    362 
    +
    363 #define IEF_HILO 0b00010000
    +
    364 #define IEF_SERIAL 0b00001000
    +
    365 #define IEF_TIMER 0b00000100
    +
    366 #define IEF_STAT 0b00000010
    +
    367 #define IEF_VBLANK 0b00000001
    +
    368 
    +
    369 
    +
    370 /* Square wave duty cycle */
    +
    371 #define AUDLEN_DUTY_12_5 0b00000000
    +
    372 #define AUDLEN_DUTY_25 0b01000000
    +
    373 #define AUDLEN_DUTY_50 0b10000000
    +
    374 #define AUDLEN_DUTY_75 0b11000000
    +
    375 #define AUDLEN_LENGTH(x) (x)
    +
    376 
    +
    377 /* Audio envelope flags */
    +
    378 #define AUDENV_VOL(x) ((x) << 4)
    +
    379 #define AUDENV_UP 0b00001000
    +
    380 #define AUDENV_DOWN 0b00000000
    +
    381 #define AUDENV_LENGTH(x) (x)
    +
    382 
    +
    383 /* Audio trigger flags */
    +
    384 #define AUDHIGH_RESTART 0b10000000
    +
    385 #define AUDHIGH_LENGTH_ON 0b01000000
    +
    386 #define AUDHIGH_LENGTH_OFF 0b00000000
    +
    387 
    +
    388 /* OAM attributes flags */
    +
    389 #define OAMF_PRI 0b10000000
    +
    390 #define OAMF_YFLIP 0b01000000
    +
    391 #define OAMF_XFLIP 0b00100000
    +
    392 #define OAMF_PAL0 0b00000000
    +
    393 #define OAMF_PAL1 0b00010000
    +
    394 #define OAMF_BANK0 0b00000000
    +
    395 #define OAMF_BANK1 0b00001000
    +
    397 #define OAMF_CGB_PAL0 0b00000000
    +
    398 #define OAMF_CGB_PAL1 0b00000001
    +
    399 #define OAMF_CGB_PAL2 0b00000010
    +
    400 #define OAMF_CGB_PAL3 0b00000011
    +
    401 #define OAMF_CGB_PAL4 0b00000100
    +
    402 #define OAMF_CGB_PAL5 0b00000101
    +
    403 #define OAMF_CGB_PAL6 0b00000110
    +
    404 #define OAMF_CGB_PAL7 0b00000111
    +
    406 #define OAMF_PALMASK 0b00000111
    +
    408 #define DEVICE_SCREEN_X_OFFSET 0
    +
    409 #define DEVICE_SCREEN_Y_OFFSET 0
    +
    410 #define DEVICE_SCREEN_WIDTH 20
    +
    411 #define DEVICE_SCREEN_HEIGHT 18
    +
    412 #define DEVICE_SCREEN_BUFFER_WIDTH 32
    +
    413 #define DEVICE_SCREEN_BUFFER_HEIGHT 32
    +
    414 #define DEVICE_SCREEN_MAP_ENTRY_SIZE 1
    +
    415 #define DEVICE_SPRITE_PX_OFFSET_X 8
    +
    416 #define DEVICE_SPRITE_PX_OFFSET_Y 16
    +
    417 #define DEVICE_SCREEN_PX_WIDTH (DEVICE_SCREEN_WIDTH * 8)
    +
    418 #define DEVICE_SCREEN_PX_HEIGHT (DEVICE_SCREEN_HEIGHT * 8)
    +
    420 #endif
    _RAM
    __BYTES _RAM[]
    Definition: hardware.h:25
    -
    PCM34_REG
    __REG PCM34_REG
    Definition: hardware.h:331
    +
    PCM34_REG
    __REG PCM34_REG
    Definition: hardware.h:357
    _RAMBANK
    __BYTES _RAMBANK[]
    Definition: hardware.h:26
    _AUD3WAVERAM
    __BYTE_REG _AUD3WAVERAM[]
    Definition: hardware.h:29
    __REG
    #define __REG
    Definition: hardware.h:14
    -
    SCX_REG
    __REG SCX_REG
    Definition: hardware.h:261
    -
    HDMA1_REG
    __REG HDMA1_REG
    Definition: hardware.h:288
    -
    HDMA4_REG
    __REG HDMA4_REG
    Definition: hardware.h:294
    +
    SCX_REG
    __REG SCX_REG
    Definition: hardware.h:287
    +
    HDMA1_REG
    __REG HDMA1_REG
    Definition: hardware.h:314
    +
    HDMA4_REG
    __REG HDMA4_REG
    Definition: hardware.h:320
    NR34_REG
    __REG NR34_REG
    Definition: hardware.h:119
    TAC_REG
    __REG TAC_REG
    Definition: hardware.h:65
    -
    OBP1_REG
    __REG OBP1_REG
    Definition: hardware.h:273
    +
    OBP1_REG
    __REG OBP1_REG
    Definition: hardware.h:299
    _IO
    __BYTE_REG _IO[]
    Definition: hardware.h:28
    _VRAM8000
    __BYTES _VRAM8000[]
    Definition: hardware.h:19
    -
    HDMA3_REG
    __REG HDMA3_REG
    Definition: hardware.h:292
    +
    HDMA3_REG
    __REG HDMA3_REG
    Definition: hardware.h:318
    P1_REG
    __REG P1_REG
    Definition: hardware.h:41
    rRAMG
    __BYTE_REG rRAMG
    Definition: hardware.h:34
    NR44_REG
    __REG NR44_REG
    Definition: hardware.h:130
    NR10_REG
    __REG NR10_REG
    Definition: hardware.h:87
    -
    BCPS_REG
    __REG BCPS_REG
    Definition: hardware.h:312
    +
    BCPS_REG
    __REG BCPS_REG
    Definition: hardware.h:338
    SC_REG
    __REG SC_REG
    Definition: hardware.h:57
    TIMA_REG
    __REG TIMA_REG
    Definition: hardware.h:61
    rROMB1
    __BYTE_REG rROMB1
    Definition: hardware.h:36
    NR41_REG
    __REG NR41_REG
    Definition: hardware.h:122
    -
    SVBK_REG
    __REG SVBK_REG
    Definition: hardware.h:324
    +
    SVBK_REG
    __REG SVBK_REG
    Definition: hardware.h:350
    NR43_REG
    __REG NR43_REG
    Definition: hardware.h:126
    IF_REG
    __REG IF_REG
    Definition: hardware.h:84
    NR30_REG
    __REG NR30_REG
    Definition: hardware.h:111
    -
    WX_REG
    __REG WX_REG
    Definition: hardware.h:277
    +
    WX_REG
    __REG WX_REG
    Definition: hardware.h:303
    SB_REG
    __REG SB_REG
    Definition: hardware.h:55
    NR21_REG
    __REG NR21_REG
    Definition: hardware.h:102
    NR14_REG
    __REG NR14_REG
    Definition: hardware.h:99
    -
    VBK_REG
    __REG VBK_REG
    Definition: hardware.h:286
    +
    VBK_REG
    __REG VBK_REG
    Definition: hardware.h:312
    NR13_REG
    __REG NR13_REG
    Definition: hardware.h:97
    NR52_REG
    __REG NR52_REG
    Definition: hardware.h:153
    NR22_REG
    __REG NR22_REG
    Definition: hardware.h:104
    -
    LCDC_REG
    __REG LCDC_REG
    Definition: hardware.h:161
    +
    LCDC_REG
    __REG LCDC_REG
    Definition: hardware.h:162
    NR50_REG
    __REG NR50_REG
    Definition: hardware.h:133
    -
    LY_REG
    __REG LY_REG
    Definition: hardware.h:263
    +
    LY_REG
    __REG LY_REG
    Definition: hardware.h:289
    NR12_REG
    __REG NR12_REG
    Definition: hardware.h:95
    NR32_REG
    __REG NR32_REG
    Definition: hardware.h:115
    _OAMRAM
    __BYTES _OAMRAM[]
    Definition: hardware.h:27
    NR51_REG
    __REG NR51_REG
    Definition: hardware.h:141
    NR11_REG
    __REG NR11_REG
    Definition: hardware.h:93
    -
    DMA_REG
    __REG DMA_REG
    Definition: hardware.h:267
    -
    BGP_REG
    __REG BGP_REG
    Definition: hardware.h:269
    -
    RP_REG
    __REG RP_REG
    Definition: hardware.h:304
    +
    DMA_REG
    __REG DMA_REG
    Definition: hardware.h:293
    +
    BGP_REG
    __REG BGP_REG
    Definition: hardware.h:295
    +
    RP_REG
    __REG RP_REG
    Definition: hardware.h:330
    NR31_REG
    __REG NR31_REG
    Definition: hardware.h:113
    TMA_REG
    __REG TMA_REG
    Definition: hardware.h:63
    -
    PCM12_REG
    __REG PCM12_REG
    Definition: hardware.h:328
    -
    KEY1_REG
    __REG KEY1_REG
    Definition: hardware.h:279
    +
    PCM12_REG
    __REG PCM12_REG
    Definition: hardware.h:354
    +
    KEY1_REG
    __REG KEY1_REG
    Definition: hardware.h:305
    _SRAM
    __BYTES _SRAM[]
    Definition: hardware.h:24
    -
    OCPD_REG
    __REG OCPD_REG
    Definition: hardware.h:322
    +
    OCPD_REG
    __REG OCPD_REG
    Definition: hardware.h:348
    _VRAM9000
    __BYTES _VRAM9000[]
    Definition: hardware.h:21
    -
    HDMA5_REG
    __REG HDMA5_REG
    Definition: hardware.h:296
    -
    LYC_REG
    __REG LYC_REG
    Definition: hardware.h:265
    +
    HDMA5_REG
    __REG HDMA5_REG
    Definition: hardware.h:322
    +
    LYC_REG
    __REG LYC_REG
    Definition: hardware.h:291
    NR33_REG
    __REG NR33_REG
    Definition: hardware.h:117
    DIV_REG
    __REG DIV_REG
    Definition: hardware.h:59
    -
    OBP0_REG
    __REG OBP0_REG
    Definition: hardware.h:271
    -
    BCPD_REG
    __REG BCPD_REG
    Definition: hardware.h:316
    +
    OBP0_REG
    __REG OBP0_REG
    Definition: hardware.h:297
    +
    BCPD_REG
    __REG BCPD_REG
    Definition: hardware.h:342
    __BYTE_REG
    #define __BYTE_REG
    Definition: hardware.h:13
    NR24_REG
    __REG NR24_REG
    Definition: hardware.h:108
    NR23_REG
    __REG NR23_REG
    Definition: hardware.h:106
    -
    IE_REG
    __REG IE_REG
    Definition: hardware.h:334
    +
    IE_REG
    __REG IE_REG
    Definition: hardware.h:360
    _VRAM
    __BYTES _VRAM[]
    Definition: hardware.h:18
    -
    OCPS_REG
    __REG OCPS_REG
    Definition: hardware.h:318
    +
    OCPS_REG
    __REG OCPS_REG
    Definition: hardware.h:344
    rROMB0
    __BYTE_REG rROMB0
    Definition: hardware.h:35
    -
    WY_REG
    __REG WY_REG
    Definition: hardware.h:275
    +
    WY_REG
    __REG WY_REG
    Definition: hardware.h:301
    _HRAM
    __BYTE_REG _HRAM[]
    Definition: hardware.h:30
    rRAMB
    __BYTE_REG rRAMB
    Definition: hardware.h:37
    AUD3WAVE
    __BYTE_REG AUD3WAVE[16]
    Definition: hardware.h:159
    -
    STAT_REG
    __REG STAT_REG
    Definition: hardware.h:216
    +
    STAT_REG
    __REG STAT_REG
    Definition: hardware.h:242
    __BYTES
    #define __BYTES
    Definition: hardware.h:12
    _SCRN0
    __BYTES _SCRN0[]
    Definition: hardware.h:22
    _SCRN1
    __BYTES _SCRN1[]
    Definition: hardware.h:23
    NR42_REG
    __REG NR42_REG
    Definition: hardware.h:124
    _VRAM8800
    __BYTES _VRAM8800[]
    Definition: hardware.h:20
    -
    SCY_REG
    __REG SCY_REG
    Definition: hardware.h:259
    -
    HDMA2_REG
    __REG HDMA2_REG
    Definition: hardware.h:290
    +
    PCM_SAMPLE
    __BYTE_REG PCM_SAMPLE[16]
    Definition: hardware.h:160
    +
    SCY_REG
    __REG SCY_REG
    Definition: hardware.h:285
    +
    HDMA2_REG
    __REG HDMA2_REG
    Definition: hardware.h:316
    Go to the documentation of this file.
    1 
    -
    60 #ifndef _METASPRITES_H_INCLUDE
    -
    61 #define _METASPRITES_H_INCLUDE
    -
    62 
    -
    63 #include <gb/hardware.h>
    -
    64 #include <types.h>
    -
    65 #include <stdint.h>
    -
    66 
    -
    80 typedef struct metasprite_t {
    - - - - -
    85 
    -
    86 #define metasprite_end -128
    -
    87 #define METASPR_ITEM(dy,dx,dt,a) {(dy),(dx),(dt),(a)}
    -
    88 #define METASPR_TERM {metasprite_end}
    -
    89 
    -
    90 extern const void * __current_metasprite;
    - - -
    93 
    -
    94 
    -
    95 static uint8_t __move_metasprite(uint8_t id, uint8_t x, uint8_t y) OLDCALL;
    -
    96 static uint8_t __move_metasprite_vflip(uint8_t id, uint8_t x, uint8_t y) OLDCALL;
    -
    97 static uint8_t __move_metasprite_hflip(uint8_t id, uint8_t x, uint8_t y) OLDCALL;
    -
    98 static uint8_t __move_metasprite_hvflip(uint8_t id, uint8_t x, uint8_t y) OLDCALL;
    -
    99 static void __hide_metasprite(uint8_t id) OLDCALL;
    +
    67 #ifndef _METASPRITES_H_INCLUDE
    +
    68 #define _METASPRITES_H_INCLUDE
    +
    69 
    +
    70 #include <gb/hardware.h>
    +
    71 #include <types.h>
    +
    72 #include <stdint.h>
    +
    73 
    +
    87 typedef struct metasprite_t {
    + + + + +
    92 
    +
    93 #define metasprite_end -128
    +
    94 #define METASPR_ITEM(dy,dx,dt,a) {(dy),(dx),(dt),(a)}
    +
    95 #define METASPR_TERM {metasprite_end}
    +
    96 
    +
    97 extern const void * __current_metasprite;
    + +
    100 
    -
    106 void hide_sprites_range(UINT8 from, UINT8 to) OLDCALL __preserves_regs(b, c);
    +
    101 
    +
    102 static uint8_t __move_metasprite(uint8_t id, uint8_t x, uint8_t y) OLDCALL;
    +
    103 static uint8_t __move_metasprite_vflip(uint8_t id, uint8_t x, uint8_t y) OLDCALL;
    +
    104 static uint8_t __move_metasprite_hflip(uint8_t id, uint8_t x, uint8_t y) OLDCALL;
    +
    105 static uint8_t __move_metasprite_hvflip(uint8_t id, uint8_t x, uint8_t y) OLDCALL;
    +
    106 static void __hide_metasprite(uint8_t id) OLDCALL;
    107 
    -
    130 inline uint8_t move_metasprite(const metasprite_t * metasprite, uint8_t base_tile, uint8_t base_sprite, uint8_t x, uint8_t y) {
    -
    131  __current_metasprite = metasprite;
    -
    132  __current_base_tile = base_tile;
    -
    133  return __move_metasprite(base_sprite, x, y);
    -
    134 }
    -
    135 
    -
    157 inline uint8_t move_metasprite_vflip(const metasprite_t * metasprite, uint8_t base_tile, uint8_t base_sprite, uint8_t x, uint8_t y) {
    -
    158  __current_metasprite = metasprite;
    -
    159  __current_base_tile = base_tile;
    -
    160  return __move_metasprite_vflip(base_sprite, x - 8, y);
    -
    161 }
    -
    162 
    -
    163 
    -
    185 inline uint8_t move_metasprite_hflip(const metasprite_t * metasprite, uint8_t base_tile, uint8_t base_sprite, uint8_t x, uint8_t y) {
    -
    186  __current_metasprite = metasprite;
    -
    187  __current_base_tile = base_tile;
    -
    188  return __move_metasprite_hflip(base_sprite, x, y - ((LCDC_REG & 0x04U) ? 16 : 8) );
    -
    189 }
    -
    190 
    -
    212 inline uint8_t move_metasprite_hvflip(const metasprite_t * metasprite, uint8_t base_tile, uint8_t base_sprite, uint8_t x, uint8_t y) {
    -
    213  __current_metasprite = metasprite;
    -
    214  __current_base_tile = base_tile;
    -
    215  return __move_metasprite_hvflip(base_sprite, x - 8, y - ((LCDC_REG & 0x04U) ? 16 : 8));
    -
    216 }
    -
    217 
    -
    227 inline void hide_metasprite(const metasprite_t * metasprite, uint8_t base_sprite) {
    -
    228  __current_metasprite = metasprite;
    -
    229  __hide_metasprite(base_sprite);
    -
    230 }
    -
    231 
    -
    232 #endif
    + +
    114 
    +
    137 inline uint8_t move_metasprite(const metasprite_t * metasprite, uint8_t base_tile, uint8_t base_sprite, uint8_t x, uint8_t y) {
    +
    138  __current_metasprite = metasprite;
    +
    139  __current_base_tile = base_tile;
    +
    140  return __move_metasprite(base_sprite, x, y);
    +
    141 }
    +
    142 
    +
    166 inline uint8_t move_metasprite_vflip(const metasprite_t * metasprite, uint8_t base_tile, uint8_t base_sprite, uint8_t x, uint8_t y) {
    +
    167  __current_metasprite = metasprite;
    +
    168  __current_base_tile = base_tile;
    +
    169  return __move_metasprite_vflip(base_sprite, x - 8, y);
    +
    170 }
    +
    171 
    +
    172 
    +
    196 inline uint8_t move_metasprite_hflip(const metasprite_t * metasprite, uint8_t base_tile, uint8_t base_sprite, uint8_t x, uint8_t y) {
    +
    197  __current_metasprite = metasprite;
    +
    198  __current_base_tile = base_tile;
    +
    199  return __move_metasprite_hflip(base_sprite, x, y - ((LCDC_REG & 0x04U) ? 16 : 8) );
    +
    200 }
    +
    201 
    +
    225 inline uint8_t move_metasprite_hvflip(const metasprite_t * metasprite, uint8_t base_tile, uint8_t base_sprite, uint8_t x, uint8_t y) {
    +
    226  __current_metasprite = metasprite;
    +
    227  __current_base_tile = base_tile;
    +
    228  return __move_metasprite_hvflip(base_sprite, x - 8, y - ((LCDC_REG & 0x04U) ? 16 : 8));
    +
    229 }
    +
    230 
    +
    240 inline void hide_metasprite(const metasprite_t * metasprite, uint8_t base_sprite) {
    +
    241  __current_metasprite = metasprite;
    +
    242  __hide_metasprite(base_sprite);
    +
    243 }
    +
    244 
    +
    245 #endif
    -
    UINT8
    unsigned char UINT8
    Definition: types.h:43
    +
    UINT8
    unsigned char UINT8
    Definition: types.h:46
    uint8_t
    unsigned char uint8_t
    Definition: stdint.h:51
    int8_t
    signed char int8_t
    Definition: stdint.h:43
    -
    metasprite_t
    Definition: metasprites.h:80
    -
    metasprite_t::props
    uint8_t props
    Definition: metasprites.h:83
    -
    metasprite_t::dy
    int8_t dy
    Definition: metasprites.h:81
    -
    move_metasprite_hvflip
    uint8_t move_metasprite_hvflip(const metasprite_t *metasprite, uint8_t base_tile, uint8_t base_sprite, uint8_t x, uint8_t y)
    Definition: metasprites.h:212
    -
    move_metasprite_hflip
    uint8_t move_metasprite_hflip(const metasprite_t *metasprite, uint8_t base_tile, uint8_t base_sprite, uint8_t x, uint8_t y)
    Definition: metasprites.h:185
    +
    metasprite_t
    Definition: metasprites.h:87
    +
    metasprite_t::props
    uint8_t props
    Definition: metasprites.h:90
    +
    metasprite_t::dy
    int8_t dy
    Definition: metasprites.h:88
    +
    move_metasprite_hvflip
    uint8_t move_metasprite_hvflip(const metasprite_t *metasprite, uint8_t base_tile, uint8_t base_sprite, uint8_t x, uint8_t y)
    Definition: metasprites.h:225
    +
    move_metasprite_hflip
    uint8_t move_metasprite_hflip(const metasprite_t *metasprite, uint8_t base_tile, uint8_t base_sprite, uint8_t x, uint8_t y)
    Definition: metasprites.h:196
    __current_base_tile
    uint8_t __current_base_tile
    -
    LCDC_REG
    __REG LCDC_REG
    Definition: hardware.h:161
    -
    metasprite_t::dx
    int8_t dx
    Definition: metasprites.h:81
    -
    move_metasprite
    uint8_t move_metasprite(const metasprite_t *metasprite, uint8_t base_tile, uint8_t base_sprite, uint8_t x, uint8_t y)
    Definition: metasprites.h:130
    -
    hide_metasprite
    void hide_metasprite(const metasprite_t *metasprite, uint8_t base_sprite)
    Definition: metasprites.h:227
    +
    LCDC_REG
    __REG LCDC_REG
    Definition: hardware.h:162
    +
    metasprite_t::dx
    int8_t dx
    Definition: metasprites.h:88
    +
    move_metasprite
    uint8_t move_metasprite(const metasprite_t *metasprite, uint8_t base_tile, uint8_t base_sprite, uint8_t x, uint8_t y)
    Definition: metasprites.h:137
    +
    hide_metasprite
    void hide_metasprite(const metasprite_t *metasprite, uint8_t base_sprite)
    Definition: metasprites.h:240
    stdint.h
    +
    hide_sprites_range
    void hide_sprites_range(UINT8 from, UINT8 to) OLDCALL PRESERVES_REGS(b
    metasprite_t
    struct metasprite_t metasprite_t
    -
    b
    void b
    Definition: gb.h:585
    -
    OLDCALL
    #define OLDCALL
    Definition: types.h:21
    +
    b
    void b
    Definition: gb.h:608
    +
    OLDCALL
    #define OLDCALL
    Definition: types.h:19
    hardware.h
    -
    hide_sprites_range
    void hide_sprites_range(UINT8 from, UINT8 to) OLDCALL __preserves_regs(b
    -
    move_metasprite_vflip
    uint8_t move_metasprite_vflip(const metasprite_t *metasprite, uint8_t base_tile, uint8_t base_sprite, uint8_t x, uint8_t y)
    Definition: metasprites.h:157
    +
    move_metasprite_vflip
    uint8_t move_metasprite_vflip(const metasprite_t *metasprite, uint8_t base_tile, uint8_t base_sprite, uint8_t x, uint8_t y)
    Definition: metasprites.h:166
    __current_metasprite
    const void * __current_metasprite
    -
    metasprite_t::dtile
    uint8_t dtile
    Definition: metasprites.h:82
    -
    c
    void c
    Definition: metasprites.h:106
    +
    metasprite_t::dtile
    uint8_t dtile
    Definition: metasprites.h:89
    +
    PRESERVES_REGS
    #define PRESERVES_REGS(...)
    Definition: types.h:29
    +
    c
    void c
    Definition: metasprites.h:113
    __render_shadow_OAM
    uint8_t __render_shadow_OAM
    diff --git a/docs/api/gb_8h.html b/docs/api/gb_8h.html index 3d9ccd36..1ecccdd4 100644 --- a/docs/api/gb_8h.html +++ b/docs/api/gb_8h.html @@ -29,6 +29,7 @@
    GBDK 2020 Docs +  4.0.6
    API Documentation for GBDK 2020
    @@ -211,6 +212,8 @@ Macros   #define BANKREF_EXTERN(VARNAME)   extern const void __bank_ ## VARNAME;   +#define SWITCH_ROM_MEGADUCK(b)    _current_bank = (b), *(uint8_t *)0x0001 = (b) +  #define SWITCH_ROM_MBC1(b)    _current_bank = (b), *(uint8_t *)0x2000 = (b)   #define SWITCH_ROM   SWITCH_ROM_MBC1 @@ -269,11 +272,11 @@ Macros   #define set_bkg_2bpp_data   set_bkg_data   -#define set_tile_map   set_bkg_tiles +#define set_tile_map   set_bkg_tiles   #define set_tile_submap   set_bkg_submap   -#define set_tile_xy   set_bkg_tile_xy +#define set_tile_xy   set_bkg_tile_xy   #define set_sprite_2bpp_data   set_sprite_data   @@ -287,12 +290,12 @@ Macros   #define MAX_HARDWARE_SPRITES   40   -#define fill_rect   fill_bkg_rect +#define fill_rect   fill_bkg_rect   - + @@ -315,6 +318,8 @@ Functions + + @@ -327,100 +332,108 @@ Functions - - + + - - - - - - + + + + + + - - - - - - - - + + + + + + + + - - - - - - - - - - - - - - + + + + + + + + + + + + + + - - - - - - - - + + + + + + + + + + - - - - - - + + + + + + + + - - - - - - - - - - + + + + + + + + + + + + - - - - - - + + + + + + + + - - - - - - + + + + + + @@ -437,30 +450,30 @@ Functions - - - - - - - - - - - - + + + + + + + + + + + + - - - - - - - - - - + + + + + + + + + +

    Typedefs

    typedef void(* int_handler) (void) NONBANKED
    typedef void(* int_handler) (void) NONBANKED
     
    typedef struct OAM_item_t OAM_item_t
     
     
    void add_TIM (int_handler h) OLDCALL
     
    void add_low_priority_TIM (int_handler h) OLDCALL
     
    void add_SIO (int_handler h) OLDCALL
     
    void add_JOY (int_handler h) OLDCALL
     
    void mode (uint8_t m) OLDCALL
     
    uint8_t get_mode () OLDCALL __preserves_regs(b
     
    uint8_t get_mode () OLDCALL PRESERVES_REGS(b
     
    void send_byte ()
     
    void receive_byte ()
     
    void delay (uint16_t d) OLDCALL
     
    uint8_t joypad () OLDCALL __preserves_regs(b
     
    uint8_t waitpad (uint8_t mask) OLDCALL __preserves_regs(b
     
    void waitpadup () __preserves_regs(a
     
    uint8_t joypad () OLDCALL PRESERVES_REGS(b
     
    uint8_t waitpad (uint8_t mask) OLDCALL PRESERVES_REGS(b
     
    void waitpadup () PRESERVES_REGS(a
     
    uint8_t joypad_init (uint8_t npads, joypads_t *joypads) OLDCALL
     
    void joypad_ex (joypads_t *joypads) OLDCALL __preserves_regs(b
     
    void enable_interrupts () __preserves_regs(a
     
    void disable_interrupts () __preserves_regs(a
     
    void set_interrupts (uint8_t flags) OLDCALL __preserves_regs(b
     
    void joypad_ex (joypads_t *joypads) OLDCALL PRESERVES_REGS(b
     
    void enable_interrupts () PRESERVES_REGS(a
     
    void disable_interrupts () PRESERVES_REGS(a
     
    void set_interrupts (uint8_t flags) OLDCALL PRESERVES_REGS(b
     
    void reset ()
     
    void wait_vbl_done () __preserves_regs(b
     
    void display_off () __preserves_regs(b
     
    void refresh_OAM ()
     
    void hiramcpy (uint8_t dst, const void *src, uint8_t n) OLDCALL __preserves_regs(b
     
    void set_vram_byte (uint8_t *addr, uint8_t v) OLDCALL __preserves_regs(b
     
    uint8_t get_vram_byte (uint8_t *addr) OLDCALL __preserves_regs(b
     
    uint8_tget_bkg_xy_addr (uint8_t x, uint8_t y) OLDCALL __preserves_regs(b
     
    void wait_vbl_done () PRESERVES_REGS(b
     
    void display_off () PRESERVES_REGS(b
     
    void refresh_OAM () PRESERVES_REGS(b
     
    void hiramcpy (uint8_t dst, const void *src, uint8_t n) OLDCALL PRESERVES_REGS(b
     
    void set_vram_byte (uint8_t *addr, uint8_t v) OLDCALL PRESERVES_REGS(b
     
    uint8_t get_vram_byte (uint8_t *addr) OLDCALL PRESERVES_REGS(b
     
    uint8_tget_bkg_xy_addr (uint8_t x, uint8_t y) OLDCALL PRESERVES_REGS(b
     
    void set_2bpp_palette (uint16_t palette)
     
    void set_1bpp_colors_ex (uint8_t fgcolor, uint8_t bgcolor, uint8_t mode) OLDCALL
     
    void set_1bpp_colors (uint8_t fgcolor, uint8_t bgcolor)
     
    void set_bkg_data (uint8_t first_tile, uint8_t nb_tiles, const uint8_t *data) OLDCALL __preserves_regs(b
     
    void set_bkg_1bpp_data (uint8_t first_tile, uint8_t nb_tiles, const uint8_t *data) OLDCALL __preserves_regs(b
     
    void get_bkg_data (uint8_t first_tile, uint8_t nb_tiles, uint8_t *data) OLDCALL __preserves_regs(b
     
    void set_bkg_tiles (uint8_t x, uint8_t y, uint8_t w, uint8_t h, const uint8_t *tiles) OLDCALL __preserves_regs(b
     
    void set_bkg_data (uint8_t first_tile, uint8_t nb_tiles, const uint8_t *data) OLDCALL PRESERVES_REGS(b
     
    void set_bkg_1bpp_data (uint8_t first_tile, uint8_t nb_tiles, const uint8_t *data) OLDCALL PRESERVES_REGS(b
     
    void get_bkg_data (uint8_t first_tile, uint8_t nb_tiles, uint8_t *data) OLDCALL PRESERVES_REGS(b
     
    void set_bkg_tiles (uint8_t x, uint8_t y, uint8_t w, uint8_t h, const uint8_t *tiles) OLDCALL PRESERVES_REGS(b
     
    void set_bkg_based_tiles (uint8_t x, uint8_t y, uint8_t w, uint8_t h, const uint8_t *tiles, uint8_t base_tile)
     
    void set_bkg_submap (uint8_t x, uint8_t y, uint8_t w, uint8_t h, const uint8_t *map, uint8_t map_w) OLDCALL
     
    void get_bkg_tiles (uint8_t x, uint8_t y, uint8_t w, uint8_t h, uint8_t *tiles) OLDCALL __preserves_regs(b
     
    uint8_tset_bkg_tile_xy (uint8_t x, uint8_t y, uint8_t t) OLDCALL __preserves_regs(b
     
    uint8_t get_bkg_tile_xy (uint8_t x, uint8_t y) OLDCALL __preserves_regs(b
     
    void set_bkg_based_submap (uint8_t x, uint8_t y, uint8_t w, uint8_t h, const uint8_t *map, uint8_t map_w, uint8_t base_tile)
     
    void get_bkg_tiles (uint8_t x, uint8_t y, uint8_t w, uint8_t h, uint8_t *tiles) OLDCALL PRESERVES_REGS(b
     
    uint8_tset_bkg_tile_xy (uint8_t x, uint8_t y, uint8_t t) OLDCALL PRESERVES_REGS(b
     
    uint8_t get_bkg_tile_xy (uint8_t x, uint8_t y) OLDCALL PRESERVES_REGS(b
     
    void move_bkg (uint8_t x, uint8_t y)
     
    void scroll_bkg (int8_t x, int8_t y)
     
    uint8_tget_win_xy_addr (uint8_t x, uint8_t y) OLDCALL __preserves_regs(b
     
    void set_win_data (uint8_t first_tile, uint8_t nb_tiles, const uint8_t *data) OLDCALL __preserves_regs(b
     
    void set_win_1bpp_data (uint8_t first_tile, uint8_t nb_tiles, const uint8_t *data) OLDCALL __preserves_regs(b
     
    void get_win_data (uint8_t first_tile, uint8_t nb_tiles, uint8_t *data) OLDCALL __preserves_regs(b
     
    void set_win_tiles (uint8_t x, uint8_t y, uint8_t w, uint8_t h, const uint8_t *tiles) OLDCALL __preserves_regs(b
     
    uint8_tget_win_xy_addr (uint8_t x, uint8_t y) OLDCALL PRESERVES_REGS(b
     
    void set_win_data (uint8_t first_tile, uint8_t nb_tiles, const uint8_t *data) OLDCALL PRESERVES_REGS(b
     
    void set_win_1bpp_data (uint8_t first_tile, uint8_t nb_tiles, const uint8_t *data) OLDCALL PRESERVES_REGS(b
     
    void get_win_data (uint8_t first_tile, uint8_t nb_tiles, uint8_t *data) OLDCALL PRESERVES_REGS(b
     
    void set_win_tiles (uint8_t x, uint8_t y, uint8_t w, uint8_t h, const uint8_t *tiles) OLDCALL PRESERVES_REGS(b
     
    void set_win_based_tiles (uint8_t x, uint8_t y, uint8_t w, uint8_t h, const uint8_t *tiles, uint8_t base_tile)
     
    void set_win_submap (uint8_t x, uint8_t y, uint8_t w, uint8_t h, const uint8_t *map, uint8_t map_w) OLDCALL
     
    void get_win_tiles (uint8_t x, uint8_t y, uint8_t w, uint8_t h, uint8_t *tiles) OLDCALL __preserves_regs(b
     
    uint8_tset_win_tile_xy (uint8_t x, uint8_t y, uint8_t t) OLDCALL __preserves_regs(b
     
    uint8_t get_win_tile_xy (uint8_t x, uint8_t y) OLDCALL __preserves_regs(b
     
    void set_win_based_submap (uint8_t x, uint8_t y, uint8_t w, uint8_t h, const uint8_t *map, uint8_t map_w, uint8_t base_tile)
     
    void get_win_tiles (uint8_t x, uint8_t y, uint8_t w, uint8_t h, uint8_t *tiles) OLDCALL PRESERVES_REGS(b
     
    uint8_tset_win_tile_xy (uint8_t x, uint8_t y, uint8_t t) OLDCALL PRESERVES_REGS(b
     
    uint8_t get_win_tile_xy (uint8_t x, uint8_t y) OLDCALL PRESERVES_REGS(b
     
    void move_win (uint8_t x, uint8_t y)
     
    void scroll_win (int8_t x, int8_t y)
     
    void set_sprite_data (uint8_t first_tile, uint8_t nb_tiles, const uint8_t *data) OLDCALL __preserves_regs(b
     
    void set_sprite_1bpp_data (uint8_t first_tile, uint8_t nb_tiles, const uint8_t *data) OLDCALL __preserves_regs(b
     
    void get_sprite_data (uint8_t first_tile, uint8_t nb_tiles, uint8_t *data) OLDCALL __preserves_regs(b
     
    void set_sprite_data (uint8_t first_tile, uint8_t nb_tiles, const uint8_t *data) OLDCALL PRESERVES_REGS(b
     
    void set_sprite_1bpp_data (uint8_t first_tile, uint8_t nb_tiles, const uint8_t *data) OLDCALL PRESERVES_REGS(b
     
    void get_sprite_data (uint8_t first_tile, uint8_t nb_tiles, uint8_t *data) OLDCALL PRESERVES_REGS(b
     
    void SET_SHADOW_OAM_ADDRESS (void *address)
     
    void set_sprite_tile (uint8_t nb, uint8_t tile)
     
    void hide_sprite (uint8_t nb)
     
    void set_data (uint8_t *vram_addr, const uint8_t *data, uint16_t len) OLDCALL __preserves_regs(b
     
    void get_data (uint8_t *data, uint8_t *vram_addr, uint16_t len) OLDCALL __preserves_regs(b
     
    void vmemcpy (uint8_t *dest, uint8_t *sour, uint16_t len) OLDCALL __preserves_regs(b
     
    void set_tiles (uint8_t x, uint8_t y, uint8_t w, uint8_t h, uint8_t *vram_addr, const uint8_t *tiles) OLDCALL __preserves_regs(b
     
    void set_tile_data (uint8_t first_tile, uint8_t nb_tiles, const uint8_t *data, uint8_t base) OLDCALL __preserves_regs(b
     
    void get_tiles (uint8_t x, uint8_t y, uint8_t w, uint8_t h, uint8_t *vram_addr, uint8_t *tiles) OLDCALL __preserves_regs(b
     
    void set_data (uint8_t *vram_addr, const uint8_t *data, uint16_t len) OLDCALL PRESERVES_REGS(b
     
    void get_data (uint8_t *data, uint8_t *vram_addr, uint16_t len) OLDCALL PRESERVES_REGS(b
     
    void vmemcpy (uint8_t *dest, uint8_t *sour, uint16_t len) OLDCALL PRESERVES_REGS(b
     
    void set_tiles (uint8_t x, uint8_t y, uint8_t w, uint8_t h, uint8_t *vram_addr, const uint8_t *tiles) OLDCALL PRESERVES_REGS(b
     
    void set_tile_data (uint8_t first_tile, uint8_t nb_tiles, const uint8_t *data, uint8_t base) OLDCALL PRESERVES_REGS(b
     
    void get_tiles (uint8_t x, uint8_t y, uint8_t w, uint8_t h, uint8_t *vram_addr, uint8_t *tiles) OLDCALL PRESERVES_REGS(b
     
    void set_native_tile_data (uint16_t first_tile, uint8_t nb_tiles, const uint8_t *data)
     
    void init_win (uint8_t c) OLDCALL __preserves_regs(b
     
    void init_bkg (uint8_t c) OLDCALL __preserves_regs(b
     
    void vmemset (void *s, uint8_t c, size_t n) OLDCALL __preserves_regs(b
     
    void fill_bkg_rect (uint8_t x, uint8_t y, uint8_t w, uint8_t h, uint8_t tile) OLDCALL __preserves_regs(b
     
    void fill_win_rect (uint8_t x, uint8_t y, uint8_t w, uint8_t h, uint8_t tile) OLDCALL __preserves_regs(b
     
    void init_win (uint8_t c) OLDCALL PRESERVES_REGS(b
     
    void init_bkg (uint8_t c) OLDCALL PRESERVES_REGS(b
     
    void vmemset (void *s, uint8_t c, size_t n) OLDCALL PRESERVES_REGS(b
     
    void fill_bkg_rect (uint8_t x, uint8_t y, uint8_t w, uint8_t h, uint8_t tile) OLDCALL PRESERVES_REGS(b
     
    void fill_win_rect (uint8_t x, uint8_t y, uint8_t w, uint8_t h, uint8_t tile) OLDCALL PRESERVES_REGS(b
     
    @@ -492,6 +505,10 @@ Variables + + + + @@ -540,8 +557,8 @@ Variables

    Variables

     
    uint16_t _current_1bpp_colors
     
    uint8_t _map_tile_offset
     
    uint8_t _submap_tile_offset
     
    volatile struct OAM_item_t shadow_OAM []
     
    __REG _shadow_OAM_base

    Joypad bits. A logical OR of these is used in the wait_pad and joypad functions. For example, to see if the B button is pressed try

    -

    uint8_t keys; keys = joypad(); if (keys & J_B) { ... }

    -
    See also
    joypad
    +

    uint8_t keys; keys = joypad(); if (keys & J_B) { ... }

    +
    See also
    joypad
    @@ -804,7 +821,7 @@ Variables

    VBlank Interrupt occurs at the start of the vertical blank.

    -

    During this period the video ram may be freely accessed.

    See also
    set_interrupts(),
    +

    During this period the video ram may be freely accessed.

    See also
    set_interrupts(),
    add_VBL
    @@ -821,7 +838,7 @@ Variables
    -

    LCD Interrupt when triggered by the STAT register.

    See also
    set_interrupts(),
    +

    LCD Interrupt when triggered by the STAT register.

    See also
    set_interrupts(),
    add_LCD
    @@ -838,7 +855,7 @@ Variables
    -

    Timer Interrupt when the timer TIMA_REG overflows.

    See also
    set_interrupts(),
    +

    Timer Interrupt when the timer TIMA_REG overflows.

    See also
    set_interrupts(),
    add_TIM
    @@ -855,7 +872,7 @@ Variables
    -

    Serial Link Interrupt occurs when the serial transfer has completed.

    See also
    set_interrupts(),
    +

    Serial Link Interrupt occurs when the serial transfer has completed.

    See also
    set_interrupts(),
    add_SIO
    @@ -872,7 +889,7 @@ Variables
    -

    Joypad Interrupt occurs on a transition of the keypad.

    See also
    set_interrupts(),
    +

    Joypad Interrupt occurs on a transition of the keypad.

    See also
    set_interrupts(),
    add_JOY
    @@ -983,7 +1000,7 @@ Variables

    The resulting format is four greyscale colors packed into a single unsigned byte.

    Example:

    -
    See also
    REG_OBP0, REG_OBP1, REG_BGP
    +
    See also
    OBP0_REG, OBP1_REG, BGP_REG
    DMG_BLACK, DMG_DARK_GRAY, DMG_LITE_GRAY, DMG_WHITE
    @@ -1330,6 +1347,30 @@ Variables

    This makes a BANKREF() reference in another source file accessible in the current file for use with BANK().

    See also
    BANKREF(), BANK()
    + + + +

    ◆ SWITCH_ROM_MEGADUCK

    + +
    +
    + + + + + + + + +
    #define SWITCH_ROM_MEGADUCK( b)    _current_bank = (b), *(uint8_t *)0x0001 = (b)
    +
    +

    Makes MEGADUCK MBC switch the active ROM bank

    Parameters
    + + +
    bROM bank to switch to
    +
    +
    +
    @@ -1367,13 +1408,13 @@ Variables
    -

    Makes MBC1, MBC5 (4M ROMs) and other compatible MBCs switch the active ROM bank

    Parameters
    +

    Makes default platform MBC switch the active ROM bank

    Parameters
    bROM bank to switch to (max 255)
    -
    See also
    SWITCH_ROM_MBC1, SWITCH_ROM_MBC5
    +
    See also
    SWITCH_ROM_MBC1, SWITCH_ROM_MBC5, SWITCH_ROM_MEGADUCK
    @@ -1630,7 +1671,7 @@ Variables
    -

    Turns the display back on.

    See also
    display_off, DISPLAY_OFF
    +

    Turns the display back on.

    See also
    display_off, DISPLAY_OFF
    @@ -1645,7 +1686,7 @@ Variables
    -

    Turns the display off immediately.

    See also
    display_off, DISPLAY_ON
    +

    Turns the display off immediately.

    See also
    display_off, DISPLAY_ON
    @@ -1860,7 +1901,7 @@ Variables
    - +
    #define set_tile_map   set_bkg_tiles#define set_tile_map   set_bkg_tiles
    @@ -1888,7 +1929,7 @@ Variables
    - +
    #define set_tile_xy   set_bkg_tile_xy#define set_tile_xy   set_bkg_tile_xy
    @@ -1989,7 +2030,7 @@ Variables
    - +
    #define fill_rect   fill_bkg_rect#define fill_rect   fill_bkg_rect
    @@ -2004,7 +2045,7 @@ Variables
    - +
    typedef void(* int_handler) (void) NONBANKEDtypedef void(* int_handler) (void) NONBANKED
    @@ -2053,8 +2094,8 @@ Variables

    The remove functions will remove any interrupt handler.

    A handler of NULL will cause bad things to happen if the given interrupt is enabled.

    -

    Removes the VBL interrupt handler.

    See also
    add_VBL()
    -

    Removes the VBL interrupt handler.

    See also
    add_VBL()
    +

    Removes the VBL interrupt handler.

    See also
    add_VBL()
    +

    Removes the VBL interrupt handler.

    See also
    add_VBL()
    @@ -2160,8 +2201,8 @@ Variables -

    Up to 4 handlers may be added, with the last added being called last. If the remove_VBL function is to be called, only three may be added.

    -

    Do not use CRITICAL and INTERRUPT attributes for a function added via add_VBL() (or LCD, etc). The attributes are only required when constructing a bare jump from the interrupt vector itself.

    +

    Up to 4 handlers may be added, with the last added being called last. If the remove_VBL function is to be called, only three may be added.

    +

    Do not use CRITICAL and INTERRUPT attributes for a function added via add_VBL() (or LCD, etc). The attributes are only required when constructing a bare jump from the interrupt vector itself.

    Note: The default VBL is installed automatically.

    Adds a V-blank interrupt handler.

    @@ -2184,8 +2225,8 @@ Variables

    Adds a LCD interrupt handler.

    Called when the LCD interrupt occurs, which is normally when LY_REG == LYC_REG.

    -

    From pan/k0Pa: There are various reasons for this interrupt to occur as described by the STAT_REG register ($FF41). One very popular reason is to indicate to the user when the video hardware is about to redraw a given LCD line. This can be useful for dynamically controlling the SCX_REG / SCY_REG registers ($FF43/$FF42) to perform special video effects.

    -
    See also
    add_VBL
    +

    There are various reasons for this interrupt to occur as described by the STAT_REG register ($FF41). One very popular reason is to indicate to the user when the video hardware is about to redraw a given LCD line. This can be useful for dynamically controlling the SCX_REG / SCY_REG registers ($FF43/$FF42) to perform special video effects.

    +
    See also
    add_VBL

    Adds a LCD interrupt handler.

    @@ -2206,10 +2247,35 @@ Variables

    Adds a timer interrupt handler.

    -

    From pan/k0Pa: This interrupt occurs when the TIMA_REG register ($FF05) changes from $FF to $00.

    +

    Can not be used together with add_low_priority_TIM

    +

    This interrupt occurs when the TIMA_REG register ($FF05) changes from $FF to $00.

    See also
    add_VBL
    -set_interrupts() with TIM_IFLAG
    +set_interrupts() with TIM_IFLAG + +
    + + +

    ◆ add_low_priority_TIM()

    + +
    +
    + + + + + + + + +
    void add_low_priority_TIM (int_handler h)
    +
    +

    Adds a timer interrupt handler, that could be interrupted by the other interrupts, as well as itself, if it runs too slow.

    +

    Can not be used together with add_TIM

    +

    This interrupt occurs when the TIMA_REG register ($FF05) changes from $FF to $00.

    +
    See also
    add_VBL
    +
    +set_interrupts() with TIM_IFLAG
    @@ -2229,10 +2295,10 @@ Variables

    Adds a Serial Link transmit complete interrupt handler.

    -

    From pan/k0Pa: This interrupt occurs when a serial transfer has completed on the game link port.

    +

    This interrupt occurs when a serial transfer has completed on the game link port.

    See also
    send_byte, receive_byte(), add_VBL()
    -set_interrupts() with SIO_IFLAG
    +set_interrupts() with SIO_IFLAG
    @@ -2252,8 +2318,8 @@ Variables

    Adds a joypad button change interrupt handler.

    -

    From pan/k0Pa: This interrupt occurs on a transition of any of the keypad input lines from high to low. Due to the fact that keypad "bounce" is virtually always present, software should expect this interrupt to occur one or more times for every button press and one or more times for every button release.

    -
    See also
    joypad(), add_VBL()
    +

    This interrupt occurs on a transition of any of the keypad input lines from high to low. Due to the fact that keypad "bounce" is virtually always present, software should expect this interrupt to occur one or more times for every button press and one or more times for every button release.

    +
    See also
    joypad(), add_VBL()
    @@ -2273,7 +2339,7 @@ Variables

    Interrupt handler chain terminator that does not wait for .STAT

    You must add this handler last in every interrupt handler chain if you want to change the default interrupt handler behaviour that waits for LCD controller mode to become 1 or 0 before return from the interrupt.

    -

    Example:

    +

    Example:

    add_SIO(nowait_int_handler); // Disable wait on VRAM state before returning from SIO interrupt
    }
    See also
    wait_int_handler()
    @@ -2347,8 +2413,8 @@ Variables
    - -

    ◆ get_mode()

    + +

    ◆ get_mode()

    @@ -2383,7 +2449,7 @@ Variables

    Serial Link: Send the byte in _io_out out through the serial port

    Make sure to enable interrupts for the Serial Link before trying to transfer data.

    See also
    add_SIO(), remove_SIO()
    -set_interrupts() with SIO_IFLAG
    +set_interrupts() with SIO_IFLAG
    @@ -2404,7 +2470,7 @@ Variables

    Serial Link: Receive a byte from the serial port into _io_in

    Make sure to enable interrupts for the Serial Link before trying to transfer data.

    See also
    add_SIO(), remove_SIO()
    -set_interrupts() with SIO_IFLAG
    +set_interrupts() with SIO_IFLAG @@ -2427,8 +2493,8 @@ Variables - -

    ◆ joypad()

    + +

    ◆ joypad()

    @@ -2447,8 +2513,8 @@ Variables
    - -

    ◆ waitpad()

    + +

    ◆ waitpad()

    @@ -2470,14 +2536,14 @@ Variables

    Normally only used for checking one key, but it will support many, even J_LEFT at the same time as J_RIGHT. :)

    -

    Note: Checks in a loop that doesn't HALT at all, so the CPU will be maxed out until this call returns.

    See also
    joypad
    +

    Note: Checks in a loop that doesn't HALT at all, so the CPU will be maxed out until this call returns.

    See also
    joypad
    J_START, J_SELECT, J_A, J_B, J_UP, J_DOWN, J_LEFT, J_RIGHT
    - -

    ◆ waitpadup()

    + +

    ◆ waitpadup()

    @@ -2527,13 +2593,13 @@ Variables -

    Only required for joypad_ex, not required for calls to regular joypad()

    Returns
    number of joypads avaliable
    -
    See also
    joypad_ex(), joypads_t
    +

    Only required for joypad_ex, not required for calls to regular joypad()

    Returns
    number of joypads avaliable
    +
    See also
    joypad_ex(), joypads_t
    - -

    ◆ joypad_ex()

    + +

    ◆ joypad_ex()

    @@ -2557,8 +2623,8 @@ Variables
    - -

    ◆ enable_interrupts()

    + +

    ◆ enable_interrupts()

    @@ -2580,13 +2646,13 @@ Variables

    Enables unmasked interrupts

    -
    Note
    Use CRITICAL {...} instead for creating a block of of code which should execute with interrupts temporarily turned off.
    -
    See also
    disable_interrupts, set_interrupts, CRITICAL
    +
    Note
    Use CRITICAL {...} instead for creating a block of of code which should execute with interrupts temporarily turned off.
    +
    See also
    disable_interrupts, set_interrupts, CRITICAL
    - -

    ◆ disable_interrupts()

    + +

    ◆ disable_interrupts()

    @@ -2608,14 +2674,14 @@ Variables

    Disables interrupts

    -
    Note
    Use CRITICAL {...} instead for creating a block of of code which should execute with interrupts temporarily turned off.
    -

    This function may be called as many times as you like; however the first call to enable_interrupts will re-enable them.

    -
    See also
    enable_interrupts, set_interrupts, CRITICAL
    +
    Note
    Use CRITICAL {...} instead for creating a block of of code which should execute with interrupts temporarily turned off.
    +

    This function may be called as many times as you like; however the first call to enable_interrupts will re-enable them.

    +
    See also
    enable_interrupts, set_interrupts, CRITICAL
    - -

    ◆ set_interrupts()

    + +

    ◆ set_interrupts()

    @@ -2631,11 +2697,12 @@ Variables

    Clears any pending interrupts and sets the interrupt mask register IO to flags.

    Parameters
    - +
    flagsA logical OR of *_IFLAGS
    flagsA logical OR of *_IFLAGS
    -
    See also
    enable_interrupts(), disable_interrupts()
    +
    Note
    : This disables and then re-enables interrupts so it must be used outside of a critical section.
    +
    See also
    enable_interrupts(), disable_interrupts()
    VBL_IFLAG, LCD_IFLAG, TIM_IFLAG, SIO_IFLAG, JOY_IFLAG
    @@ -2659,8 +2726,8 @@ Variables
    - -

    ◆ wait_vbl_done()

    + +

    ◆ wait_vbl_done()

    @@ -2679,8 +2746,8 @@ Variables
    - -

    ◆ display_off()

    + +

    ◆ display_off()

    @@ -2698,8 +2765,8 @@ Variables
    - -

    ◆ refresh_OAM()

    + +

    ◆ refresh_OAM()

    @@ -2716,8 +2783,8 @@ Variables
    - -

    ◆ hiramcpy()

    + +

    ◆ hiramcpy()

    @@ -2758,8 +2825,8 @@ Variables
    - -

    ◆ set_vram_byte()

    + +

    ◆ set_vram_byte()

    @@ -2794,8 +2861,8 @@ Variables
    - -

    ◆ get_vram_byte()

    + +

    ◆ get_vram_byte()

    @@ -2820,8 +2887,8 @@ Variables
    - -

    ◆ get_bkg_xy_addr()

    + +

    ◆ get_bkg_xy_addr()

    @@ -2946,8 +3013,8 @@ Variables
    - -

    ◆ set_bkg_data()

    + +

    ◆ set_bkg_data()

    @@ -2992,12 +3059,12 @@ Variables
  • VBK_REG=0 indicates the first bank
  • VBK_REG=1 indicates the second
  • -
    See also
    set_win_data, set_tile_data
    +
    See also
    set_win_data, set_tile_data
    - -

    ◆ set_bkg_1bpp_data()

    + +

    ◆ set_bkg_1bpp_data()

    @@ -3041,12 +3108,12 @@ Variables
  • 0 will be expanded into color 0
  • 1 will be expanded into color 1, 2 or 3 depending on color argument
  • -
    See also
    SHOW_BKG, HIDE_BKG, set_bkg_tiles
    +
    See also
    SHOW_BKG, HIDE_BKG, set_bkg_tiles
    - -

    ◆ get_bkg_data()

    + +

    ◆ get_bkg_data()

    @@ -3087,12 +3154,12 @@ Variables

    Copies nb_tiles tiles from VRAM starting at first_tile, Tile data is copied into data.

    Each Tile is 16 bytes, so the buffer pointed to by data should be at least nb_tiles x 16 bytes in size.

    -
    See also
    get_win_data, get_data
    +
    See also
    get_win_data, get_data
    - -

    ◆ set_bkg_tiles()

    + +

    ◆ set_bkg_tiles()

    @@ -3178,7 +3245,81 @@ Variables
    See also
    SHOW_BKG
    -set_bkg_data, set_bkg_submap, set_win_tiles, set_tiles
    +set_bkg_data, set_bkg_submap, set_win_tiles, set_tiles + +
    +
    + +

    ◆ set_bkg_based_tiles()

    + +
    +
    + + + + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void set_bkg_based_tiles (uint8_t x,
    uint8_t y,
    uint8_t w,
    uint8_t h,
    const uint8_ttiles,
    uint8_t base_tile 
    )
    +
    +inline
    +
    +

    Sets a rectangular region of Background Tile Map. The offset value in base_tile is added to the tile ID for each map entry.

    +
    Parameters
    + + + + + + + +
    xX Start position in Background Map tile coordinates. Range 0 - 31
    yY Start position in Background Map tile coordinates. Range 0 - 31
    wWidth of area to set in tiles. Range 1 - 32
    hHeight of area to set in tiles. Range 1 - 32
    tilesPointer to source tile map data
    base_tileOffset each tile ID entry of the source map by this value. Range 1 - 255
    +
    +
    +

    This is identical to set_bkg_tiles() except that it adds the base_tile parameter for when a tile map's tiles don't start at index zero. (For example, the tiles used by the map range from 100 -> 120 in VRAM instead of 0 -> 20).

    +
    See also
    set_bkg_tiles for more details
    @@ -3252,18 +3393,99 @@ Variables

    Entries are copied from map to the Background Tile Map starting at x, y writing across for w tiles and down for h tiles, using map_w as the rowstride for the source tile map.

    -

    Use this instead of set_bkg_tiles when the source map is wider than 32 tiles or when writing a width that does not match the source map width.

    +

    Use this instead of set_bkg_tiles when the source map is wider than 32 tiles or when writing a width that does not match the source map width.

    One byte per source tile map entry.

    Writes that exceed coordinate 31 on the x or y axis will wrap around to the Left and Top edges.

    -

    See set_bkg_tiles for setting CGB attribute maps with VBK_REG.

    +

    See set_bkg_tiles for setting CGB attribute maps with VBK_REG.

    See also
    SHOW_BKG
    -set_bkg_data, set_bkg_tiles, set_win_submap, set_tiles
    +set_bkg_data, set_bkg_tiles, set_win_submap, set_tiles - -

    ◆ get_bkg_tiles()

    + +

    ◆ set_bkg_based_submap()

    + +
    +
    + + + + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void set_bkg_based_submap (uint8_t x,
    uint8_t y,
    uint8_t w,
    uint8_t h,
    const uint8_tmap,
    uint8_t map_w,
    uint8_t base_tile 
    )
    +
    +inline
    +
    +

    Sets a rectangular area of the Background Tile Map using a sub-region from a source tile map. The offset value in base_tile is added to the tile ID for each map entry.

    +
    Parameters
    + + + + + + + + +
    xX Start position in Background Map tile coordinates. Range 0 - 31
    yY Start position in Background Map tile coordinates. Range 0 - 31
    wWidth of area to set in tiles. Range 1 - 255
    hHeight of area to set in tiles. Range 1 - 255
    mapPointer to source tile map data
    map_wWidth of source tile map in tiles. Range 1 - 255
    base_tileOffset each tile ID entry of the source map by this value. Range 1 - 255
    +
    +
    +

    This is identical to set_bkg_based_submap() except that it adds the base_tile parameter for when a tile map's tiles don't start at index zero. (For example, the tiles used by the map range from 100 -> 120 in VRAM instead of 0 -> 20).

    +
    See also
    set_bkg_based_submap for more details
    + +
    +
    + +

    ◆ get_bkg_tiles()

    @@ -3319,12 +3541,12 @@ Variables

    Entries are copied into tiles from the Background Tile Map starting at x, y reading across for w tiles and down for h tiles.

    One byte per tile.

    The buffer pointed to by tiles should be at least x x y bytes in size.

    -
    See also
    get_win_tiles, get_bkg_tile_xy, get_tiles, get_vram_byte
    +
    See also
    get_win_tiles, get_bkg_tile_xy, get_tiles, get_vram_byte
    - -

    ◆ set_bkg_tile_xy()

    + +

    ◆ set_bkg_tile_xy()

    @@ -3362,12 +3584,12 @@ Variables -
    Returns
    returns the address of tile, so you may use faster set_vram_byte() later
    +
    Returns
    returns the address of tile, so you may use faster set_vram_byte() later
    - -

    ◆ get_bkg_tile_xy()

    + +

    ◆ get_bkg_tile_xy()

    @@ -3496,8 +3718,8 @@ Variables
    - -

    ◆ get_win_xy_addr()

    + +

    ◆ get_win_xy_addr()

    @@ -3525,8 +3747,8 @@ Variables
    - -

    ◆ set_win_data()

    + +

    ◆ set_win_data()

    @@ -3566,16 +3788,16 @@ Variables

    This is the same as set_bkg_data, since the Window Layer and Background Layer share the same Tile pattern data.

    -
    See also
    set_bkg_data
    +
    See also
    set_bkg_data
    -set_win_tiles, set_bkg_data, set_data
    +set_win_tiles, set_bkg_data, set_data
    SHOW_WIN, HIDE_WIN
    - -

    ◆ set_win_1bpp_data()

    + +

    ◆ set_win_1bpp_data()

    @@ -3615,12 +3837,12 @@ Variables

    This is the same as set_bkg_1bpp_data, since the Window Layer and Background Layer share the same Tile pattern data.

    -
    See also
    set_bkg_data, set_bkg_1bpp_data, set_win_data
    +
    See also
    set_bkg_data, set_bkg_1bpp_data, set_win_data
    - -

    ◆ get_win_data()

    + +

    ◆ get_win_data()

    @@ -3659,13 +3881,13 @@ Variables -

    This is the same as get_bkg_data, since the Window Layer and Background Layer share the same Tile pattern data.

    -
    See also
    get_bkg_data, get_data
    +

    This is the same as get_bkg_data, since the Window Layer and Background Layer share the same Tile pattern data.

    +
    See also
    get_bkg_data, get_data
    - -

    ◆ set_win_tiles()

    + +

    ◆ set_win_tiles()

    @@ -3730,8 +3952,82 @@ Variables
  • VBK_REG=0 Tile Numbers are written
  • VBK_REG=1 Tile Attributes are written
  • -

    For more details about GBC Tile Attributes see set_bkg_tiles.

    -
    See also
    SHOW_WIN, HIDE_WIN, set_win_submap, set_bkg_tiles, set_bkg_data, set_tiles
    +

    For more details about GBC Tile Attributes see set_bkg_tiles.

    +
    See also
    SHOW_WIN, HIDE_WIN, set_win_submap, set_bkg_tiles, set_bkg_data, set_tiles
    + +
    +
    + +

    ◆ set_win_based_tiles()

    + +
    +
    + + + + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void set_win_based_tiles (uint8_t x,
    uint8_t y,
    uint8_t w,
    uint8_t h,
    const uint8_ttiles,
    uint8_t base_tile 
    )
    +
    +inline
    +
    +

    Sets a rectangular region of the Window Tile Map. The offset value in base_tile is added to the tile ID for each map entry.

    +
    Parameters
    + + + + + + + +
    xX Start position in Window Map tile coordinates. Range 0 - 31
    yY Start position in Window Map tile coordinates. Range 0 - 31
    wWidth of area to set in tiles. Range 1 - 32
    hHeight of area to set in tiles. Range 1 - 32
    tilesPointer to source tile map data
    base_tileOffset each tile ID entry of the source map by this value. Range 1 - 255
    +
    +
    +

    This is identical to set_win_tiles() except that it adds the base_tile parameter for when a tile map's tiles don't start at index zero. (For example, the tiles used by the map range from 100 -> 120 in VRAM instead of 0 -> 20).

    +
    See also
    set_win_tiles for more details
    @@ -3805,20 +4101,101 @@ Variables

    Entries are copied from map to the Window Tile Map starting at x, y writing across for w tiles and down for h tiles, using map_w as the rowstride for the source tile map.

    -

    Use this instead of set_win_tiles when the source map is wider than 32 tiles or when writing a width that does not match the source map width.

    +

    Use this instead of set_win_tiles when the source map is wider than 32 tiles or when writing a width that does not match the source map width.

    One byte per source tile map entry.

    Writes that exceed coordinate 31 on the x or y axis will wrap around to the Left and Top edges.

    GBC only: VBK_REG determines whether Tile Numbers or Tile Attributes get set.

    -

    See set_bkg_tiles for details about CGB attribute maps with VBK_REG.

    -
    See also
    SHOW_WIN, HIDE_WIN, set_win_tiles, set_bkg_submap, set_bkg_tiles, set_bkg_data, set_tiles
    +

    See set_bkg_tiles for details about CGB attribute maps with VBK_REG.

    +
    See also
    SHOW_WIN, HIDE_WIN, set_win_tiles, set_bkg_submap, set_bkg_tiles, set_bkg_data, set_tiles
    - -

    ◆ get_win_tiles()

    + +

    ◆ set_win_based_submap()

    + +
    +
    + + + + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void set_win_based_submap (uint8_t x,
    uint8_t y,
    uint8_t w,
    uint8_t h,
    const uint8_tmap,
    uint8_t map_w,
    uint8_t base_tile 
    )
    +
    +inline
    +
    +

    Sets a rectangular area of the Window Tile Map using a sub-region from a source tile map. The offset value in base_tile is added to the tile ID for each map entry.

    +
    Parameters
    + + + + + + + + +
    xX Start position in Window Map tile coordinates. Range 0 - 31
    yY Start position in Wimdpw Map tile coordinates. Range 0 - 31
    wWidth of area to set in tiles. Range 1 - 255
    hHeight of area to set in tiles. Range 1 - 255
    mapPointer to source tile map data
    map_wWidth of source tile map in tiles. Range 1 - 255
    base_tileOffset each tile ID entry of the source map by this value. Range 1 - 255
    +
    +
    +

    This is identical to set_win_submap() except that it adds the base_tile parameter for when a tile map's tiles don't start at index zero. (For example, the tiles used by the map range from 100 -> 120 in VRAM instead of 0 -> 20).

    +
    See also
    set_win_submap for more details
    + +
    +
    + +

    ◆ get_win_tiles()

    @@ -3874,12 +4251,12 @@ Variables

    Entries are copied into tiles from the Window Tile Map starting at x, y reading across for w tiles and down for h tiles.

    One byte per tile.

    The buffer pointed to by tiles should be at least x x y bytes in size.

    -
    See also
    get_bkg_tiles, get_bkg_tile_xy, get_tiles, get_vram_byte
    +
    See also
    get_bkg_tiles, get_bkg_tile_xy, get_tiles, get_vram_byte
    - -

    ◆ set_win_tile_xy()

    + +

    ◆ set_win_tile_xy()

    @@ -3917,12 +4294,12 @@ Variables -
    Returns
    returns the address of tile, so you may use faster set_vram_byte() later
    +
    Returns
    returns the address of tile, so you may use faster set_vram_byte() later
    - -

    ◆ get_win_tile_xy()

    + +

    ◆ get_win_tile_xy()

    @@ -4051,8 +4428,8 @@ Variables
    - -

    ◆ set_sprite_data()

    + +

    ◆ set_sprite_data()

    @@ -4100,8 +4477,8 @@ Variables
    - -

    ◆ set_sprite_1bpp_data()

    + +

    ◆ set_sprite_1bpp_data()

    @@ -4149,8 +4526,8 @@ Variables
    - -

    ◆ get_sprite_data()

    + +

    ◆ get_sprite_data()

    @@ -4546,8 +4923,8 @@ Variables
    - -

    ◆ set_data()

    + +

    ◆ set_data()

    @@ -4577,7 +4954,7 @@ Variables
    -

    Copies arbitrary data to an address in VRAM without taking into account the state of LCDC bit 4.

    +

    Copies arbitrary data to an address in VRAM without taking into account the state of LCDC bits 3 or 4.

    Parameters
    @@ -4591,12 +4968,12 @@ Variables
  • VBK_REG=0 indicates the first bank
  • VBK_REG=1 indicates the second
  • -
    See also
    set_bkg_data, set_win_data, set_tile_data
    +
    See also
    set_bkg_data, set_win_data, set_bkg_tiles, set_win_tiles, set_tile_data, set_tiles
    - -

    ◆ get_data()

    + +

    ◆ get_data()

    @@ -4626,7 +5003,7 @@ Variables
    vram_addrPointer to destination VRAM Address
    -

    Copies arbitrary data from an address in VRAM into a buffer without taking into account the state of LCDC bit 4.

    +

    Copies arbitrary data from an address in VRAM into a buffer without taking into account the state of LCDC bits 3 or 4.

    Parameters
    @@ -4640,12 +5017,12 @@ Variables
  • VBK_REG=0 indicates the first bank
  • VBK_REG=1 indicates the second
  • -
    See also
    get_bkg_data, get_win_data
    +
    See also
    get_bkg_data, get_win_data, get_bkg_tiles, get_win_tiles, get_tiles
    - -

    ◆ vmemcpy()

    + +

    ◆ vmemcpy()

    @@ -4692,8 +5069,8 @@ Variables
    - -

    ◆ set_tiles()

    + +

    ◆ set_tiles()

    @@ -4741,7 +5118,7 @@ Variables
    vram_addrPointer to source VRAM Address
    -

    Sets a rectangular region of Tile Map entries at a given VRAM Address without taking into account the state of LCDC bit 4.

    +

    Sets a rectangular region of Tile Map entries at a given VRAM Address without taking into account the state of LCDC bit 3.

    Parameters
    @@ -4760,12 +5137,12 @@ Variables
  • VBK_REG=0 Tile Numbers are written
  • VBK_REG=1 Tile Attributes are written
  • -
    See also
    set_bkg_tiles, set_win_tiles
    +
    See also
    set_bkg_tiles, set_win_tiles
    - -

    ◆ set_tile_data()

    + +

    ◆ set_tile_data()

    @@ -4811,12 +5188,12 @@ Variables
    xX Start position in Map tile coordinates. Range 0 - 31
    -
    See also
    set_bkg_data, set_win_data, set_data
    +
    See also
    set_bkg_data, set_win_data, set_data
    - -

    ◆ get_tiles()

    + +

    ◆ get_tiles()

    @@ -4864,7 +5241,7 @@ Variables
    -

    Copies a rectangular region of Tile Map entries from a given VRAM Address into a buffer without taking into account the state of LCDC bit 4.

    +

    Copies a rectangular region of Tile Map entries from a given VRAM Address into a buffer without taking into account the state of LCDC bit 3.

    Parameters
    @@ -4880,7 +5257,7 @@ Variables

    One byte per tile.

    There are two 32x32 Tile Maps in VRAM at addresses 9800h - 9BFFh and 9C00h - 9FFFh.

    The buffer pointed to by tiles should be at least x x y bytes in size.

    -
    See also
    get_bkg_tiles, get_win_tiles
    +
    See also
    get_bkg_tiles, get_win_tiles
    @@ -4940,8 +5317,8 @@ Variables - -

    ◆ init_win()

    + +

    ◆ init_win()

    @@ -4965,8 +5342,8 @@ Variables
    - -

    ◆ init_bkg()

    + +

    ◆ init_bkg()

    @@ -4990,8 +5367,8 @@ Variables
    - -

    ◆ vmemset()

    + +

    ◆ vmemset()

    @@ -5011,7 +5388,7 @@ Variables
    - + @@ -5033,8 +5410,8 @@ Variables - -

    ◆ fill_bkg_rect()

    + +

    ◆ fill_bkg_rect()

    @@ -5090,8 +5467,8 @@ Variables
    - -

    ◆ fill_win_rect()

    + +

    ◆ fill_win_rect()

    @@ -5315,7 +5692,7 @@ Variables
    xX Start position in Background Map tile coordinates. Range 0 - 31
    size_t size_t  n 
    -

    Tracks current active ROM bank

    See also
    SWITCH_ROM_MBC1(), SWITCH_ROM_MBC5() This variable is updated automatically when you call SWITCH_ROM_MBC1 or SWITCH_ROM_MBC5, or call a BANKED function.
    +

    Tracks current active ROM bank

    See also
    SWITCH_ROM_MBC1(), SWITCH_ROM_MBC5() This variable is updated automatically when you call SWITCH_ROM_MBC1 or SWITCH_ROM_MBC5, or call a BANKED function.
    @@ -5411,6 +5788,50 @@ Variables
    +
    + + +

    ◆ _map_tile_offset

    + +
    +
    + + + + + +
    + + + + +
    uint8_t _map_tile_offset
    +
    +extern
    +
    + +
    +
    + +

    ◆ _submap_tile_offset

    + +
    +
    + + + + + +
    + + + + +
    uint8_t _submap_tile_offset
    +
    +extern
    +
    +
    @@ -5454,17 +5875,17 @@ Variables
    uint8_t
    unsigned char uint8_t
    Definition: stdint.h:51
    -
    _current_bank
    __REG _current_bank
    Definition: gb.h:414
    +
    _current_bank
    __REG _current_bank
    Definition: gb.h:427
    uint16_t
    unsigned short int uint16_t
    Definition: stdint.h:52
    -
    DMG_PALETTE
    #define DMG_PALETTE(C0, C1, C2, C3)
    Definition: gb.h:134
    +
    DMG_PALETTE
    #define DMG_PALETTE(C0, C1, C2, C3)
    Definition: gb.h:136
    nowait_int_handler
    void nowait_int_handler()
    -
    CRITICAL
    #define CRITICAL
    Definition: types.h:25
    -
    DMG_BLACK
    #define DMG_BLACK
    Definition: gb.h:111
    +
    DMG_BLACK
    #define DMG_BLACK
    Definition: gb.h:113
    add_SIO
    void add_SIO(int_handler h) OLDCALL
    -
    b
    void b
    Definition: gb.h:585
    -
    DMG_DARK_GRAY
    #define DMG_DARK_GRAY
    Definition: gb.h:112
    -
    DMG_WHITE
    #define DMG_WHITE
    Definition: gb.h:114
    -
    DMG_LITE_GRAY
    #define DMG_LITE_GRAY
    Definition: gb.h:113
    +
    b
    void b
    Definition: gb.h:608
    +
    DMG_DARK_GRAY
    #define DMG_DARK_GRAY
    Definition: gb.h:114
    +
    DMG_WHITE
    #define DMG_WHITE
    Definition: gb.h:116
    +
    DMG_LITE_GRAY
    #define DMG_LITE_GRAY
    Definition: gb.h:115
    +
    CRITICAL
    #define CRITICAL
    Definition: types.h:42
    -
    get_sprite_prop
    uint8_t get_sprite_prop(uint8_t nb)
    Definition: gb.h:1369
    +
    get_sprite_prop
    uint8_t get_sprite_prop(uint8_t nb)
    Definition: gb.h:1502
    +
    set_bkg_based_tiles
    void set_bkg_based_tiles(uint8_t x, uint8_t y, uint8_t w, uint8_t h, const uint8_t *tiles, uint8_t base_tile)
    Definition: gb.h:959
    _io_status
    volatile uint8_t _io_status
    +
    set_win_tiles
    void set_win_tiles(uint8_t x, uint8_t y, uint8_t w, uint8_t h, const uint8_t *tiles) OLDCALL PRESERVES_REGS(b
    uint8_t
    unsigned char uint8_t
    Definition: stdint.h:51
    -
    waitpadup
    void waitpadup() __preserves_regs(a
    -
    OAM_item_t::x
    uint8_t x
    Definition: gb.h:1259
    -
    move_bkg
    void move_bkg(uint8_t x, uint8_t y)
    Definition: gb.h:996
    +
    OAM_item_t::x
    uint8_t x
    Definition: gb.h:1392
    +
    move_bkg
    void move_bkg(uint8_t x, uint8_t y)
    Definition: gb.h:1079
    _io_in
    volatile uint8_t _io_in
    int8_t
    signed char int8_t
    Definition: stdint.h:43
    -
    fill_bkg_rect
    void fill_bkg_rect(uint8_t x, uint8_t y, uint8_t w, uint8_t h, uint8_t tile) OLDCALL __preserves_regs(b
    -
    hiramcpy
    void hiramcpy(uint8_t dst, const void *src, uint8_t n) OLDCALL __preserves_regs(b
    +
    get_win_tiles
    void get_win_tiles(uint8_t x, uint8_t y, uint8_t w, uint8_t h, uint8_t *tiles) OLDCALL PRESERVES_REGS(b
    shadow_OAM
    volatile struct OAM_item_t shadow_OAM[]
    -
    joypads_t::npads
    uint8_t npads
    Definition: gb.h:593
    +
    joypads_t::npads
    uint8_t npads
    Definition: gb.h:616
    OAM_item_t
    struct OAM_item_t OAM_item_t
    -
    get_win_tiles
    void get_win_tiles(uint8_t x, uint8_t y, uint8_t w, uint8_t h, uint8_t *tiles) OLDCALL __preserves_regs(b
    -
    _current_bank
    __REG _current_bank
    Definition: gb.h:414
    -
    get_data
    void get_data(uint8_t *data, uint8_t *vram_addr, uint16_t len) OLDCALL __preserves_regs(b
    -
    joypads_t
    Definition: gb.h:592
    -
    set_sprite_prop
    void set_sprite_prop(uint8_t nb, uint8_t prop)
    Definition: gb.h:1359
    +
    waitpad
    uint8_t waitpad(uint8_t mask) OLDCALL PRESERVES_REGS(b
    +
    _current_bank
    __REG _current_bank
    Definition: gb.h:427
    +
    joypad
    uint8_t joypad() OLDCALL PRESERVES_REGS(b
    +
    set_bkg_tiles
    void set_bkg_tiles(uint8_t x, uint8_t y, uint8_t w, uint8_t h, const uint8_t *tiles) OLDCALL PRESERVES_REGS(b
    +
    joypads_t
    Definition: gb.h:615
    +
    set_win_based_submap
    void set_win_based_submap(uint8_t x, uint8_t y, uint8_t w, uint8_t h, const uint8_t *map, uint8_t map_w, uint8_t base_tile)
    Definition: gb.h:1258
    +
    set_sprite_prop
    void set_sprite_prop(uint8_t nb, uint8_t prop)
    Definition: gb.h:1492
    __REG
    #define __REG
    Definition: hardware.h:14
    -
    SCX_REG
    __REG SCX_REG
    Definition: hardware.h:261
    -
    refresh_OAM
    void refresh_OAM()
    -
    set_sprite_1bpp_data
    void set_sprite_1bpp_data(uint8_t first_tile, uint8_t nb_tiles, const uint8_t *data) OLDCALL __preserves_regs(b
    -
    set_bkg_submap
    void set_bkg_submap(uint8_t x, uint8_t y, uint8_t w, uint8_t h, const uint8_t *map, uint8_t map_w) OLDCALL
    Definition: sms.h:573
    +
    SCX_REG
    __REG SCX_REG
    Definition: hardware.h:287
    +
    enable_interrupts
    void enable_interrupts() PRESERVES_REGS(a
    +
    set_bkg_submap
    void set_bkg_submap(uint8_t x, uint8_t y, uint8_t w, uint8_t h, const uint8_t *map, uint8_t map_w) OLDCALL
    Definition: sms.h:585
    +
    set_bkg_based_submap
    void set_bkg_based_submap(uint8_t x, uint8_t y, uint8_t w, uint8_t h, const uint8_t *map, uint8_t map_w, uint8_t base_tile)
    Definition: gb.h:1019
    +
    get_bkg_tile_xy
    uint8_t get_bkg_tile_xy(uint8_t x, uint8_t y) OLDCALL PRESERVES_REGS(b
    +
    set_tile_data
    void set_tile_data(uint8_t first_tile, uint8_t nb_tiles, const uint8_t *data, uint8_t base) OLDCALL PRESERVES_REGS(b
    _io_out
    volatile uint8_t _io_out
    joypad_init
    uint8_t joypad_init(uint8_t npads, joypads_t *joypads) OLDCALL
    -
    set_bkg_tile_xy
    uint8_t * set_bkg_tile_xy(uint8_t x, uint8_t y, uint8_t t) OLDCALL __preserves_regs(b
    -
    _shadow_OAM_base
    __REG _shadow_OAM_base
    Definition: gb.h:1271
    -
    waitpad
    uint8_t waitpad(uint8_t mask) OLDCALL __preserves_regs(b
    -
    get_bkg_tile_xy
    uint8_t get_bkg_tile_xy(uint8_t x, uint8_t y) OLDCALL __preserves_regs(b
    -
    set_win_tiles
    void set_win_tiles(uint8_t x, uint8_t y, uint8_t w, uint8_t h, const uint8_t *tiles) OLDCALL __preserves_regs(b
    +
    _shadow_OAM_base
    __REG _shadow_OAM_base
    Definition: gb.h:1404
    +
    refresh_OAM
    void refresh_OAM() PRESERVES_REGS(b
    +
    get_win_xy_addr
    uint8_t * get_win_xy_addr(uint8_t x, uint8_t y) OLDCALL PRESERVES_REGS(b
    +
    display_off
    void display_off() PRESERVES_REGS(b
    +
    set_bkg_data
    void set_bkg_data(uint8_t first_tile, uint8_t nb_tiles, const uint8_t *data) OLDCALL PRESERVES_REGS(b
    +
    set_sprite_data
    void set_sprite_data(uint8_t first_tile, uint8_t nb_tiles, const uint8_t *data) OLDCALL PRESERVES_REGS(b
    +
    get_bkg_data
    void get_bkg_data(uint8_t first_tile, uint8_t nb_tiles, uint8_t *data) OLDCALL PRESERVES_REGS(b
    mode
    void mode(uint8_t m) OLDCALL
    -
    disable_interrupts
    void disable_interrupts() __preserves_regs(a
    uint16_t
    unsigned short int uint16_t
    Definition: stdint.h:52
    -
    c
    uint8_t c
    Definition: gb.h:324
    -
    get_vram_byte
    uint8_t get_vram_byte(uint8_t *addr) OLDCALL __preserves_regs(b
    -
    set_bkg_tiles
    void set_bkg_tiles(uint8_t x, uint8_t y, uint8_t w, uint8_t h, const uint8_t *tiles) OLDCALL __preserves_regs(b
    -
    joypad
    uint8_t joypad() OLDCALL __preserves_regs(b
    +
    get_data
    void get_data(uint8_t *data, uint8_t *vram_addr, uint16_t len) OLDCALL PRESERVES_REGS(b
    +
    c
    uint8_t c
    Definition: gb.h:337
    version.h
    delay
    void delay(uint16_t d) OLDCALL
    add_LCD
    void add_LCD(int_handler h) OLDCALL
    IF_REG
    __REG IF_REG
    Definition: hardware.h:84
    -
    l
    uint8_t l
    Definition: gb.h:564
    +
    l
    uint8_t l
    Definition: gb.h:587
    nowait_int_handler
    void nowait_int_handler()
    -
    get_tiles
    void get_tiles(uint8_t x, uint8_t y, uint8_t w, uint8_t h, uint8_t *vram_addr, uint8_t *tiles) OLDCALL __preserves_regs(b
    add_JOY
    void add_JOY(int_handler h) OLDCALL
    -
    WX_REG
    __REG WX_REG
    Definition: hardware.h:277
    -
    fill_win_rect
    void fill_win_rect(uint8_t x, uint8_t y, uint8_t w, uint8_t h, uint8_t tile) OLDCALL __preserves_regs(b
    +
    WX_REG
    __REG WX_REG
    Definition: hardware.h:303
    remove_SIO
    void remove_SIO(int_handler h) OLDCALL
    -
    get_win_xy_addr
    uint8_t * get_win_xy_addr(uint8_t x, uint8_t y) OLDCALL __preserves_regs(b
    sys_time
    volatile uint16_t sys_time
    -
    enable_interrupts
    void enable_interrupts() __preserves_regs(a
    +
    vmemcpy
    void vmemcpy(uint8_t *dest, uint8_t *sour, uint16_t len) OLDCALL PRESERVES_REGS(b
    reset
    void reset()
    -
    cancel_pending_interrupts
    uint8_t cancel_pending_interrupts()
    Definition: gb.h:308
    -
    get_sprite_data
    void get_sprite_data(uint8_t first_tile, uint8_t nb_tiles, uint8_t *data) OLDCALL __preserves_regs(b
    -
    joypad_ex
    void joypad_ex(joypads_t *joypads) OLDCALL __preserves_regs(b
    -
    vmemset
    void vmemset(void *s, uint8_t c, size_t n) OLDCALL __preserves_regs(b
    -
    init_bkg
    void init_bkg(uint8_t c) OLDCALL __preserves_regs(b
    -
    e
    void e
    Definition: gb.h:585
    +
    init_win
    void init_win(uint8_t c) OLDCALL PRESERVES_REGS(b
    +
    wait_vbl_done
    void wait_vbl_done() PRESERVES_REGS(b
    +
    cancel_pending_interrupts
    uint8_t cancel_pending_interrupts()
    Definition: gb.h:321
    +
    fill_win_rect
    void fill_win_rect(uint8_t x, uint8_t y, uint8_t w, uint8_t h, uint8_t tile) OLDCALL PRESERVES_REGS(b
    +
    get_win_data
    void get_win_data(uint8_t first_tile, uint8_t nb_tiles, uint8_t *data) OLDCALL PRESERVES_REGS(b
    +
    _map_tile_offset
    uint8_t _map_tile_offset
    +
    get_tiles
    void get_tiles(uint8_t x, uint8_t y, uint8_t w, uint8_t h, uint8_t *vram_addr, uint8_t *tiles) OLDCALL PRESERVES_REGS(b
    +
    set_data
    void set_data(uint8_t *vram_addr, const uint8_t *data, uint16_t len) OLDCALL PRESERVES_REGS(b
    +
    set_win_tile_xy
    uint8_t * set_win_tile_xy(uint8_t x, uint8_t y, uint8_t t) OLDCALL PRESERVES_REGS(b
    +
    set_tiles
    void set_tiles(uint8_t x, uint8_t y, uint8_t w, uint8_t h, uint8_t *vram_addr, const uint8_t *tiles) OLDCALL PRESERVES_REGS(b
    +
    e
    void e
    Definition: gb.h:608
    wait_int_handler
    void wait_int_handler()
    -
    set_bkg_data
    void set_bkg_data(uint8_t first_tile, uint8_t nb_tiles, const uint8_t *data) OLDCALL __preserves_regs(b
    -
    get_win_tile_xy
    uint8_t get_win_tile_xy(uint8_t x, uint8_t y) OLDCALL __preserves_regs(b
    -
    set_win_tile_xy
    uint8_t * set_win_tile_xy(uint8_t x, uint8_t y, uint8_t t) OLDCALL __preserves_regs(b
    -
    set_native_tile_data
    void set_native_tile_data(uint16_t first_tile, uint8_t nb_tiles, const uint8_t *data)
    Definition: gb.h:1544
    +
    get_bkg_tiles
    void get_bkg_tiles(uint8_t x, uint8_t y, uint8_t w, uint8_t h, uint8_t *tiles) OLDCALL PRESERVES_REGS(b
    +
    set_native_tile_data
    void set_native_tile_data(uint16_t first_tile, uint8_t nb_tiles, const uint8_t *data)
    Definition: gb.h:1677
    add_SIO
    void add_SIO(int_handler h) OLDCALL
    -
    set_bkg_1bpp_data
    void set_bkg_1bpp_data(uint8_t first_tile, uint8_t nb_tiles, const uint8_t *data) OLDCALL __preserves_regs(b
    -
    SET_SHADOW_OAM_ADDRESS
    void SET_SHADOW_OAM_ADDRESS(void *address)
    Definition: gb.h:1293
    +
    SET_SHADOW_OAM_ADDRESS
    void SET_SHADOW_OAM_ADDRESS(void *address)
    Definition: gb.h:1426
    stdint.h
    +
    get_sprite_data
    void get_sprite_data(uint8_t first_tile, uint8_t nb_tiles, uint8_t *data) OLDCALL PRESERVES_REGS(b
    receive_byte
    void receive_byte()
    -
    get_bkg_data
    void get_bkg_data(uint8_t first_tile, uint8_t nb_tiles, uint8_t *data) OLDCALL __preserves_regs(b
    -
    int_handler
    void(* int_handler)(void) NONBANKED
    Definition: gb.h:159
    +
    set_win_based_tiles
    void set_win_based_tiles(uint8_t x, uint8_t y, uint8_t w, uint8_t h, const uint8_t *tiles, uint8_t base_tile)
    Definition: gb.h:1200
    +
    get_bkg_xy_addr
    uint8_t * get_bkg_xy_addr(uint8_t x, uint8_t y) OLDCALL PRESERVES_REGS(b
    +
    int_handler
    void(* int_handler)(void) NONBANKED
    Definition: gb.h:161
    _cpu
    uint8_t _cpu
    -
    display_off
    void display_off() __preserves_regs(b
    +
    disable_interrupts
    void disable_interrupts() PRESERVES_REGS(a
    _current_1bpp_colors
    uint16_t _current_1bpp_colors
    -
    move_sprite
    void move_sprite(uint8_t nb, uint8_t x, uint8_t y)
    Definition: gb.h:1386
    +
    move_sprite
    void move_sprite(uint8_t nb, uint8_t x, uint8_t y)
    Definition: gb.h:1519
    +
    set_bkg_1bpp_data
    void set_bkg_1bpp_data(uint8_t first_tile, uint8_t nb_tiles, const uint8_t *data) OLDCALL PRESERVES_REGS(b
    +
    get_vram_byte
    uint8_t get_vram_byte(uint8_t *addr) OLDCALL PRESERVES_REGS(b
    set_1bpp_colors_ex
    void set_1bpp_colors_ex(uint8_t fgcolor, uint8_t bgcolor, uint8_t mode) OLDCALL
    -
    b
    void b
    Definition: gb.h:585
    -
    scroll_sprite
    void scroll_sprite(uint8_t nb, int8_t x, int8_t y)
    Definition: gb.h:1402
    +
    b
    void b
    Definition: gb.h:608
    +
    scroll_sprite
    void scroll_sprite(uint8_t nb, int8_t x, int8_t y)
    Definition: gb.h:1535
    _is_GBA
    uint8_t _is_GBA
    -
    set_win_data
    void set_win_data(uint8_t first_tile, uint8_t nb_tiles, const uint8_t *data) OLDCALL __preserves_regs(b
    -
    OLDCALL
    #define OLDCALL
    Definition: types.h:21
    -
    h
    uint8_t h
    Definition: gb.h:564
    -
    d
    void d
    Definition: gb.h:585
    -
    set_data
    void set_data(uint8_t *vram_addr, const uint8_t *data, uint16_t len) OLDCALL __preserves_regs(b
    -
    scroll_win
    void scroll_win(int8_t x, int8_t y)
    Definition: gb.h:1196
    +
    OLDCALL
    #define OLDCALL
    Definition: types.h:19
    +
    set_interrupts
    void set_interrupts(uint8_t flags) OLDCALL PRESERVES_REGS(b
    +
    h
    uint8_t h
    Definition: gb.h:587
    +
    d
    void d
    Definition: gb.h:608
    +
    scroll_win
    void scroll_win(int8_t x, int8_t y)
    Definition: gb.h:1329
    hardware.h
    -
    get_bkg_tiles
    void get_bkg_tiles(uint8_t x, uint8_t y, uint8_t w, uint8_t h, uint8_t *tiles) OLDCALL __preserves_regs(b
    -
    NONBANKED
    #define NONBANKED
    Definition: types.h:12
    -
    set_sprite_tile
    void set_sprite_tile(uint8_t nb, uint8_t tile)
    Definition: gb.h:1313
    -
    OAM_item_t::tile
    uint8_t tile
    Definition: gb.h:1260
    -
    scroll_bkg
    void scroll_bkg(int8_t x, int8_t y)
    Definition: gb.h:1010
    -
    get_bkg_xy_addr
    uint8_t * get_bkg_xy_addr(uint8_t x, uint8_t y) OLDCALL __preserves_regs(b
    +
    fill_bkg_rect
    void fill_bkg_rect(uint8_t x, uint8_t y, uint8_t w, uint8_t h, uint8_t tile) OLDCALL PRESERVES_REGS(b
    +
    set_sprite_tile
    void set_sprite_tile(uint8_t nb, uint8_t tile)
    Definition: gb.h:1446
    +
    OAM_item_t::tile
    uint8_t tile
    Definition: gb.h:1393
    +
    scroll_bkg
    void scroll_bkg(int8_t x, int8_t y)
    Definition: gb.h:1093
    add_TIM
    void add_TIM(int_handler h) OLDCALL
    -
    set_tile_data
    void set_tile_data(uint8_t first_tile, uint8_t nb_tiles, const uint8_t *data, uint8_t base) OLDCALL __preserves_regs(b
    -
    wait_vbl_done
    void wait_vbl_done() __preserves_regs(b
    -
    get_sprite_tile
    uint8_t get_sprite_tile(uint8_t nb)
    Definition: gb.h:1324
    +
    hiramcpy
    void hiramcpy(uint8_t dst, const void *src, uint8_t n) OLDCALL PRESERVES_REGS(b
    +
    get_sprite_tile
    uint8_t get_sprite_tile(uint8_t nb)
    Definition: gb.h:1457
    add_VBL
    void add_VBL(int_handler h) OLDCALL
    -
    set_interrupts
    void set_interrupts(uint8_t flags) OLDCALL __preserves_regs(b
    -
    WY_REG
    __REG WY_REG
    Definition: hardware.h:275
    +
    get_mode
    uint8_t get_mode() OLDCALL PRESERVES_REGS(b
    +
    WY_REG
    __REG WY_REG
    Definition: hardware.h:301
    +
    get_win_tile_xy
    uint8_t get_win_tile_xy(uint8_t x, uint8_t y) OLDCALL PRESERVES_REGS(b
    remove_LCD
    void remove_LCD(int_handler h) OLDCALL
    -
    vmemcpy
    void vmemcpy(uint8_t *dest, uint8_t *sour, uint16_t len) OLDCALL __preserves_regs(b
    -
    set_vram_byte
    void set_vram_byte(uint8_t *addr, uint8_t v) OLDCALL __preserves_regs(b
    remove_TIM
    void remove_TIM(int_handler h) OLDCALL
    -
    set_tiles
    void set_tiles(uint8_t x, uint8_t y, uint8_t w, uint8_t h, uint8_t *vram_addr, const uint8_t *tiles) OLDCALL __preserves_regs(b
    -
    OAM_item_t
    Definition: gb.h:1258
    -
    set_2bpp_palette
    void set_2bpp_palette(uint16_t palette)
    Definition: gb.h:792
    -
    OAM_item_t::y
    uint8_t y
    Definition: gb.h:1259
    +
    NONBANKED
    #define NONBANKED
    Definition: types.h:36
    +
    set_win_1bpp_data
    void set_win_1bpp_data(uint8_t first_tile, uint8_t nb_tiles, const uint8_t *data) OLDCALL PRESERVES_REGS(b
    +
    _submap_tile_offset
    uint8_t _submap_tile_offset
    +
    OAM_item_t
    Definition: gb.h:1391
    +
    set_2bpp_palette
    void set_2bpp_palette(uint16_t palette)
    Definition: gb.h:819
    +
    OAM_item_t::y
    uint8_t y
    Definition: gb.h:1392
    send_byte
    void send_byte()
    remove_VBL
    void remove_VBL(int_handler h) OLDCALL
    -
    move_win
    void move_win(uint8_t x, uint8_t y)
    Definition: gb.h:1182
    -
    OAM_item_t::prop
    uint8_t prop
    Definition: gb.h:1261
    +
    add_low_priority_TIM
    void add_low_priority_TIM(int_handler h) OLDCALL
    +
    PRESERVES_REGS
    #define PRESERVES_REGS(...)
    Definition: types.h:29
    +
    joypad_ex
    void joypad_ex(joypads_t *joypads) OLDCALL PRESERVES_REGS(b
    +
    set_vram_byte
    void set_vram_byte(uint8_t *addr, uint8_t v) OLDCALL PRESERVES_REGS(b
    +
    move_win
    void move_win(uint8_t x, uint8_t y)
    Definition: gb.h:1315
    +
    OAM_item_t::prop
    uint8_t prop
    Definition: gb.h:1394
    +
    set_win_data
    void set_win_data(uint8_t first_tile, uint8_t nb_tiles, const uint8_t *data) OLDCALL PRESERVES_REGS(b
    +
    set_sprite_1bpp_data
    void set_sprite_1bpp_data(uint8_t first_tile, uint8_t nb_tiles, const uint8_t *data) OLDCALL PRESERVES_REGS(b
    remove_JOY
    void remove_JOY(int_handler h) OLDCALL
    -
    get_win_data
    void get_win_data(uint8_t first_tile, uint8_t nb_tiles, uint8_t *data) OLDCALL __preserves_regs(b
    -
    set_win_submap
    void set_win_submap(uint8_t x, uint8_t y, uint8_t w, uint8_t h, const uint8_t *map, uint8_t map_w) OLDCALL
    Definition: sms.h:576
    -
    SCY_REG
    __REG SCY_REG
    Definition: hardware.h:259
    -
    set_sprite_data
    void set_sprite_data(uint8_t first_tile, uint8_t nb_tiles, const uint8_t *data) OLDCALL __preserves_regs(b
    -
    hide_sprite
    void hide_sprite(uint8_t nb)
    Definition: gb.h:1412
    -
    get_mode
    uint8_t get_mode() OLDCALL __preserves_regs(b
    -
    init_win
    void init_win(uint8_t c) OLDCALL __preserves_regs(b
    -
    joypads_t::joy3
    uint8_t joy3
    Definition: gb.h:596
    -
    set_1bpp_colors
    void set_1bpp_colors(uint8_t fgcolor, uint8_t bgcolor)
    Definition: gb.h:798
    -
    set_win_1bpp_data
    void set_win_1bpp_data(uint8_t first_tile, uint8_t nb_tiles, const uint8_t *data) OLDCALL __preserves_regs(b
    +
    waitpadup
    void waitpadup() PRESERVES_REGS(a
    +
    set_win_submap
    void set_win_submap(uint8_t x, uint8_t y, uint8_t w, uint8_t h, const uint8_t *map, uint8_t map_w) OLDCALL
    Definition: sms.h:588
    +
    vmemset
    void vmemset(void *s, uint8_t c, size_t n) OLDCALL PRESERVES_REGS(b
    +
    init_bkg
    void init_bkg(uint8_t c) OLDCALL PRESERVES_REGS(b
    +
    SCY_REG
    __REG SCY_REG
    Definition: hardware.h:285
    +
    hide_sprite
    void hide_sprite(uint8_t nb)
    Definition: gb.h:1545
    +
    set_bkg_tile_xy
    uint8_t * set_bkg_tile_xy(uint8_t x, uint8_t y, uint8_t t) OLDCALL PRESERVES_REGS(b
    +
    joypads_t::joy3
    uint8_t joy3
    Definition: gb.h:619
    +
    set_1bpp_colors
    void set_1bpp_colors(uint8_t fgcolor, uint8_t bgcolor)
    Definition: gb.h:825
    diff --git a/docs/api/globals_func_w.html b/docs/api/globals_func_w.html index 9542b90a..3c9a8314 100644 --- a/docs/api/globals_func_w.html +++ b/docs/api/globals_func_w.html @@ -29,6 +29,7 @@
    GBDK 2020 Docs +  4.0.6
    API Documentation for GBDK 2020
    @@ -92,22 +93,22 @@ $(document).ready(function(){initNavTree('globals_func_w.html',''); initResizabl : gb.h
  • wait_vbl_done() -: gb.h -, sms.h +: gb.h +, sms.h
  • waitpad() -: gb.h -, sms.h +: gb.h +, sms.h
  • waitpadup() -: sms.h -, gb.h +: sms.h +, gb.h
  • WRITE_VDP_CMD() -: sms.h +: sms.h
  • WRITE_VDP_DATA() -: sms.h +: sms.h
  • wrtchr() : drawing.h diff --git a/docs/api/globals_g.html b/docs/api/globals_g.html index 07089f89..77b531c5 100644 --- a/docs/api/globals_g.html +++ b/docs/api/globals_g.html @@ -29,6 +29,7 @@
    GBDK 2020 Docs +  4.0.6
    API Documentation for GBDK 2020
    @@ -92,16 +93,16 @@ $(document).ready(function(){initNavTree('globals_g.html',''); initResizable(); : gb.h
  • gb_decompress() -: gbdecompress.h +: gbdecompress.h
  • gb_decompress_bkg_data() -: gbdecompress.h +: gbdecompress.h
  • gb_decompress_sprite_data() -: gbdecompress.h +: gbdecompress.h
  • gb_decompress_win_data() -: gbdecompress.h +: gbdecompress.h
  • GBA_DETECTED : gb.h @@ -110,27 +111,27 @@ $(document).ready(function(){initNavTree('globals_g.html',''); initResizable(); : gb.h
  • get_bkg_data() -: gb.h +: gb.h
  • get_bkg_tile_xy() -: gb.h +: gb.h
  • get_bkg_tiles() -: gb.h +: gb.h
  • get_bkg_xy_addr() -: gb.h -, sms.h +: gb.h +, sms.h
  • get_data() -: gb.h +: gb.h
  • get_mode() : sms.h -, gb.h +, gb.h
  • get_sprite_data() -: gb.h +: gb.h
  • get_sprite_prop() : gb.h @@ -141,23 +142,23 @@ $(document).ready(function(){initNavTree('globals_g.html',''); initResizable(); , sms.h
  • get_tiles() -: gb.h +: gb.h
  • get_vram_byte() -: gb.h +: gb.h
  • get_win_data() -: gb.h +: gb.h
  • get_win_tile_xy() -: gb.h +: gb.h
  • get_win_tiles() -: gb.h +: gb.h
  • get_win_xy_addr : sms.h -, gb.h +, gb.h
  • getchar() : stdio.h diff --git a/docs/api/globals_h.html b/docs/api/globals_h.html index bd69659f..9f9ae63c 100644 --- a/docs/api/globals_h.html +++ b/docs/api/globals_h.html @@ -29,6 +29,7 @@
    GBDK 2020 Docs +  4.0.6
    API Documentation for GBDK 2020
    @@ -136,14 +137,14 @@ $(document).ready(function(){initNavTree('globals_h.html',''); initResizable(); , gb.h
  • hide_sprites_range() -: metasprites.h +: metasprites.h
  • HIDE_WIN : sms.h , gb.h
  • hiramcpy() -: gb.h +: gb.h
  • diff --git a/docs/api/globals_i.html b/docs/api/globals_i.html index c7935b3e..c16b88ee 100644 --- a/docs/api/globals_i.html +++ b/docs/api/globals_i.html @@ -29,6 +29,7 @@
    GBDK 2020 Docs +  4.0.6
    API Documentation for GBDK 2020
    @@ -119,10 +120,10 @@ $(document).ready(function(){initNavTree('globals_i.html',''); initResizable(); : incbin.h
  • init_bkg() -: gb.h +: gb.h
  • init_win() -: gb.h +: gb.h
  • initarand() : rand.h @@ -203,8 +204,8 @@ $(document).ready(function(){initNavTree('globals_i.html',''); initResizable(); : stdint.h
  • int_handler -: gb.h -, sms.h +: sms.h +, gb.h
  • INT_LEAST16_MAX : stdint.h @@ -240,7 +241,7 @@ $(document).ready(function(){initNavTree('globals_i.html',''); initResizable(); : limits.h
  • INTERRUPT -: types.h +: types.h
  • INTMAX_C : stdint.h @@ -309,8 +310,8 @@ $(document).ready(function(){initNavTree('globals_i.html',''); initResizable(); : sms.h
  • iyl -: sms.h -, metasprites.h +: metasprites.h +, sms.h
  • diff --git a/docs/api/globals_j.html b/docs/api/globals_j.html index 47df016d..700ee03b 100644 --- a/docs/api/globals_j.html +++ b/docs/api/globals_j.html @@ -29,6 +29,7 @@
    GBDK 2020 Docs +  4.0.6
    API Documentation for GBDK 2020
    @@ -183,16 +184,16 @@ $(document).ready(function(){initNavTree('globals_j.html',''); initResizable(); : hardware.h
  • joypad() -: gb.h -, sms.h +: gb.h +, sms.h
  • joypad_ex() -: gb.h -, sms.h +: gb.h +, sms.h
  • joypad_init() : gb.h -, sms.h +, sms.h
  • diff --git a/docs/api/globals_k.html b/docs/api/globals_k.html index e77b1885..4fe4de54 100644 --- a/docs/api/globals_k.html +++ b/docs/api/globals_k.html @@ -29,6 +29,7 @@
    GBDK 2020 Docs +  4.0.6
    API Documentation for GBDK 2020
    diff --git a/docs/api/globals_l.html b/docs/api/globals_l.html index 3d6fa23b..ea5a11bc 100644 --- a/docs/api/globals_l.html +++ b/docs/api/globals_l.html @@ -29,6 +29,7 @@
    GBDK 2020 Docs +  4.0.6
    API Documentation for GBDK 2020
    diff --git a/docs/api/globals_m.html b/docs/api/globals_m.html index fa6cd10a..668e023c 100644 --- a/docs/api/globals_m.html +++ b/docs/api/globals_m.html @@ -29,6 +29,7 @@
    GBDK 2020 Docs +  4.0.6
    API Documentation for GBDK 2020
    @@ -131,8 +132,11 @@ $(document).ready(function(){initNavTree('globals_m.html',''); initResizable(); : gb.h , sms.h +
  • memcmp() +: string.h +
  • memcpy() -: string.h +: string.h
  • MEMCTL_BASEOFF : hardware.h @@ -174,7 +178,7 @@ $(document).ready(function(){initNavTree('globals_m.html',''); initResizable(); : string.h
  • memset() -: string.h +: string.h
  • METASPR_ITEM : metasprites.h @@ -183,10 +187,10 @@ $(document).ready(function(){initNavTree('globals_m.html',''); initResizable(); : metasprites.h
  • metasprite_end -: metasprites.h +: metasprites.h
  • metasprite_t -: metasprites.h +: metasprites.h
  • mfont_handle : font.h @@ -203,12 +207,12 @@ $(document).ready(function(){initNavTree('globals_m.html',''); initResizable(); , sms.h
  • mode() -: gb.h -, sms.h +: sms.h +, gb.h
  • move_bkg() -: gb.h -, sms.h +: sms.h +, gb.h
  • move_metasprite() : metasprites.h @@ -223,8 +227,8 @@ $(document).ready(function(){initNavTree('globals_m.html',''); initResizable(); : metasprites.h
  • move_sprite() -: sms.h -, gb.h +: gb.h +, sms.h
  • move_win() : gb.h diff --git a/docs/api/globals_n.html b/docs/api/globals_n.html index 4e0a558f..46cf0738 100644 --- a/docs/api/globals_n.html +++ b/docs/api/globals_n.html @@ -29,6 +29,7 @@
    GBDK 2020 Docs +  4.0.6
    API Documentation for GBDK 2020
    @@ -88,11 +89,14 @@ $(document).ready(function(){initNavTree('globals_n.html',''); initResizable();
    Here is a list of all functions, variables, defines, enums, and typedefs with links to the files they belong to:

    - n -

    diff --git a/docs/api/globals_vars.html b/docs/api/globals_vars.html index 0b4ffbec..66411d42 100644 --- a/docs/api/globals_vars.html +++ b/docs/api/globals_vars.html @@ -29,6 +29,7 @@
    GBDK 2020 Docs +  4.0.6
    API Documentation for GBDK 2020
    @@ -103,6 +104,9 @@ $(document).ready(function(){initNavTree('globals_vars.html',''); initResizable(
  • __current_metasprite : metasprites.h
  • +
  • __rand_seed +: rand.h +
  • __render_shadow_OAM : metasprites.h
  • @@ -143,6 +147,10 @@ $(document).ready(function(){initNavTree('globals_vars.html',''); initResizable(
  • _is_GBA : gb.h
  • +
  • _map_tile_offset +: gb.h +, sms.h +
  • _OAMRAM : hardware.h
  • @@ -168,6 +176,10 @@ $(document).ready(function(){initNavTree('globals_vars.html',''); initResizable(
  • _SRAM : hardware.h
  • +
  • _submap_tile_offset +: sms.h +, gb.h +
  • _SYSTEM : hardware.h
  • @@ -420,6 +432,9 @@ $(document).ready(function(){initNavTree('globals_vars.html',''); initResizable(
  • PCM34_REG : hardware.h
  • +
  • PCM_SAMPLE +: hardware.h +
  • diff --git a/docs/api/globals_w.html b/docs/api/globals_w.html index 5a4fcb3c..251388e9 100644 --- a/docs/api/globals_w.html +++ b/docs/api/globals_w.html @@ -29,6 +29,7 @@
    GBDK 2020 Docs +  4.0.6
    API Documentation for GBDK 2020
    @@ -92,16 +93,16 @@ $(document).ready(function(){initNavTree('globals_w.html',''); initResizable(); : gb.h
  • wait_vbl_done() -: gb.h -, sms.h +: gb.h +, sms.h
  • waitpad() -: gb.h -, sms.h +: gb.h +, sms.h
  • waitpadup() -: gb.h -, sms.h +: gb.h +, sms.h
  • WCHAR_MAX : stdint.h @@ -125,10 +126,10 @@ $(document).ready(function(){initNavTree('globals_w.html',''); initResizable(); : types.h
  • WRITE_VDP_CMD() -: sms.h +: sms.h
  • WRITE_VDP_DATA() -: sms.h +: sms.h
  • wrtchr() : drawing.h diff --git a/docs/api/globals_x.html b/docs/api/globals_x.html index 081eac7c..ea506cf1 100644 --- a/docs/api/globals_x.html +++ b/docs/api/globals_x.html @@ -29,6 +29,7 @@
    GBDK 2020 Docs +  4.0.6
    API Documentation for GBDK 2020
    diff --git a/docs/api/globals_z.html b/docs/api/globals_z.html new file mode 100644 index 00000000..d42031ff --- /dev/null +++ b/docs/api/globals_z.html @@ -0,0 +1,106 @@ + + + + + + + + + +GBDK 2020 Docs: Globals + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    GBDK 2020 Docs +  4.0.6 +
    +
    API Documentation for GBDK 2020
    +
    +
    + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    + +
    + +
    +
    Here is a list of all functions, variables, defines, enums, and typedefs with links to the files they belong to:
    + +

    - z -

    +
    +
    + + + + + diff --git a/docs/api/group__gbdk__fonts.html b/docs/api/group__gbdk__fonts.html index 7015a641..8393e320 100644 --- a/docs/api/group__gbdk__fonts.html +++ b/docs/api/group__gbdk__fonts.html @@ -29,6 +29,7 @@
    GBDK 2020 Docs +  4.0.6
    API Documentation for GBDK 2020
    diff --git a/docs/api/incbin_8h.html b/docs/api/incbin_8h.html index 3bcc13eb..93cb8aec 100644 --- a/docs/api/incbin_8h.html +++ b/docs/api/incbin_8h.html @@ -29,6 +29,7 @@
    GBDK 2020 Docs +  4.0.6
    API Documentation for GBDK 2020
    diff --git a/docs/api/incbin_8h_source.html b/docs/api/incbin_8h_source.html index 9122d737..0399223d 100644 --- a/docs/api/incbin_8h_source.html +++ b/docs/api/incbin_8h_source.html @@ -29,6 +29,7 @@
    GBDK 2020 Docs +  4.0.6
    API Documentation for GBDK 2020
    diff --git a/docs/api/index.html b/docs/api/index.html index da14bc4c..0c4b049f 100644 --- a/docs/api/index.html +++ b/docs/api/index.html @@ -29,6 +29,7 @@
    GBDK 2020 Docs +  4.0.6
    API Documentation for GBDK 2020
    @@ -103,27 +104,27 @@ $(document).ready(function(){initNavTree('index.html',''); initResizable(); });
  • GBDK Releases
  • Toolchain settings
  • -

    +

    Introduction

    Welcome to GBDK-2020! The best thing to do is head over to the Getting Started section to get up and running.

    -

    +

    About the Documentation

    This documentation is partially based on material written by the original GBDK authors in 1999 and updated for GBDK-2020. The API docs are automatically generated from the C header files using Doxygen.

    GBDK-2020 is an updated version of the original GBDK with a modernized SDCC toolchain and many API improvements and fixes. It can be found at: https://github.com/gbdk-2020/gbdk-2020/.

    The original GBDK sources, documentation and website are at: http://gbdk.sourceforge.net/

    -

    +

    About GBDK

    The GameBoy Developer's Kit (GBDK, GBDK-2020) is used to develop games and programs for the Nintendo Game Boy (and some other consoles) in C and assembly. GBDK includes a set of libraries for the most common requirements and generates image files for use with a real GameBoy or emulators.

    GBDK features:

    GBDK is freeware. Most of the tooling code is under the GPL. The runtime libraries should be under the LGPL. Please consider mentioning GBDK in the credits of projects made with it.


    -

    +

    Historical Info and Links

    Work on the original GBDK (pre-2020) was by:

    Pascal Felber, Lars Malmborg, Michael Hope, David Galloway (djmips), and others.

    diff --git a/docs/api/index.js b/docs/api/index.js index e82743f9..a3d421ad 100644 --- a/docs/api/index.js +++ b/docs/api/index.js @@ -1,249 +1,273 @@ var index = [ - [ "Introduction", "index.html#autotoc_md197", null ], - [ "About the Documentation", "index.html#autotoc_md198", null ], - [ "About GBDK", "index.html#autotoc_md199", null ], - [ "Historical Info and Links", "index.html#autotoc_md200", null ], + [ "Introduction", "index.html#autotoc_md217", null ], + [ "About the Documentation", "index.html#autotoc_md218", null ], + [ "About GBDK", "index.html#autotoc_md219", null ], + [ "Historical Info and Links", "index.html#autotoc_md220", null ], [ "Getting Started", "docs_getting_started.html", [ [ "1. Download a Release and unzip it", "docs_getting_started.html#autotoc_md6", null ], - [ "2. Compile Example projects", "docs_getting_started.html#autotoc_md7", null ], - [ "3. Use a Template", "docs_getting_started.html#autotoc_md8", null ], - [ "4. If you use GBTD / GBMB, get the fixed version", "docs_getting_started.html#autotoc_md9", null ], - [ "5. Review Coding Guidelines", "docs_getting_started.html#autotoc_md10", null ], - [ "6. Hardware and Resources", "docs_getting_started.html#autotoc_md11", null ], - [ "7. Set up C Source debugging", "docs_getting_started.html#autotoc_md12", null ], - [ "8. Try a GBDK Tutorial", "docs_getting_started.html#autotoc_md13", null ], - [ "9. Read up!", "docs_getting_started.html#autotoc_md14", null ], - [ "10. Need help?", "docs_getting_started.html#autotoc_md15", null ] + [ "2. Compile Example projects", "docs_getting_started.html#autotoc_md7", [ + [ "Windows (without Make installed):", "docs_getting_started.html#autotoc_md8", null ], + [ "Linux / MacOS / Windows with Make installed:", "docs_getting_started.html#autotoc_md9", null ] + ] ], + [ "3. Use a Template", "docs_getting_started.html#autotoc_md10", null ], + [ "4. If you use GBTD / GBMB, get the fixed version", "docs_getting_started.html#autotoc_md11", null ], + [ "5. Review Coding Guidelines", "docs_getting_started.html#autotoc_md12", null ], + [ "6. Hardware and Resources", "docs_getting_started.html#autotoc_md13", null ], + [ "7. Set up C Source debugging", "docs_getting_started.html#autotoc_md14", null ], + [ "8. Try a GBDK Tutorial", "docs_getting_started.html#autotoc_md15", null ], + [ "9. Read up!", "docs_getting_started.html#autotoc_md16", null ], + [ "10. Need help?", "docs_getting_started.html#autotoc_md17", null ], + [ "Migrating From Pre-GBDK-2020 Tutorials", "docs_getting_started.html#autotoc_md18", [ + [ "Also see:", "docs_getting_started.html#autotoc_md19", null ], + [ "Use auto-banking", "docs_getting_started.html#autotoc_md20", null ], + [ "Non-standard types (UINT8, etc)", "docs_getting_started.html#autotoc_md21", null ], + [ "If using GBTD / GBMB, get the fixed version", "docs_getting_started.html#autotoc_md22", null ], + [ "LCC and SDCC flags that are not needed", "docs_getting_started.html#autotoc_md23", null ], + [ "ROM Header Settings (such as Color, SGB, etc)", "docs_getting_started.html#autotoc_md24", null ], + [ "GBDK Header include changes", "docs_getting_started.html#autotoc_md25", null ], + [ "Include .h headers, not .c source files", "docs_getting_started.html#autotoc_md26", null ], + [ "Use the Template Projects", "docs_getting_started.html#autotoc_md27", null ], + [ "Use hUGEtracker instead of gbt_player", "docs_getting_started.html#autotoc_md28", null ] + ] ] ] ], [ "Links and Third-Party Tools", "docs_links_and_tools.html", [ - [ "SDCC Compiler Suite User Manual", "docs_links_and_tools.html#autotoc_md16", null ], - [ "Getting Help", "docs_links_and_tools.html#autotoc_md17", null ], - [ "Game Boy Documentation", "docs_links_and_tools.html#autotoc_md18", null ], - [ "Sega Master System / Game Gear Documentation", "docs_links_and_tools.html#autotoc_md19", null ], - [ "Tutorials", "docs_links_and_tools.html#autotoc_md20", null ], - [ "Example code", "docs_links_and_tools.html#autotoc_md21", null ], - [ "Graphics Tools", "docs_links_and_tools.html#autotoc_md22", null ], - [ "Music drivers and tools", "docs_links_and_tools.html#autotoc_md23", null ], - [ "Emulators", "docs_links_and_tools.html#autotoc_md24", null ], - [ "Debugging tools", "docs_links_and_tools.html#autotoc_md25", null ], - [ "Continuous Integration and Deployment", "docs_links_and_tools.html#autotoc_md26", null ] + [ "SDCC Compiler Suite User Manual", "docs_links_and_tools.html#autotoc_md29", null ], + [ "Getting Help", "docs_links_and_tools.html#autotoc_md30", null ], + [ "Game Boy Documentation", "docs_links_and_tools.html#autotoc_md31", null ], + [ "Sega Master System / Game Gear Documentation", "docs_links_and_tools.html#autotoc_md32", null ], + [ "Tutorials", "docs_links_and_tools.html#autotoc_md33", null ], + [ "Example code", "docs_links_and_tools.html#autotoc_md34", null ], + [ "Graphics Tools", "docs_links_and_tools.html#autotoc_md35", null ], + [ "Music drivers and tools", "docs_links_and_tools.html#autotoc_md36", null ], + [ "Emulators", "docs_links_and_tools.html#autotoc_md37", null ], + [ "Debugging tools", "docs_links_and_tools.html#autotoc_md38", null ], + [ "Continuous Integration and Deployment", "docs_links_and_tools.html#autotoc_md39", null ] ] ], [ "Using GBDK", "docs_using_gbdk.html", [ - [ "Interrupts", "docs_using_gbdk.html#autotoc_md27", [ - [ "Available Interrupts", "docs_using_gbdk.html#autotoc_md28", null ], - [ "Adding your own interrupt handler", "docs_using_gbdk.html#autotoc_md29", null ], - [ "Using your own Interrupt Dispatcher", "docs_using_gbdk.html#autotoc_md30", null ], - [ "Returning from Interrupts and STAT mode", "docs_using_gbdk.html#autotoc_md31", null ] + [ "Interrupts", "docs_using_gbdk.html#autotoc_md40", [ + [ "Available Interrupts", "docs_using_gbdk.html#autotoc_md41", null ], + [ "Adding your own interrupt handler", "docs_using_gbdk.html#autotoc_md42", null ], + [ "Using your own Interrupt Dispatcher", "docs_using_gbdk.html#autotoc_md43", null ], + [ "Returning from Interrupts and STAT mode", "docs_using_gbdk.html#autotoc_md44", null ] ] ], - [ "What GBDK does automatically and behind the scenes", "docs_using_gbdk.html#autotoc_md32", [ - [ "OAM (VRAM Sprite Attribute Table)", "docs_using_gbdk.html#autotoc_md33", null ], - [ "Font tiles when using stdio.h", "docs_using_gbdk.html#autotoc_md34", null ], - [ "Default Interrupt Service Handlers (ISRs)", "docs_using_gbdk.html#autotoc_md35", null ] + [ "What GBDK does automatically and behind the scenes", "docs_using_gbdk.html#autotoc_md45", [ + [ "OAM (VRAM Sprite Attribute Table)", "docs_using_gbdk.html#autotoc_md46", null ], + [ "Font tiles when using stdio.h", "docs_using_gbdk.html#autotoc_md47", null ], + [ "Default Interrupt Service Handlers (ISRs)", "docs_using_gbdk.html#autotoc_md48", null ] ] ], - [ "Copying Functions to RAM and HIRAM", "docs_using_gbdk.html#autotoc_md36", null ], - [ "Mixing C and Assembly", "docs_using_gbdk.html#autotoc_md37", [ - [ "Inline ASM within C source files", "docs_using_gbdk.html#autotoc_md38", null ], - [ "In Separate ASM files", "docs_using_gbdk.html#autotoc_md39", null ] + [ "Copying Functions to RAM and HIRAM", "docs_using_gbdk.html#autotoc_md49", null ], + [ "Mixing C and Assembly", "docs_using_gbdk.html#autotoc_md50", [ + [ "Inline ASM within C source files", "docs_using_gbdk.html#autotoc_md51", null ], + [ "In Separate ASM files", "docs_using_gbdk.html#autotoc_md52", null ] ] ], - [ "Including binary files in C source with incbin", "docs_using_gbdk.html#autotoc_md40", null ], - [ "Known Issues and Limitations", "docs_using_gbdk.html#autotoc_md41", [ - [ "SDCC", "docs_using_gbdk.html#autotoc_md42", null ] + [ "Including binary files in C source with incbin", "docs_using_gbdk.html#autotoc_md53", null ], + [ "Known Issues and Limitations", "docs_using_gbdk.html#autotoc_md54", [ + [ "SDCC", "docs_using_gbdk.html#autotoc_md55", null ] ] ] ] ], [ "Coding Guidelines", "docs_coding_guidelines.html", [ - [ "Learning C / C fundamentals", "docs_coding_guidelines.html#autotoc_md43", [ - [ "General C tutorials", "docs_coding_guidelines.html#autotoc_md44", null ], - [ "Embedded C introductions", "docs_coding_guidelines.html#autotoc_md45", null ], - [ "Game Boy games in C", "docs_coding_guidelines.html#autotoc_md46", null ] + [ "Learning C / C fundamentals", "docs_coding_guidelines.html#autotoc_md56", [ + [ "General C tutorials", "docs_coding_guidelines.html#autotoc_md57", null ], + [ "Embedded C introductions", "docs_coding_guidelines.html#autotoc_md58", null ], + [ "Game Boy games in C", "docs_coding_guidelines.html#autotoc_md59", null ] ] ], - [ "Understanding the hardware", "docs_coding_guidelines.html#autotoc_md47", null ], - [ "Writing optimal C code for the Game Boy and SDCC", "docs_coding_guidelines.html#autotoc_md48", [ - [ "Tools", "docs_coding_guidelines.html#autotoc_md49", [ - [ "GBTD / GBMB, Arrays and the \"const\" keyword", "docs_coding_guidelines.html#autotoc_md50", null ] + [ "Understanding the hardware", "docs_coding_guidelines.html#autotoc_md60", null ], + [ "Writing optimal C code for the Game Boy and SDCC", "docs_coding_guidelines.html#autotoc_md61", [ + [ "Tools", "docs_coding_guidelines.html#autotoc_md62", [ + [ "GBTD / GBMB, Arrays and the \"const\" keyword", "docs_coding_guidelines.html#autotoc_md63", null ] ] ], - [ "Variables", "docs_coding_guidelines.html#autotoc_md51", null ], - [ "Code structure", "docs_coding_guidelines.html#autotoc_md52", null ], - [ "GBDK API/Library", "docs_coding_guidelines.html#autotoc_md53", null ], - [ "Toolchain", "docs_coding_guidelines.html#autotoc_md54", null ], - [ "chars and vararg functions", "docs_coding_guidelines.html#autotoc_md55", null ] + [ "Variables", "docs_coding_guidelines.html#autotoc_md64", null ], + [ "Code structure", "docs_coding_guidelines.html#autotoc_md65", null ], + [ "GBDK API/Library", "docs_coding_guidelines.html#autotoc_md66", null ], + [ "Toolchain", "docs_coding_guidelines.html#autotoc_md67", null ], + [ "chars and vararg functions", "docs_coding_guidelines.html#autotoc_md68", null ] ] ], - [ "When C isn't fast enough", "docs_coding_guidelines.html#autotoc_md56", [ - [ "Calling convention", "docs_coding_guidelines.html#autotoc_md57", null ], - [ "Variables and registers", "docs_coding_guidelines.html#autotoc_md58", null ], - [ "Segments", "docs_coding_guidelines.html#autotoc_md59", null ] + [ "When C isn't fast enough", "docs_coding_guidelines.html#autotoc_md69", [ + [ "Calling convention", "docs_coding_guidelines.html#autotoc_md70", null ], + [ "Variables and registers", "docs_coding_guidelines.html#autotoc_md71", null ], + [ "Segments", "docs_coding_guidelines.html#autotoc_md72", null ] ] ] ] ], [ "ROM/RAM Banking and MBCs", "docs_rombanking_mbcs.html", [ - [ "ROM/RAM Banking and MBCs (Memory Bank Controllers)", "docs_rombanking_mbcs.html#autotoc_md60", [ - [ "Non-banked cartridges", "docs_rombanking_mbcs.html#autotoc_md61", null ], - [ "MBC Banked cartridges (Memory Bank Controllers)", "docs_rombanking_mbcs.html#autotoc_md62", null ] + [ "ROM/RAM Banking and MBCs (Memory Bank Controllers)", "docs_rombanking_mbcs.html#autotoc_md73", [ + [ "Non-banked cartridges", "docs_rombanking_mbcs.html#autotoc_md74", null ], + [ "MBC Banked cartridges (Memory Bank Controllers)", "docs_rombanking_mbcs.html#autotoc_md75", null ] ] ], - [ "Working with Banks", "docs_rombanking_mbcs.html#autotoc_md63", [ - [ "Setting the ROM bank for a Source file", "docs_rombanking_mbcs.html#autotoc_md64", null ], - [ "Setting the RAM bank for a Source file", "docs_rombanking_mbcs.html#autotoc_md65", null ], - [ "Setting the MBC and number of ROM & RAM banks available", "docs_rombanking_mbcs.html#autotoc_md66", null ], - [ "Getting Bank Numbers", "docs_rombanking_mbcs.html#autotoc_md67", null ], - [ "Banking and Functions", "docs_rombanking_mbcs.html#autotoc_md68", [ - [ "BANKED/NONBANKED keywords", "docs_rombanking_mbcs.html#autotoc_md69", null ], - [ "Banked Function Calls", "docs_rombanking_mbcs.html#autotoc_md70", null ] + [ "Working with Banks", "docs_rombanking_mbcs.html#autotoc_md76", [ + [ "Setting the ROM bank for a Source file", "docs_rombanking_mbcs.html#autotoc_md77", null ], + [ "Setting the RAM bank for a Source file", "docs_rombanking_mbcs.html#autotoc_md78", null ], + [ "Setting the MBC and number of ROM & RAM banks available", "docs_rombanking_mbcs.html#autotoc_md79", null ], + [ "Getting Bank Numbers", "docs_rombanking_mbcs.html#autotoc_md80", null ], + [ "Banking and Functions", "docs_rombanking_mbcs.html#autotoc_md81", [ + [ "BANKED/NONBANKED keywords", "docs_rombanking_mbcs.html#autotoc_md82", null ], + [ "Banked Function Calls", "docs_rombanking_mbcs.html#autotoc_md83", null ] ] ], - [ "Const Data (Variables in ROM)", "docs_rombanking_mbcs.html#autotoc_md71", null ], - [ "Variables in RAM", "docs_rombanking_mbcs.html#autotoc_md72", null ], - [ "Far Pointers", "docs_rombanking_mbcs.html#autotoc_md73", null ], - [ "Bank switching", "docs_rombanking_mbcs.html#autotoc_md74", null ], - [ "Restoring the current bank (after calling functions which change it without restoring)", "docs_rombanking_mbcs.html#autotoc_md75", null ], - [ "Currently active bank: _current_bank", "docs_rombanking_mbcs.html#autotoc_md76", null ] + [ "Const Data (Variables in ROM)", "docs_rombanking_mbcs.html#autotoc_md84", null ], + [ "Variables in RAM", "docs_rombanking_mbcs.html#autotoc_md85", null ], + [ "Far Pointers", "docs_rombanking_mbcs.html#autotoc_md86", null ], + [ "Bank switching", "docs_rombanking_mbcs.html#autotoc_md87", null ], + [ "Restoring the current bank (after calling functions which change it without restoring)", "docs_rombanking_mbcs.html#autotoc_md88", null ], + [ "Currently active bank: _current_bank", "docs_rombanking_mbcs.html#autotoc_md89", null ] ] ], - [ "Auto-Banking", "docs_rombanking_mbcs.html#autotoc_md77", null ], - [ "Errors related to banking (overflow, multiple writes to same location)", "docs_rombanking_mbcs.html#autotoc_md78", null ], - [ "Bank space usage", "docs_rombanking_mbcs.html#autotoc_md79", [ - [ "Other important notes", "docs_rombanking_mbcs.html#autotoc_md80", null ] + [ "Auto-Banking", "docs_rombanking_mbcs.html#autotoc_md90", null ], + [ "Errors related to banking (overflow, multiple writes to same location)", "docs_rombanking_mbcs.html#autotoc_md91", null ], + [ "Bank space usage", "docs_rombanking_mbcs.html#autotoc_md92", [ + [ "Other important notes", "docs_rombanking_mbcs.html#autotoc_md93", null ] ] ], - [ "Banking example projects", "docs_rombanking_mbcs.html#autotoc_md81", null ] + [ "Banking example projects", "docs_rombanking_mbcs.html#autotoc_md94", null ] ] ], [ "Supported Consoles & Cross Compiling", "docs_supported_consoles.html", [ - [ "Consoles Supported by GBDK", "docs_supported_consoles.html#autotoc_md102", null ], - [ "Cross Compiling for Different Consoles", "docs_supported_consoles.html#autotoc_md103", [ - [ "lcc", "docs_supported_consoles.html#autotoc_md104", null ], - [ "sdcc", "docs_supported_consoles.html#autotoc_md105", null ], - [ "Console Port and Platform Settings", "docs_supported_consoles.html#autotoc_md106", null ] + [ "Consoles Supported by GBDK", "docs_supported_consoles.html#autotoc_md116", null ], + [ "Cross Compiling for Different Consoles", "docs_supported_consoles.html#autotoc_md117", [ + [ "lcc", "docs_supported_consoles.html#autotoc_md118", null ], + [ "sdcc", "docs_supported_consoles.html#autotoc_md119", null ], + [ "Console Port and Platform Settings", "docs_supported_consoles.html#autotoc_md120", null ] ] ], - [ "Cross-Platform Constants", "docs_supported_consoles.html#autotoc_md107", [ - [ "Console Identifiers", "docs_supported_consoles.html#autotoc_md108", null ], - [ "Console Hardware Properties", "docs_supported_consoles.html#autotoc_md109", null ] + [ "Cross-Platform Constants", "docs_supported_consoles.html#autotoc_md121", [ + [ "Console Identifiers", "docs_supported_consoles.html#autotoc_md122", null ], + [ "Console Hardware Properties", "docs_supported_consoles.html#autotoc_md123", null ] ] ], - [ "Using headers", "docs_supported_consoles.html#autotoc_md110", null ], - [ "Cross Platform Example Projects", "docs_supported_consoles.html#autotoc_md111", null ], - [ "Porting From Game Boy to Analogue Pocket", "docs_supported_consoles.html#autotoc_md112", [ - [ "Registers and Flags", "docs_supported_consoles.html#autotoc_md113", null ], - [ "Boot logo", "docs_supported_consoles.html#autotoc_md114", null ] + [ "Using headers", "docs_supported_consoles.html#autotoc_md124", null ], + [ "Cross Platform Example Projects", "docs_supported_consoles.html#autotoc_md125", [ + [ "Cross Platform Asset Example", "docs_supported_consoles.html#autotoc_md126", null ] ] ], - [ "Porting From Game Boy to SMS/GG", "docs_supported_consoles.html#autotoc_md115", [ - [ "Tile Data and Tile Map loading", "docs_supported_consoles.html#autotoc_md116", [ - [ "Tile and Map Data in 2bpp Game Boy Format", "docs_supported_consoles.html#autotoc_md117", null ], - [ "Tile and Map Data in Native Format", "docs_supported_consoles.html#autotoc_md118", null ], - [ "Emulated Game Boy Color map attributes on the SMS/Game Gear", "docs_supported_consoles.html#autotoc_md119", null ] + [ "Porting From Game Boy to Analogue Pocket", "docs_supported_consoles.html#autotoc_md127", [ + [ "Registers and Flags", "docs_supported_consoles.html#autotoc_md128", null ], + [ "Boot logo", "docs_supported_consoles.html#autotoc_md129", null ] + ] ], + [ "Porting From Game Boy to Mega Duck / Cougar Boy", "docs_supported_consoles.html#autotoc_md130", [ + [ "Registers and Flags", "docs_supported_consoles.html#autotoc_md131", null ] + ] ], + [ "Porting From Game Boy to SMS/GG", "docs_supported_consoles.html#autotoc_md132", [ + [ "Tile Data and Tile Map loading", "docs_supported_consoles.html#autotoc_md133", [ + [ "Tile and Map Data in 2bpp Game Boy Format", "docs_supported_consoles.html#autotoc_md134", null ], + [ "Tile and Map Data in Native Format", "docs_supported_consoles.html#autotoc_md135", null ], + [ "Emulated Game Boy Color map attributes on the SMS/Game Gear", "docs_supported_consoles.html#autotoc_md136", null ] ] ] ] ], - [ "Hardware Comparison", "docs_supported_consoles.html#autotoc_md120", [ - [ "Safe VRAM / Display Controller Access", "docs_supported_consoles.html#autotoc_md121", null ] + [ "Hardware Comparison", "docs_supported_consoles.html#autotoc_md137", [ + [ "Safe VRAM / Display Controller Access", "docs_supported_consoles.html#autotoc_md138", null ] ] ] ] ], [ "GBDK Toolchain", "docs_toolchain.html", [ - [ "Overview", "docs_toolchain.html#autotoc_md82", null ], - [ "Data Types", "docs_toolchain.html#autotoc_md83", null ], - [ "Changing Important Addresses", "docs_toolchain.html#autotoc_md84", null ], - [ "Compiling programs", "docs_toolchain.html#autotoc_md85", [ + [ "Overview", "docs_toolchain.html#autotoc_md95", null ], + [ "Data Types", "docs_toolchain.html#autotoc_md96", null ], + [ "Changing Important Addresses", "docs_toolchain.html#autotoc_md97", null ], + [ "Compiling programs", "docs_toolchain.html#autotoc_md98", [ [ "Makefiles", "docs_toolchain.html#Makefiles", null ] ] ], - [ "Build Tools", "docs_toolchain.html#autotoc_md86", [ - [ "lcc", "docs_toolchain.html#autotoc_md87", null ], - [ "sdcc", "docs_toolchain.html#autotoc_md88", null ], - [ "sdasgb", "docs_toolchain.html#autotoc_md89", null ], - [ "bankpack", "docs_toolchain.html#autotoc_md90", null ], - [ "sdldgb", "docs_toolchain.html#autotoc_md91", null ], - [ "ihxcheck", "docs_toolchain.html#autotoc_md92", null ], - [ "makebin", "docs_toolchain.html#autotoc_md93", null ] + [ "Build Tools", "docs_toolchain.html#autotoc_md99", [ + [ "lcc", "docs_toolchain.html#autotoc_md100", null ], + [ "sdcc", "docs_toolchain.html#autotoc_md101", null ], + [ "sdasgb", "docs_toolchain.html#autotoc_md102", null ], + [ "bankpack", "docs_toolchain.html#autotoc_md103", null ], + [ "sdldgb", "docs_toolchain.html#autotoc_md104", null ], + [ "ihxcheck", "docs_toolchain.html#autotoc_md105", null ], + [ "makebin", "docs_toolchain.html#autotoc_md106", null ] ] ], - [ "GBDK Utilities", "docs_toolchain.html#autotoc_md94", [ - [ "GBCompress", "docs_toolchain.html#autotoc_md95", null ], - [ "png2asset", "docs_toolchain.html#autotoc_md96", [ - [ "Working with png2asset", "docs_toolchain.html#autotoc_md97", [ - [ "Terminology", "docs_toolchain.html#autotoc_md98", null ], - [ "Conversion Process", "docs_toolchain.html#autotoc_md99", null ], - [ "Maps", "docs_toolchain.html#autotoc_md100", null ], - [ "Meta sprites", "docs_toolchain.html#autotoc_md101", null ] + [ "GBDK Utilities", "docs_toolchain.html#autotoc_md107", [ + [ "GBCompress", "docs_toolchain.html#autotoc_md108", null ], + [ "png2asset", "docs_toolchain.html#autotoc_md109", [ + [ "Working with png2asset", "docs_toolchain.html#autotoc_md110", [ + [ "Terminology", "docs_toolchain.html#autotoc_md111", null ], + [ "Conversion Process", "docs_toolchain.html#autotoc_md112", null ], + [ "Maps", "docs_toolchain.html#autotoc_md113", null ], + [ "Meta sprites", "docs_toolchain.html#autotoc_md114", null ], + [ "Super Game Boy Borders (SGB)", "docs_toolchain.html#autotoc_md115", null ] ] ] ] ] ] ] ] ], [ "Example Programs", "docs_example_programs.html", [ - [ "banks (various projects)", "docs_example_programs.html#autotoc_md122", null ], - [ "comm", "docs_example_programs.html#autotoc_md123", null ], - [ "crash", "docs_example_programs.html#autotoc_md124", null ], - [ "colorbar", "docs_example_programs.html#autotoc_md125", null ], - [ "dscan", "docs_example_programs.html#autotoc_md126", null ], - [ "filltest", "docs_example_programs.html#autotoc_md127", null ], - [ "fonts", "docs_example_programs.html#autotoc_md128", null ], - [ "galaxy", "docs_example_programs.html#autotoc_md129", null ], - [ "gb-dtmf", "docs_example_programs.html#autotoc_md130", null ], - [ "gbdecompress", "docs_example_programs.html#autotoc_md131", null ], - [ "irq", "docs_example_programs.html#autotoc_md132", null ], - [ "large map", "docs_example_programs.html#autotoc_md133", null ], - [ "metasprites", "docs_example_programs.html#autotoc_md134", null ], - [ "lcd isr wobble", "docs_example_programs.html#autotoc_md135", null ], - [ "paint", "docs_example_programs.html#autotoc_md136", null ], - [ "rand", "docs_example_programs.html#autotoc_md137", null ], - [ "ram_fn", "docs_example_programs.html#autotoc_md138", null ], - [ "rpn", "docs_example_programs.html#autotoc_md139", null ], - [ "samptest", "docs_example_programs.html#autotoc_md140", null ], - [ "sgb (various)", "docs_example_programs.html#autotoc_md141", null ], - [ "sound", "docs_example_programs.html#autotoc_md142", null ], - [ "space", "docs_example_programs.html#autotoc_md143", null ], - [ "templates", "docs_example_programs.html#autotoc_md144", null ] + [ "banks (various projects)", "docs_example_programs.html#autotoc_md139", null ], + [ "comm", "docs_example_programs.html#autotoc_md140", null ], + [ "crash", "docs_example_programs.html#autotoc_md141", null ], + [ "colorbar", "docs_example_programs.html#autotoc_md142", null ], + [ "dscan", "docs_example_programs.html#autotoc_md143", null ], + [ "filltest", "docs_example_programs.html#autotoc_md144", null ], + [ "fonts", "docs_example_programs.html#autotoc_md145", null ], + [ "galaxy", "docs_example_programs.html#autotoc_md146", null ], + [ "gb-dtmf", "docs_example_programs.html#autotoc_md147", null ], + [ "gbdecompress", "docs_example_programs.html#autotoc_md148", null ], + [ "irq", "docs_example_programs.html#autotoc_md149", null ], + [ "large map", "docs_example_programs.html#autotoc_md150", null ], + [ "metasprites", "docs_example_programs.html#autotoc_md151", null ], + [ "lcd isr wobble", "docs_example_programs.html#autotoc_md152", null ], + [ "paint", "docs_example_programs.html#autotoc_md153", null ], + [ "rand", "docs_example_programs.html#autotoc_md154", null ], + [ "ram_fn", "docs_example_programs.html#autotoc_md155", null ], + [ "rpn", "docs_example_programs.html#autotoc_md156", null ], + [ "samptest", "docs_example_programs.html#autotoc_md157", null ], + [ "sgb (various)", "docs_example_programs.html#autotoc_md158", null ], + [ "sound", "docs_example_programs.html#autotoc_md159", null ], + [ "space", "docs_example_programs.html#autotoc_md160", null ], + [ "templates", "docs_example_programs.html#autotoc_md161", null ] ] ], [ "Frequently Asked Questions (FAQ)", "docs_faq.html", [ - [ "General", "docs_faq.html#autotoc_md145", null ], - [ "ROM Header Settings", "docs_faq.html#autotoc_md146", null ], - [ "Errors / Compiling / Toolchain", "docs_faq.html#autotoc_md147", null ], - [ "API / Utilities", "docs_faq.html#autotoc_md148", null ] + [ "General", "docs_faq.html#autotoc_md162", null ], + [ "Graphics and Resources", "docs_faq.html#autotoc_md163", null ], + [ "ROM Header Settings", "docs_faq.html#autotoc_md164", null ], + [ "Errors / Compiling / Toolchain", "docs_faq.html#autotoc_md165", null ], + [ "API / Utilities", "docs_faq.html#autotoc_md166", null ] ] ], [ "Migrating to new GBDK Versions", "docs_migrating_versions.html", [ - [ "GBDK 2020 versions", "docs_migrating_versions.html#autotoc_md149", [ - [ "Porting to GBDK 2020 4.0.5", "docs_migrating_versions.html#autotoc_md150", null ], - [ "Porting to GBDK 2020 4.0.4", "docs_migrating_versions.html#autotoc_md151", null ], - [ "Porting to GBDK 2020 4.0.3", "docs_migrating_versions.html#autotoc_md152", null ], - [ "Porting to GBDK 2020 4.0.2", "docs_migrating_versions.html#autotoc_md153", null ], - [ "Porting to GBDK 2020 4.0.1", "docs_migrating_versions.html#autotoc_md154", null ], - [ "Porting to GBDK 2020 4.0", "docs_migrating_versions.html#autotoc_md155", null ], - [ "Porting to GBDK 2020 3.2", "docs_migrating_versions.html#autotoc_md156", null ], - [ "Porting to GBDK 2020 3.1.1", "docs_migrating_versions.html#autotoc_md157", null ], - [ "Porting to GBDK 2020 3.1", "docs_migrating_versions.html#autotoc_md158", null ], - [ "Porting to GBDK 2020 3.0.1", "docs_migrating_versions.html#autotoc_md159", null ] + [ "GBDK 2020 versions", "docs_migrating_versions.html#autotoc_md167", [ + [ "Porting to GBDK 2020 4.0.6", "docs_migrating_versions.html#autotoc_md168", null ], + [ "Porting to GBDK 2020 4.0.5", "docs_migrating_versions.html#autotoc_md169", null ], + [ "Porting to GBDK 2020 4.0.4", "docs_migrating_versions.html#autotoc_md170", null ], + [ "Porting to GBDK 2020 4.0.3", "docs_migrating_versions.html#autotoc_md171", null ], + [ "Porting to GBDK 2020 4.0.2", "docs_migrating_versions.html#autotoc_md172", null ], + [ "Porting to GBDK 2020 4.0.1", "docs_migrating_versions.html#autotoc_md173", null ], + [ "Porting to GBDK 2020 4.0", "docs_migrating_versions.html#autotoc_md174", null ], + [ "Porting to GBDK 2020 3.2", "docs_migrating_versions.html#autotoc_md175", null ], + [ "Porting to GBDK 2020 3.1.1", "docs_migrating_versions.html#autotoc_md176", null ], + [ "Porting to GBDK 2020 3.1", "docs_migrating_versions.html#autotoc_md177", null ], + [ "Porting to GBDK 2020 3.0.1", "docs_migrating_versions.html#autotoc_md178", null ] ] ], - [ "Historical GBDK versions", "docs_migrating_versions.html#autotoc_md161", [ - [ "GBDK 1.1 to GBDK 2.0", "docs_migrating_versions.html#autotoc_md162", null ] + [ "Historical GBDK versions", "docs_migrating_versions.html#autotoc_md180", [ + [ "GBDK 1.1 to GBDK 2.0", "docs_migrating_versions.html#autotoc_md181", null ] ] ] ] ], [ "GBDK Releases", "docs_releases.html", [ - [ "GBDK 2020 Release Notes", "docs_releases.html#autotoc_md163", [ - [ "GBDK 2020 4.0.5", "docs_releases.html#autotoc_md164", null ], - [ "GBDK 2020 4.0.4", "docs_releases.html#autotoc_md165", null ], - [ "GBDK 2020 4.0.3", "docs_releases.html#autotoc_md166", null ], - [ "GBDK 2020 4.0.2", "docs_releases.html#autotoc_md167", null ], - [ "GBDK 2020 4.0.1", "docs_releases.html#autotoc_md168", null ], - [ "GBDK 2020 4.0", "docs_releases.html#autotoc_md169", null ], - [ "GBDK 2020 3.2", "docs_releases.html#autotoc_md170", null ], - [ "GBDK 2020 3.1.1", "docs_releases.html#autotoc_md171", null ], - [ "GBDK 2020 3.1", "docs_releases.html#autotoc_md172", null ], - [ "GBDK 2020 3.0.1", "docs_releases.html#autotoc_md173", null ], - [ "GBDK 2020 3.0", "docs_releases.html#autotoc_md174", null ] + [ "GBDK 2020 Release Notes", "docs_releases.html#autotoc_md182", [ + [ "GBDK 2020 4.0.6", "docs_releases.html#autotoc_md183", null ], + [ "GBDK 2020 4.0.5", "docs_releases.html#autotoc_md184", null ], + [ "GBDK 2020 4.0.4", "docs_releases.html#autotoc_md185", null ], + [ "GBDK 2020 4.0.3", "docs_releases.html#autotoc_md186", null ], + [ "GBDK 2020 4.0.2", "docs_releases.html#autotoc_md187", null ], + [ "GBDK 2020 4.0.1", "docs_releases.html#autotoc_md188", null ], + [ "GBDK 2020 4.0", "docs_releases.html#autotoc_md189", null ], + [ "GBDK 2020 3.2", "docs_releases.html#autotoc_md190", null ], + [ "GBDK 2020 3.1.1", "docs_releases.html#autotoc_md191", null ], + [ "GBDK 2020 3.1", "docs_releases.html#autotoc_md192", null ], + [ "GBDK 2020 3.0.1", "docs_releases.html#autotoc_md193", null ], + [ "GBDK 2020 3.0", "docs_releases.html#autotoc_md194", null ] ] ], - [ "Historical GBDK Release Notes", "docs_releases.html#autotoc_md175", [ - [ "GBDK 2.96", "docs_releases.html#autotoc_md176", null ], - [ "GBDK 2.95-3", "docs_releases.html#autotoc_md177", null ], - [ "GBDK 2.95-2", "docs_releases.html#autotoc_md178", null ], - [ "GBDK 2.95", "docs_releases.html#autotoc_md179", null ], - [ "GBDK 2.94", "docs_releases.html#autotoc_md180", null ], - [ "GBDK 2.93", "docs_releases.html#autotoc_md181", null ], - [ "GBDK 2.92-2 for win32", "docs_releases.html#autotoc_md182", null ], - [ "GBDK 2.92", "docs_releases.html#autotoc_md183", null ], - [ "GBDK 2.91", "docs_releases.html#autotoc_md184", null ], - [ "GBDK 2.1.5", "docs_releases.html#autotoc_md185", null ] + [ "Historical GBDK Release Notes", "docs_releases.html#autotoc_md195", [ + [ "GBDK 2.96", "docs_releases.html#autotoc_md196", null ], + [ "GBDK 2.95-3", "docs_releases.html#autotoc_md197", null ], + [ "GBDK 2.95-2", "docs_releases.html#autotoc_md198", null ], + [ "GBDK 2.95", "docs_releases.html#autotoc_md199", null ], + [ "GBDK 2.94", "docs_releases.html#autotoc_md200", null ], + [ "GBDK 2.93", "docs_releases.html#autotoc_md201", null ], + [ "GBDK 2.92-2 for win32", "docs_releases.html#autotoc_md202", null ], + [ "GBDK 2.92", "docs_releases.html#autotoc_md203", null ], + [ "GBDK 2.91", "docs_releases.html#autotoc_md204", null ], + [ "GBDK 2.1.5", "docs_releases.html#autotoc_md205", null ] ] ] ] ], [ "Toolchain settings", "docs_toolchain_settings.html", [ - [ "lcc settings", "docs_toolchain_settings.html#autotoc_md186", null ], - [ "sdcc settings", "docs_toolchain_settings.html#autotoc_md187", null ], - [ "sdasgb settings", "docs_toolchain_settings.html#autotoc_md188", null ], - [ "sdasz80 settings", "docs_toolchain_settings.html#autotoc_md189", null ], - [ "bankpack settings", "docs_toolchain_settings.html#autotoc_md190", null ], - [ "sdldgb settings", "docs_toolchain_settings.html#autotoc_md191", null ], - [ "sdldz80 settings", "docs_toolchain_settings.html#autotoc_md192", null ], - [ "ihxcheck settings", "docs_toolchain_settings.html#autotoc_md193", null ], - [ "makebin settings", "docs_toolchain_settings.html#autotoc_md194", null ], - [ "gbcompress settings", "docs_toolchain_settings.html#autotoc_md195", null ], - [ "png2asset settings", "docs_toolchain_settings.html#autotoc_md196", null ] + [ "lcc settings", "docs_toolchain_settings.html#autotoc_md206", null ], + [ "sdcc settings", "docs_toolchain_settings.html#autotoc_md207", null ], + [ "sdasgb settings", "docs_toolchain_settings.html#autotoc_md208", null ], + [ "sdasz80 settings", "docs_toolchain_settings.html#autotoc_md209", null ], + [ "bankpack settings", "docs_toolchain_settings.html#autotoc_md210", null ], + [ "sdldgb settings", "docs_toolchain_settings.html#autotoc_md211", null ], + [ "sdldz80 settings", "docs_toolchain_settings.html#autotoc_md212", null ], + [ "ihxcheck settings", "docs_toolchain_settings.html#autotoc_md213", null ], + [ "makebin settings", "docs_toolchain_settings.html#autotoc_md214", null ], + [ "gbcompress settings", "docs_toolchain_settings.html#autotoc_md215", null ], + [ "png2asset settings", "docs_toolchain_settings.html#autotoc_md216", null ] ] ] ]; \ No newline at end of file diff --git a/docs/api/isr_8h.html b/docs/api/isr_8h.html index ea571f47..be62854a 100644 --- a/docs/api/isr_8h.html +++ b/docs/api/isr_8h.html @@ -29,6 +29,7 @@
    GBDK 2020 Docs +  4.0.6
    API Documentation for GBDK 2020
    @@ -94,6 +95,7 @@ $(document).ready(function(){initNavTree('isr_8h.html',''); initResizable(); });
    #include <stdint.h>
    +#include <types.h>

    Go to the source code of this file.

    @@ -114,9 +116,9 @@ Macros - + - +
     
    #define VECTOR_JOYPAD   0x60
     
    #define ISR_VECTOR(ADDR, FUNC)   static const isr_vector_t __at((ADDR)) __ISR_ ## ADDR = {0xc3, (void *)&(FUNC)};
    #define ISR_VECTOR(ADDR, FUNC)   static const isr_vector_t AT((ADDR)) __ISR_ ## ADDR = {0xc3, (void *)&(FUNC)};
     
    #define ISR_NESTED_VECTOR(ADDR, FUNC)   static const isr_nested_vector_t __at((ADDR)) __ISR_ ## ADDR = {{0xfb, 0xc3}, (void *)&(FUNC)};
    #define ISR_NESTED_VECTOR(ADDR, FUNC)   static const isr_nested_vector_t AT((ADDR)) __ISR_ ## ADDR = {{0xfb, 0xc3}, (void *)&(FUNC)};
     
    - +

    @@ -211,7 +213,7 @@ Typedefs

    )   static const isr_vector_t __at((ADDR)) __ISR_ ## ADDR = {0xc3, (void *)&(FUNC)};   static const isr_vector_t AT((ADDR)) __ISR_ ## ADDR = {0xc3, (void *)&(FUNC)};
    @@ -232,7 +234,7 @@ Typedefs
    }
    -
    See also
    ISR_NESTED_VECTOR, set_interrupts
    +
    See also
    ISR_NESTED_VECTOR, set_interrupts
    @@ -257,7 +259,7 @@ Typedefs ) -    static const isr_nested_vector_t __at((ADDR)) __ISR_ ## ADDR = {{0xfb, 0xc3}, (void *)&(FUNC)}; +    static const isr_nested_vector_t AT((ADDR)) __ISR_ ## ADDR = {{0xfb, 0xc3}, (void *)&(FUNC)};
    @@ -305,8 +307,8 @@ Typedefs
    -
    #define VECTOR_TIMER
    Definition: isr.h:16
    -
    #define ISR_VECTOR(ADDR, FUNC)
    Definition: isr.h:51
    +
    #define VECTOR_TIMER
    Definition: isr.h:17
    +
    #define ISR_VECTOR(ADDR, FUNC)
    Definition: isr.h:52
    diff --git a/docs/api/isr_8h_source.html b/docs/api/isr_8h_source.html index a8478eea..4dfee9cf 100644 --- a/docs/api/isr_8h_source.html +++ b/docs/api/isr_8h_source.html @@ -29,6 +29,7 @@
    GBDK 2020 Docs +  4.0.6
    API Documentation for GBDK 2020
    @@ -94,41 +95,42 @@ $(document).ready(function(){initNavTree('isr_8h_source.html',''); initResizable
    10 #define _ISR_H_INCLUDE_
    11 
    12 #include <stdint.h>
    -
    13 
    -
    14 // #define VECTOR_VBL 0x40 // you can not define raw vector for VBlank interrupt
    -
    15 #define VECTOR_STAT 0x48
    -
    16 #define VECTOR_TIMER 0x50
    -
    17 #define VECTOR_SERIAL 0x58
    -
    18 #define VECTOR_JOYPAD 0x60
    -
    20 typedef struct isr_vector_t {
    - -
    22  void * func;
    - -
    24 
    -
    51 #define ISR_VECTOR(ADDR, FUNC) \
    -
    52 static const isr_vector_t __at((ADDR)) __ISR_ ## ADDR = {0xc3, (void *)&(FUNC)};
    -
    53 
    -
    54 typedef struct isr_nested_vector_t {
    - -
    56  void * func;
    - -
    58 
    -
    69 #define ISR_NESTED_VECTOR(ADDR, FUNC) \
    -
    70 static const isr_nested_vector_t __at((ADDR)) __ISR_ ## ADDR = {{0xfb, 0xc3}, (void *)&(FUNC)};
    -
    71 
    +
    13 #include <types.h>
    +
    14 
    +
    15 // #define VECTOR_VBL 0x40 // you can not define raw vector for VBlank interrupt
    +
    16 #define VECTOR_STAT 0x48
    +
    17 #define VECTOR_TIMER 0x50
    +
    18 #define VECTOR_SERIAL 0x58
    +
    19 #define VECTOR_JOYPAD 0x60
    +
    21 typedef struct isr_vector_t {
    + +
    23  void * func;
    + +
    25 
    +
    52 #define ISR_VECTOR(ADDR, FUNC) \
    +
    53 static const isr_vector_t AT((ADDR)) __ISR_ ## ADDR = {0xc3, (void *)&(FUNC)};
    +
    54 
    +
    55 typedef struct isr_nested_vector_t {
    + +
    57  void * func;
    + +
    59 
    +
    70 #define ISR_NESTED_VECTOR(ADDR, FUNC) \
    +
    71 static const isr_nested_vector_t AT((ADDR)) __ISR_ ## ADDR = {{0xfb, 0xc3}, (void *)&(FUNC)};
    72 
    -
    73 #endif // _ISR_H_INCLUDE_
    +
    73 
    +
    74 #endif // _ISR_H_INCLUDE_
    unsigned char uint8_t
    Definition: stdint.h:51
    struct isr_nested_vector_t isr_nested_vector_t
    -
    uint8_t opcode[2]
    Definition: isr.h:55
    -
    void * func
    Definition: isr.h:22
    +
    uint8_t opcode[2]
    Definition: isr.h:56
    +
    void * func
    Definition: isr.h:23
    -
    void * func
    Definition: isr.h:56
    +
    void * func
    Definition: isr.h:57
    struct isr_vector_t isr_vector_t
    -
    Definition: isr.h:54
    -
    uint8_t opcode
    Definition: isr.h:21
    +
    Definition: isr.h:55
    +
    uint8_t opcode
    Definition: isr.h:22

    Macro Definition Documentation

    + +

    ◆ RAND_MAX

    + +
    +
    + + + + +
    #define RAND_MAX   255
    +
    + +
    +
    + +

    ◆ RANDW_MAX

    + +
    +
    + + + + +
    #define RANDW_MAX   65535
    +
    + +
    +
    +

    Function Documentation

    ◆ initrand()

    @@ -137,18 +181,19 @@ Functions

    The seed should be different each time, otherwise the same pseudo-random sequence will be generated.

    The DIV Register (DIV_REG) is sometimes used as a seed, particularly if read at some variable point in time (such as when the player presses a button).

    -

    Only needs to be called once to initialize, buy may be called again to re-initialize with the same or a different seed.

    See also
    rand(), randw()
    +

    Only needs to be called once to initialize, but may be called again to re-initialize with the same or a different seed.

    +
    See also
    rand(), randw()
    - -

    ◆ rand()

    + +

    ◆ rand()

    - + @@ -156,7 +201,7 @@ Functions
    int8_t rand uint8_t rand ( )

    Returns a random byte (8 bit) value.

    -

    initrand() should be used to initialize the random number generator before using rand()

    +

    initrand() should be used to initialize the random number generator before using rand()

    @@ -175,7 +220,7 @@ Functions

    Returns a random word (16 bit) value.

    -

    initrand() should be used to initialize the random number generator before using rand()

    +

    initrand() should be used to initialize the random number generator before using rand()

    @@ -201,19 +246,19 @@ Functions -

    Note: initarand() calls initrand() with the same seed value, and uses rand() to initialize the random generator.

    -
    See also
    initrand() for suggestions about seed values, arand()
    +

    Note: initarand() calls initrand() with the same seed value, and uses rand() to initialize the random generator.

    +
    See also
    initrand() for suggestions about seed values, arand()
    - -

    ◆ arand()

    + +

    ◆ arand()

    - + @@ -221,12 +266,42 @@ Functions
    int8_t arand uint8_t arand ( )

    Returns a random number generated with the linear lagged additive method.

    -

    initarand() should be used to initialize the random number generator before using arand()

    +

    initarand() should be used to initialize the random number generator before using arand()

    +
    +
    +

    Variable Documentation

    + +

    ◆ __rand_seed

    + +
    +
    + + + + + +
    + + + + +
    uint16_t __rand_seed
    +
    +extern
    +
    +

    The random number seed is stored in __rand_seed and can be saved and restored if needed.

    +
    // Save
    +
    some_uint16 = __rand_seed;
    +
    ...
    +
    // Restore
    +
    __rand_seed = some_uint16;
    +
    +
    uint16_t __rand_seed
    -
    signed char int8_t
    Definition: stdint.h:43
    +
    unsigned char uint8_t
    Definition: stdint.h:51
    -
    int8_t arand() OLDCALL
    unsigned short int uint16_t
    Definition: stdint.h:52
    -
    int8_t rand() OLDCALL
    uint16_t randw() OLDCALL
    +
    uint16_t __rand_seed
    +
    uint8_t arand() OLDCALL
    void initrand(uint16_t seed) OLDCALL
    -
    #define OLDCALL
    Definition: types.h:21
    +
    #define OLDCALL
    Definition: types.h:19
    +
    #define Z88DK_FASTCALL
    Definition: types.h:43
    void initarand(uint16_t seed) OLDCALL
    +
    uint8_t rand() OLDCALL
    unsigned char uint8_t
    Definition: stdint.h:51
    uint8_t rle_init(void *data) OLDCALL
    +
    #define Z88DK_CALLEE
    Definition: types.h:42
    uint8_t rle_decompress(void *dest, uint8_t len) OLDCALL
    -
    #define OLDCALL
    Definition: types.h:21
    +
    #define OLDCALL
    Definition: types.h:19
    +
    #define Z88DK_FASTCALL
    Definition: types.h:43
    unsigned char uint8_t
    Definition: stdint.h:51
    unsigned short int uint16_t
    Definition: stdint.h:52
    -
    uint16_t gb_decompress(const uint8_t *sour, uint8_t *dest) OLDCALL __preserves_regs(b
    +
    #define Z88DK_CALLEE
    Definition: types.h:42
    -
    void b
    Definition: gb.h:585
    -
    uint16_t c
    Definition: gbdecompress.h:20
    +
    void b
    Definition: gb.h:608
    +
    uint16_t gb_decompress(const uint8_t *sour, uint8_t *dest) OLDCALL PRESERVES_REGS(b
    +
    uint16_t c
    Definition: gbdecompress.h:21
    +
    #define PRESERVES_REGS(...)
    Definition: types.h:29
    +
    + + +

    ◆ PSG_LATCH

    + +
    +
    + + + + +
    #define PSG_LATCH   0x80
    +
    + +
    +
    + +

    ◆ PSG_CH0

    + +
    +
    + + + + +
    #define PSG_CH0   0b00000000
    +
    + +
    +
    + +

    ◆ PSG_CH1

    + +
    +
    + + + + +
    #define PSG_CH1   0b00100000
    +
    + +
    +
    + +

    ◆ PSG_CH2

    + +
    +
    + + + + +
    #define PSG_CH2   0b01000000
    +
    + +
    +
    + +

    ◆ PSG_CH3

    + +
    +
    + + + + +
    #define PSG_CH3   0b01100000
    +
    + +
    +
    + +

    ◆ PSG_VOLUME

    + +
    +
    + + + + +
    #define PSG_VOLUME   0b00010000
    +
    +
    diff --git a/docs/api/sms_2hardware_8h.js b/docs/api/sms_2hardware_8h.js index 2c63c8a6..38734e19 100644 --- a/docs/api/sms_2hardware_8h.js +++ b/docs/api/sms_2hardware_8h.js @@ -16,6 +16,12 @@ var sms_2hardware_8h = [ "MEMCTL_EXTOFF", "sms_2hardware_8h.html#ac4c1790dd7397ef1005190dc01b3e808", null ], [ "JOY_P1_LATCH", "sms_2hardware_8h.html#aa8e128eeff1d58f674cebdbacc413f3c", null ], [ "JOY_P2_LATCH", "sms_2hardware_8h.html#a2cfa517650949a89a7ebabf0253fcdf7", null ], + [ "PSG_LATCH", "sms_2hardware_8h.html#a6777f1ed2475b5ba6aa60b9a16fa02d3", null ], + [ "PSG_CH0", "sms_2hardware_8h.html#ad8a903de6b38e08e1591fc5ef278381c", null ], + [ "PSG_CH1", "sms_2hardware_8h.html#addc12c4ee03ea787b826e337f1acd317", null ], + [ "PSG_CH2", "sms_2hardware_8h.html#aaeefb1ac1fb4d0d2324b8ee7f4953226", null ], + [ "PSG_CH3", "sms_2hardware_8h.html#ac760259fb86ee72abb5922018ae0db42", null ], + [ "PSG_VOLUME", "sms_2hardware_8h.html#a3d806ff027bffa67c4dfc5967f87c1d1", null ], [ "STATF_INT_VBL", "sms_2hardware_8h.html#a4702e74fffdc57d60c3835e63c665cc1", null ], [ "STATF_9_SPR", "sms_2hardware_8h.html#a4a7b807e5e5987302a5315fe5c815ce8", null ], [ "STATF_SPR_COLL", "sms_2hardware_8h.html#a6fdd982d805d5af6de0417e24faf027d", null ], diff --git a/docs/api/sms_2hardware_8h_source.html b/docs/api/sms_2hardware_8h_source.html index 228352ed..376da136 100644 --- a/docs/api/sms_2hardware_8h_source.html +++ b/docs/api/sms_2hardware_8h_source.html @@ -29,6 +29,7 @@
    GBDK 2020 Docs +  4.0.6
    API Documentation for GBDK 2020
    @@ -98,7 +99,7 @@ $(document).ready(function(){initNavTree('sms_2hardware_8h_source.html',''); ini
    10 #define __BYTES extern UBYTE
    11 #define __BYTE_REG extern volatile UBYTE
    12 
    -
    13 static volatile __sfr __at(0x3E) MEMORY_CTL;
    +
    13 static volatile SFR AT(0x3E) MEMORY_CTL;
    14 
    15 #define MEMCTL_JOYON 0b00000000
    16 #define MEMCTL_JOYOFF 0b00000100
    @@ -113,193 +114,206 @@ $(document).ready(function(){initNavTree('sms_2hardware_8h_source.html',''); ini
    25 #define MEMCTL_EXTON 0b00000000
    26 #define MEMCTL_EXTOFF 0b10000000
    27 
    -
    28 static volatile __sfr __at(0x3F) JOY_CTL;
    +
    28 static volatile SFR AT(0x3F) JOY_CTL;
    29 
    30 #define JOY_P1_LATCH 0b00000010
    31 #define JOY_P2_LATCH 0b00001000
    32 
    -
    33 static volatile __sfr __at(0x7E) VCOUNTER;
    -
    34 static volatile __sfr __at(0x7F) PSG;
    -
    35 static volatile __sfr __at(0x7F) HCOUNTER;
    +
    33 static volatile SFR AT(0x7E) VCOUNTER;
    +
    34 
    +
    35 static volatile SFR AT(0x7F) PSG;
    36 
    -
    37 static volatile __sfr __at(0xBE) VDP_DATA;
    -
    38 static volatile __sfr __at(0xBF) VDP_CMD;
    -
    39 static volatile __sfr __at(0xBF) VDP_STATUS;
    -
    40 
    -
    41 #define STATF_INT_VBL 0b10000000
    -
    42 #define STATF_9_SPR 0b01000000
    -
    43 #define STATF_SPR_COLL 0b00100000
    -
    44 
    -
    45 #define VDP_REG_MASK 0b10000000
    -
    46 #define VDP_R0 0b10000000
    -
    47 extern UBYTE shadow_VDP_R0;
    -
    48 
    -
    49 #define R0_VSCRL 0b00000000
    -
    50 #define R0_VSCRL_INH 0b10000000
    -
    51 #define R0_HSCRL 0b00000000
    -
    52 #define R0_HSCRL_INH 0b01000000
    -
    53 #define R0_NO_LCB 0b00000000
    -
    54 #define R0_LCB 0b00100000
    -
    55 #define R0_IE1_OFF 0b00000000
    -
    56 #define R0_IE1 0b00010000
    -
    57 #define R0_SS_OFF 0b00000000
    -
    58 #define R0_SS 0b00001000
    -
    59 #define R0_DEFAULT 0b00000110
    -
    60 #define R0_ES_OFF 0b00000000
    -
    61 #define R0_ES 0b00000001
    -
    62 
    -
    63 #define VDP_R1 0b10000001
    -
    64 extern UBYTE shadow_VDP_R1;
    -
    65 
    -
    66 #define R1_DEFAULT 0b10000000
    -
    67 #define R1_DISP_OFF 0b00000000
    -
    68 #define R1_DISP_ON 0b01000000
    -
    69 #define R1_IE_OFF 0b00000000
    -
    70 #define R1_IE 0b00100000
    -
    71 #define R1_SPR_8X8 0b00000000
    -
    72 #define R1_SPR_8X16 0b00000010
    +
    37 #define PSG_LATCH 0x80
    +
    38 
    +
    39 #define PSG_CH0 0b00000000
    +
    40 #define PSG_CH1 0b00100000
    +
    41 #define PSG_CH2 0b01000000
    +
    42 #define PSG_CH3 0b01100000
    +
    43 
    +
    44 #define PSG_VOLUME 0b00010000
    +
    45 
    +
    46 static volatile SFR AT(0x7F) HCOUNTER;
    +
    47 
    +
    48 static volatile SFR AT(0xBE) VDP_DATA;
    +
    49 static volatile SFR AT(0xBF) VDP_CMD;
    +
    50 static volatile SFR AT(0xBF) VDP_STATUS;
    +
    51 
    +
    52 #define STATF_INT_VBL 0b10000000
    +
    53 #define STATF_9_SPR 0b01000000
    +
    54 #define STATF_SPR_COLL 0b00100000
    +
    55 
    +
    56 #define VDP_REG_MASK 0b10000000
    +
    57 #define VDP_R0 0b10000000
    +
    58 extern UBYTE shadow_VDP_R0;
    +
    59 
    +
    60 #define R0_VSCRL 0b00000000
    +
    61 #define R0_VSCRL_INH 0b10000000
    +
    62 #define R0_HSCRL 0b00000000
    +
    63 #define R0_HSCRL_INH 0b01000000
    +
    64 #define R0_NO_LCB 0b00000000
    +
    65 #define R0_LCB 0b00100000
    +
    66 #define R0_IE1_OFF 0b00000000
    +
    67 #define R0_IE1 0b00010000
    +
    68 #define R0_SS_OFF 0b00000000
    +
    69 #define R0_SS 0b00001000
    +
    70 #define R0_DEFAULT 0b00000110
    +
    71 #define R0_ES_OFF 0b00000000
    +
    72 #define R0_ES 0b00000001
    73 
    -
    74 #define VDP_R2 0b10000010
    -
    75 extern UBYTE shadow_VDP_R2;
    +
    74 #define VDP_R1 0b10000001
    +
    75 extern UBYTE shadow_VDP_R1;
    76 
    -
    77 #define R2_MAP_0x3800 0xFF
    -
    78 #define R2_MAP_0x3000 0xFD
    -
    79 #define R2_MAP_0x2800 0xFB
    -
    80 #define R2_MAP_0x2000 0xF9
    -
    81 #define R2_MAP_0x1800 0xF7
    -
    82 #define R2_MAP_0x1000 0xF5
    -
    83 #define R2_MAP_0x0800 0xF3
    -
    84 #define R2_MAP_0x0000 0xF1
    -
    85 
    -
    86 #define VDP_R3 0b10000011
    -
    87 extern UBYTE shadow_VDP_R3;
    -
    88 #define VDP_R4 0b10000100
    -
    89 extern UBYTE shadow_VDP_R4;
    -
    90 #define VDP_R5 0b10000101
    -
    91 extern UBYTE shadow_VDP_R5;
    -
    92 
    -
    93 #define R5_SAT_0x3F00 0xFF
    -
    94 #define R5_SAT_MASK 0b10000001
    -
    95 
    -
    96 #define VDP_R6 0b10000110
    -
    97 extern UBYTE shadow_VDP_R6;
    -
    98 
    -
    99 #define R6_BANK0 0xFB
    -
    100 #define R6_DATA_0x0000 0xFB
    -
    101 #define R6_BANK1 0xFF
    -
    102 #define R6_DATA_0x2000 0xFF
    +
    77 #define R1_DEFAULT 0b10000000
    +
    78 #define R1_DISP_OFF 0b00000000
    +
    79 #define R1_DISP_ON 0b01000000
    +
    80 #define R1_IE_OFF 0b00000000
    +
    81 #define R1_IE 0b00100000
    +
    82 #define R1_SPR_8X8 0b00000000
    +
    83 #define R1_SPR_8X16 0b00000010
    +
    84 
    +
    85 #define VDP_R2 0b10000010
    +
    86 extern UBYTE shadow_VDP_R2;
    +
    87 
    +
    88 #define R2_MAP_0x3800 0xFF
    +
    89 #define R2_MAP_0x3000 0xFD
    +
    90 #define R2_MAP_0x2800 0xFB
    +
    91 #define R2_MAP_0x2000 0xF9
    +
    92 #define R2_MAP_0x1800 0xF7
    +
    93 #define R2_MAP_0x1000 0xF5
    +
    94 #define R2_MAP_0x0800 0xF3
    +
    95 #define R2_MAP_0x0000 0xF1
    +
    96 
    +
    97 #define VDP_R3 0b10000011
    +
    98 extern UBYTE shadow_VDP_R3;
    +
    99 #define VDP_R4 0b10000100
    +
    100 extern UBYTE shadow_VDP_R4;
    +
    101 #define VDP_R5 0b10000101
    +
    102 extern UBYTE shadow_VDP_R5;
    103 
    -
    104 #define VDP_R7 0b10000111
    -
    105 extern UBYTE shadow_VDP_R7;
    -
    106 #define VDP_RBORDER 0b10000111
    - -
    108 
    -
    109 #define R7_COLOR_MASK 0b11110000
    -
    110 
    -
    111 #define VDP_R8 0b10001000
    -
    112 extern UBYTE shadow_VDP_R8;
    -
    113 #define VDP_RSCX 0b10001000
    -
    114 extern UBYTE shadow_VDP_RSCX;
    -
    115 
    -
    116 #define VDP_R9 0b10001001
    -
    117 extern UBYTE shadow_VDP_R9;
    -
    118 #define VDP_RSCY 0b10001001
    -
    119 extern UBYTE shadow_VDP_RSCY;
    -
    120 
    -
    121 #define VDP_R10 0b10001010
    -
    122 extern UBYTE shadow_VDP_R10;
    -
    123 
    -
    124 #define R10_INT_OFF 0xFF
    -
    125 #define R10_INT_EVERY 0x00
    +
    104 #define R5_SAT_0x3F00 0xFF
    +
    105 #define R5_SAT_MASK 0b10000001
    +
    106 
    +
    107 #define VDP_R6 0b10000110
    +
    108 extern UBYTE shadow_VDP_R6;
    +
    109 
    +
    110 #define R6_BANK0 0xFB
    +
    111 #define R6_DATA_0x0000 0xFB
    +
    112 #define R6_BANK1 0xFF
    +
    113 #define R6_DATA_0x2000 0xFF
    +
    114 
    +
    115 #define VDP_R7 0b10000111
    +
    116 extern UBYTE shadow_VDP_R7;
    +
    117 #define VDP_RBORDER 0b10000111
    + +
    119 
    +
    120 #define R7_COLOR_MASK 0b11110000
    +
    121 
    +
    122 #define VDP_R8 0b10001000
    +
    123 extern UBYTE shadow_VDP_R8;
    +
    124 #define VDP_RSCX 0b10001000
    +
    125 extern UBYTE shadow_VDP_RSCX;
    126 
    -
    127 static volatile __sfr __at(0xDC) JOY_PORT1;
    -
    128 
    -
    129 #define JOY_P1_UP 0b00000001
    -
    130 #define JOY_P1_DOWN 0b00000010
    -
    131 #define JOY_P1_LEFT 0b00000100
    -
    132 #define JOY_P1_RIGHT 0b00001000
    -
    133 #define JOY_P1_SW1 0b00010000
    -
    134 #define JOY_P1_TRIGGER 0b00010000
    -
    135 #define JOY_P1_SW2 0b00100000
    -
    136 #define JOY_P2_UP 0b01000000
    -
    137 #define JOY_P2_DOWN 0b10000000
    -
    138 
    -
    139 static volatile __sfr __at(0xDD) JOY_PORT2;
    -
    140 
    -
    141 #define JOY_P2_LEFT 0b00000001
    -
    142 #define JOY_P2_RIGHT 0b00000010
    -
    143 #define JOY_P2_SW1 0b00000100
    -
    144 #define JOY_P2_TRIGGER 0b00000100
    -
    145 #define JOY_P2_SW2 0b00001000
    -
    146 #define JOY_RESET 0b00010000
    -
    147 #define JOY_P1_LIGHT 0b01000000
    -
    148 #define JOY_P2_LIGHT 0b10000000
    +
    127 #define VDP_R9 0b10001001
    +
    128 extern UBYTE shadow_VDP_R9;
    +
    129 #define VDP_RSCY 0b10001001
    +
    130 extern UBYTE shadow_VDP_RSCY;
    +
    131 
    +
    132 #define VDP_R10 0b10001010
    +
    133 extern UBYTE shadow_VDP_R10;
    +
    134 
    +
    135 #define R10_INT_OFF 0xFF
    +
    136 #define R10_INT_EVERY 0x00
    +
    137 
    +
    138 static volatile SFR AT(0xDC) JOY_PORT1;
    +
    139 
    +
    140 #define JOY_P1_UP 0b00000001
    +
    141 #define JOY_P1_DOWN 0b00000010
    +
    142 #define JOY_P1_LEFT 0b00000100
    +
    143 #define JOY_P1_RIGHT 0b00001000
    +
    144 #define JOY_P1_SW1 0b00010000
    +
    145 #define JOY_P1_TRIGGER 0b00010000
    +
    146 #define JOY_P1_SW2 0b00100000
    +
    147 #define JOY_P2_UP 0b01000000
    +
    148 #define JOY_P2_DOWN 0b10000000
    149 
    -
    150 static volatile __sfr __at(0xF0) FMADDRESS;
    -
    151 static volatile __sfr __at(0xF1) FMDATA;
    -
    152 static volatile __sfr __at(0xF2) AUDIOCTRL;
    -
    153 
    -
    154 static volatile UBYTE __at(0xfffc) RAM_CONTROL;
    -
    155 
    -
    156 #define RAMCTL_BANK 0b00000100
    -
    157 #define RAMCTL_ROM 0b00000000
    -
    158 #define RAMCTL_RAM 0b00001000
    -
    159 #define RAMCTL_RO 0b00010000
    -
    160 #define RAMCTL_PROT 0b10000000
    -
    161 
    -
    162 static volatile UBYTE __at(0xfff8) GLASSES_3D;
    -
    163 
    -
    164 static volatile UBYTE __at(0xfffd) MAP_FRAME0;
    -
    165 static volatile UBYTE __at(0xfffe) MAP_FRAME1;
    -
    166 static volatile UBYTE __at(0xffff) MAP_FRAME2;
    -
    167 
    -
    168 extern const UBYTE _BIOS;
    -
    169 
    -
    170 extern const UBYTE _SYSTEM;
    -
    171 
    -
    172 #define SYSTEM_PAL 0x00
    -
    173 #define SYSTEM_NTSC 0x01
    +
    150 static volatile SFR AT(0xDD) JOY_PORT2;
    +
    151 
    +
    152 #define JOY_P2_LEFT 0b00000001
    +
    153 #define JOY_P2_RIGHT 0b00000010
    +
    154 #define JOY_P2_SW1 0b00000100
    +
    155 #define JOY_P2_TRIGGER 0b00000100
    +
    156 #define JOY_P2_SW2 0b00001000
    +
    157 #define JOY_RESET 0b00010000
    +
    158 #define JOY_P1_LIGHT 0b01000000
    +
    159 #define JOY_P2_LIGHT 0b10000000
    +
    160 
    +
    161 static volatile SFR AT(0xF0) FMADDRESS;
    +
    162 static volatile SFR AT(0xF1) FMDATA;
    +
    163 static volatile SFR AT(0xF2) AUDIOCTRL;
    +
    164 
    +
    165 static volatile UBYTE AT(0xfffc) RAM_CONTROL;
    +
    166 
    +
    167 #define RAMCTL_BANK 0b00000100
    +
    168 #define RAMCTL_ROM 0b00000000
    +
    169 #define RAMCTL_RAM 0b00001000
    +
    170 #define RAMCTL_RO 0b00010000
    +
    171 #define RAMCTL_PROT 0b10000000
    +
    172 
    +
    173 static volatile UBYTE AT(0xfff8) GLASSES_3D;
    174 
    -
    175 extern volatile UBYTE VDP_ATTR_SHIFT;
    -
    176 
    -
    177 #define VDP_SAT_TERM 0xD0
    +
    175 static volatile UBYTE AT(0xfffd) MAP_FRAME0;
    +
    176 static volatile UBYTE AT(0xfffe) MAP_FRAME1;
    +
    177 static volatile UBYTE AT(0xffff) MAP_FRAME2;
    178 
    -
    179 #if defined(__TARGET_sms)
    -
    180 #define DEVICE_SCREEN_X_OFFSET 0
    -
    181 #define DEVICE_SCREEN_Y_OFFSET 0
    -
    182 #define DEVICE_SCREEN_WIDTH 32
    -
    183 #define DEVICE_SCREEN_HEIGHT 24
    -
    184 #define DEVICE_SCREEN_BUFFER_WIDTH 32
    -
    185 #define DEVICE_SCREEN_BUFFER_HEIGHT 28
    -
    186 #define DEVICE_SCREEN_MAP_ENTRY_SIZE 2
    -
    187 #define DEVICE_SPRITE_PX_OFFSET_X 0
    -
    188 #define DEVICE_SPRITE_PX_OFFSET_Y -1
    -
    189 #elif defined(__TARGET_gg)
    -
    190 #define DEVICE_SCREEN_X_OFFSET 6
    -
    191 #define DEVICE_SCREEN_Y_OFFSET 3
    -
    192 #define DEVICE_SCREEN_WIDTH 20
    -
    193 #define DEVICE_SCREEN_HEIGHT 18
    -
    194 #define DEVICE_SCREEN_BUFFER_WIDTH 32
    -
    195 #define DEVICE_SCREEN_BUFFER_HEIGHT 28
    -
    196 #define DEVICE_SCREEN_MAP_ENTRY_SIZE 2
    -
    197 #define DEVICE_SPRITE_PX_OFFSET_X 48
    -
    198 #define DEVICE_SPRITE_PX_OFFSET_Y 23
    -
    199 #else
    -
    200 #error Unrecognized port
    -
    201 #endif
    -
    202 #define DEVICE_SCREEN_PX_WIDTH (DEVICE_SCREEN_WIDTH * 8)
    -
    203 #define DEVICE_SCREEN_PX_HEIGHT (DEVICE_SCREEN_HEIGHT * 8)
    -
    204 
    -
    205 #endif
    +
    179 extern const UBYTE _BIOS;
    +
    180 
    +
    181 extern const UBYTE _SYSTEM;
    +
    182 
    +
    183 #define SYSTEM_PAL 0x00
    +
    184 #define SYSTEM_NTSC 0x01
    +
    185 
    +
    186 extern volatile UBYTE VDP_ATTR_SHIFT;
    +
    187 
    +
    188 #define VDP_SAT_TERM 0xD0
    +
    189 
    +
    190 #if defined(__TARGET_sms)
    +
    191 #define DEVICE_SCREEN_X_OFFSET 0
    +
    192 #define DEVICE_SCREEN_Y_OFFSET 0
    +
    193 #define DEVICE_SCREEN_WIDTH 32
    +
    194 #define DEVICE_SCREEN_HEIGHT 24
    +
    195 #define DEVICE_SCREEN_BUFFER_WIDTH 32
    +
    196 #define DEVICE_SCREEN_BUFFER_HEIGHT 28
    +
    197 #define DEVICE_SCREEN_MAP_ENTRY_SIZE 2
    +
    198 #define DEVICE_SPRITE_PX_OFFSET_X 0
    +
    199 #define DEVICE_SPRITE_PX_OFFSET_Y -1
    +
    200 #elif defined(__TARGET_gg)
    +
    201 #define DEVICE_SCREEN_X_OFFSET 6
    +
    202 #define DEVICE_SCREEN_Y_OFFSET 3
    +
    203 #define DEVICE_SCREEN_WIDTH 20
    +
    204 #define DEVICE_SCREEN_HEIGHT 18
    +
    205 #define DEVICE_SCREEN_BUFFER_WIDTH 32
    +
    206 #define DEVICE_SCREEN_BUFFER_HEIGHT 28
    +
    207 #define DEVICE_SCREEN_MAP_ENTRY_SIZE 2
    +
    208 #define DEVICE_SPRITE_PX_OFFSET_X 48
    +
    209 #define DEVICE_SPRITE_PX_OFFSET_Y 23
    +
    210 #else
    +
    211 #error Unrecognized port
    +
    212 #endif
    +
    213 #define DEVICE_SCREEN_PX_WIDTH (DEVICE_SCREEN_WIDTH * 8)
    +
    214 #define DEVICE_SCREEN_PX_HEIGHT (DEVICE_SCREEN_HEIGHT * 8)
    +
    215 
    +
    216 #endif
    UBYTE shadow_VDP_R10
    +
    #define SFR
    Definition: types.h:31
    +
    #define AT(A)
    Definition: types.h:32
    UBYTE shadow_VDP_R2
    volatile UBYTE VDP_ATTR_SHIFT
    UBYTE shadow_VDP_R4
    UBYTE shadow_VDP_R3
    UBYTE shadow_VDP_R6
    -
    UINT8 UBYTE
    Definition: types.h:56
    +
    UINT8 UBYTE
    Definition: types.h:58
    UBYTE shadow_VDP_R8
    const UBYTE _BIOS
    UBYTE shadow_VDP_RSCX
    diff --git a/docs/api/sms_2metasprites_8h.html b/docs/api/sms_2metasprites_8h.html index 0dccf3db..530c7baa 100644 --- a/docs/api/sms_2metasprites_8h.html +++ b/docs/api/sms_2metasprites_8h.html @@ -29,6 +29,7 @@
    GBDK 2020 Docs +  4.0.6
    API Documentation for GBDK 2020
    @@ -96,6 +97,7 @@ $(document).ready(function(){initNavTree('sms_2metasprites_8h.html',''); initRes
    #include <sms/hardware.h>
    +#include <types.h>
    #include <stdint.h>

    Go to the source code of this file.

    @@ -121,8 +123,8 @@ Typedefs - - + + @@ -244,8 +246,8 @@ Metasprites composed of variable numbers of sprites

    Function Documentation

    - -

    ◆ hide_sprites_range()

    + +

    ◆ hide_sprites_range()

    diff --git a/docs/api/sms_2metasprites_8h.js b/docs/api/sms_2metasprites_8h.js index 6d275c23..a211dd89 100644 --- a/docs/api/sms_2metasprites_8h.js +++ b/docs/api/sms_2metasprites_8h.js @@ -5,7 +5,7 @@ var sms_2metasprites_8h = [ "METASPR_ITEM", "sms_2metasprites_8h.html#aa88dc4d5e35045509b8955a4a23a30aa", null ], [ "METASPR_TERM", "sms_2metasprites_8h.html#aa1d425dcce3cd104751744535b6a389a", null ], [ "metasprite_t", "sms_2metasprites_8h.html#aba6401cc8173158a9f37ee22094c03d3", null ], - [ "hide_sprites_range", "sms_2metasprites_8h.html#a23abcd0a2eb5033abbb9dc0e2ea494d8", null ], + [ "hide_sprites_range", "sms_2metasprites_8h.html#a0c668f442b4764275a1dade597a59e20", null ], [ "move_metasprite", "sms_2metasprites_8h.html#a77475e913bf0a19df28bdbf9d1cf392b", null ], [ "hide_metasprite", "sms_2metasprites_8h.html#af8de5a888d65448b9d34027a0e1ce906", null ], [ "__current_metasprite", "sms_2metasprites_8h.html#aae51f066cc5436457f62351847bfc64b", null ], diff --git a/docs/api/sms_2metasprites_8h_source.html b/docs/api/sms_2metasprites_8h_source.html index c497c3e9..43abb008 100644 --- a/docs/api/sms_2metasprites_8h_source.html +++ b/docs/api/sms_2metasprites_8h_source.html @@ -29,6 +29,7 @@
    @@ -94,57 +95,61 @@ $(document).ready(function(){initNavTree('sms_2metasprites_8h_source.html','');
    35 #define _METASPRITES_H_INCLUDE
    36 
    37 #include <sms/hardware.h>
    -
    38 #include <stdint.h>
    -
    39 
    -
    52 typedef struct metasprite_t {
    -
    53  int8_t dy, dx;
    -
    54  uint8_t dtile;
    - -
    56 
    -
    57 #define metasprite_end -128
    -
    58 #define METASPR_ITEM(dy,dx,dt,a) {(dy),(dx),(dt)}
    -
    59 #define METASPR_TERM {metasprite_end}
    -
    60 
    -
    61 extern const void * __current_metasprite;
    - - -
    64 
    +
    38 #include <types.h>
    +
    39 #include <stdint.h>
    +
    40 
    +
    53 typedef struct metasprite_t {
    +
    54  int8_t dy, dx;
    +
    55  uint8_t dtile;
    + +
    57 
    +
    58 #define metasprite_end -128
    +
    59 #define METASPR_ITEM(dy,dx,dt,a) {(dy),(dx),(dt)}
    +
    60 #define METASPR_TERM {metasprite_end}
    +
    61 
    +
    62 extern const void * __current_metasprite;
    + +
    65 
    -
    66 static uint8_t __move_metasprite(uint8_t id, uint8_t x, uint8_t y) __z88dk_callee __preserves_regs(iyh,iyl);
    -
    67 static void __hide_metasprite(uint8_t id) __z88dk_fastcall __preserves_regs(iyh,iyl);
    -
    68 
    -
    74 void hide_sprites_range(UINT8 from, UINT8 to) __z88dk_callee __preserves_regs(iyh,iyl);
    -
    75 
    -
    95 inline uint8_t move_metasprite(const metasprite_t * metasprite, uint8_t base_tile, uint8_t base_sprite, uint8_t x, uint8_t y) {
    -
    96  __current_metasprite = metasprite;
    -
    97  __current_base_tile = base_tile;
    -
    98  return __move_metasprite(base_sprite, x, y);
    -
    99 }
    -
    100 
    -
    110 inline void hide_metasprite(const metasprite_t * metasprite, uint8_t base_sprite) {
    -
    111  __current_metasprite = metasprite;
    -
    112  __hide_metasprite(base_sprite);
    -
    113 }
    -
    114 
    -
    115 #endif
    +
    66 
    +
    67 static uint8_t __move_metasprite(uint8_t id, uint8_t x, uint8_t y) Z88DK_CALLEE PRESERVES_REGS(iyh, iyl);
    +
    68 static void __hide_metasprite(uint8_t id) Z88DK_FASTCALL PRESERVES_REGS(iyh, iyl);
    +
    69 
    + +
    76 
    +
    96 inline uint8_t move_metasprite(const metasprite_t * metasprite, uint8_t base_tile, uint8_t base_sprite, uint8_t x, uint8_t y) {
    +
    97  __current_metasprite = metasprite;
    +
    98  __current_base_tile = base_tile;
    +
    99  return __move_metasprite(base_sprite, x, y);
    +
    100 }
    +
    101 
    +
    111 inline void hide_metasprite(const metasprite_t * metasprite, uint8_t base_sprite) {
    +
    112  __current_metasprite = metasprite;
    +
    113  __hide_metasprite(base_sprite);
    +
    114 }
    +
    115 
    +
    116 #endif
    -
    unsigned char UINT8
    Definition: types.h:43
    +
    unsigned char UINT8
    Definition: types.h:46
    unsigned char uint8_t
    Definition: stdint.h:51
    signed char int8_t
    Definition: stdint.h:43
    -
    Definition: metasprites.h:80
    +
    Definition: metasprites.h:87
    -
    int8_t dy
    Definition: metasprites.h:81
    +
    int8_t dy
    Definition: metasprites.h:88
    +
    #define Z88DK_CALLEE
    Definition: types.h:42
    uint8_t __current_base_tile
    -
    int8_t dx
    Definition: metasprites.h:81
    -
    uint8_t move_metasprite(const metasprite_t *metasprite, uint8_t base_tile, uint8_t base_sprite, uint8_t x, uint8_t y)
    Definition: metasprites.h:130
    -
    void hide_metasprite(const metasprite_t *metasprite, uint8_t base_sprite)
    Definition: metasprites.h:227
    +
    int8_t dx
    Definition: metasprites.h:88
    +
    uint8_t move_metasprite(const metasprite_t *metasprite, uint8_t base_tile, uint8_t base_sprite, uint8_t x, uint8_t y)
    Definition: metasprites.h:137
    +
    void hide_metasprite(const metasprite_t *metasprite, uint8_t base_sprite)
    Definition: metasprites.h:240
    +
    void hide_sprites_range(UINT8 from, UINT8 to) OLDCALL PRESERVES_REGS(b
    struct metasprite_t metasprite_t
    -
    static uint8_t iyl
    Definition: metasprites.h:66
    -
    void hide_sprites_range(UINT8 from, UINT8 to) OLDCALL __preserves_regs(b
    +
    #define Z88DK_FASTCALL
    Definition: types.h:43
    +
    static uint8_t iyl
    Definition: metasprites.h:67
    const void * __current_metasprite
    -
    uint8_t dtile
    Definition: metasprites.h:82
    +
    uint8_t dtile
    Definition: metasprites.h:89
    +
    #define PRESERVES_REGS(...)
    Definition: types.h:29
    void iyh
    Definition: sms.h:86
    uint8_t __render_shadow_OAM
    diff --git a/docs/api/sms_8h.html b/docs/api/sms_8h.html index 1a3f0a2c..3ac99cde 100644 --- a/docs/api/sms_8h.html +++ b/docs/api/sms_8h.html @@ -29,6 +29,7 @@ @@ -217,23 +218,23 @@ Macros - + - + - + - + - + - + - + - + @@ -241,92 +242,92 @@ Macros - + - + - +

    Functions

    void hide_sprites_range (UINT8 from, UINT8 to) __z88dk_callee __preserves_regs(iyh
     
    void hide_sprites_range (UINT8 from, UINT8 to) Z88DK_CALLEE PRESERVES_REGS(iyh
     
    uint8_t move_metasprite (const metasprite_t *metasprite, uint8_t base_tile, uint8_t base_sprite, uint8_t x, uint8_t y)
     
    void hide_metasprite (const metasprite_t *metasprite, uint8_t base_sprite)
    GBDK 2020 Docs +  4.0.6
    API Documentation for GBDK 2020
    GBDK 2020 Docs +  4.0.6
    API Documentation for GBDK 2020
     
    #define DISABLE_RAM   RAM_CONTROL&=(~RAMCTL_RAM)
     
    #define set_bkg_palette_entry   set_palette_entry
    #define set_bkg_palette_entry   set_palette_entry
     
    #define set_sprite_palette_entry(palette, entry, rgb_data)   set_palette_entry(1,entry,rgb_data)
    #define set_sprite_palette_entry(palette, entry, rgb_data)   set_palette_entry(1,entry,rgb_data)
     
    #define set_bkg_palette   set_palette
    #define set_bkg_palette   set_palette
     
    #define set_sprite_palette(first_palette, nb_palettes, rgb_data)   set_palette(1,1,rgb_data)
    #define set_sprite_palette(first_palette, nb_palettes, rgb_data)   set_palette(1,1,rgb_data)
     
    #define COMPAT_PALETTE(C0, C1, C2, C3)   (((uint16_t)(C3) << 12) | ((uint16_t)(C2) << 8) | ((uint16_t)(C1) << 4) | (uint16_t)(C0))
     
    #define set_bkg_tiles   set_tile_map_compat
    #define set_bkg_tiles   set_tile_map_compat
     
    #define set_win_tiles   set_tile_map_compat
    #define set_win_tiles   set_tile_map_compat
     
    #define fill_bkg_rect   fill_rect_compat
    #define fill_bkg_rect   fill_rect_compat
     
    #define fill_win_rect   fill_rect_compat
    #define fill_win_rect   fill_rect_compat
     
    #define DISABLE_VBL_TRANSFER    _shadow_OAM_base = 0
     
     
    #define MAX_HARDWARE_SPRITES   64
     
    #define set_bkg_tile_xy   set_tile_xy
    #define set_bkg_tile_xy   set_tile_xy
     
    #define set_win_tile_xy   set_tile_xy
    #define set_win_tile_xy   set_tile_xy
     
    #define get_win_xy_addr   get_bkg_xy_addr
    #define get_win_xy_addr   get_bkg_xy_addr
     
    - +

    Typedefs

    typedef void(* int_handler) (void) NONBANKED
    typedef void(* int_handler) (void) NONBANKED
     
    - - - - + + + + - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + - - + + - - - - - - - - - - - - + + + + + + + + + + + + - - - - - - + + + + + + - - + + @@ -337,32 +338,40 @@ Functions - - + + - - - - - - - - - - - - + + + + + + + + + + + + + + + + - - - - + + + + + + + + @@ -379,14 +388,14 @@ Functions - - - - - - - - + + + + + + + +

    Functions

    void WRITE_VDP_CMD (uint16_t cmd) __z88dk_fastcall __preserves_regs(b
     
    void WRITE_VDP_DATA (uint16_t data) __z88dk_fastcall __preserves_regs(b
     
    void WRITE_VDP_CMD (uint16_t cmd) Z88DK_FASTCALL PRESERVES_REGS(b
     
    void WRITE_VDP_DATA (uint16_t data) Z88DK_FASTCALL PRESERVES_REGS(b
     
    void mode (uint8_t m) OLDCALL
     
    uint8_t get_mode () OLDCALL
     
    void set_interrupts (uint8_t flags) __z88dk_fastcall
     
    void remove_VBL (int_handler h) __z88dk_fastcall __preserves_regs(iyh
     
    void remove_LCD (int_handler h) __z88dk_fastcall __preserves_regs(b
     
    void remove_TIM (int_handler h) __z88dk_fastcall
     
    void remove_SIO (int_handler h) __z88dk_fastcall
     
    void remove_JOY (int_handler h) __z88dk_fastcall
     
    void add_VBL (int_handler h) __z88dk_fastcall __preserves_regs(d
     
    void add_LCD (int_handler h) __z88dk_fastcall __preserves_regs(b
     
    void add_TIM (int_handler h) __z88dk_fastcall
     
    void add_SIO (int_handler h) __z88dk_fastcall
     
    void add_JOY (int_handler h) __z88dk_fastcall
     
    void set_interrupts (uint8_t flags) Z88DK_FASTCALL
     
    void remove_VBL (int_handler h) Z88DK_FASTCALL PRESERVES_REGS(iyh
     
    void remove_LCD (int_handler h) Z88DK_FASTCALL PRESERVES_REGS(b
     
    void remove_TIM (int_handler h) Z88DK_FASTCALL
     
    void remove_SIO (int_handler h) Z88DK_FASTCALL
     
    void remove_JOY (int_handler h) Z88DK_FASTCALL
     
    void add_VBL (int_handler h) Z88DK_FASTCALL PRESERVES_REGS(d
     
    void add_LCD (int_handler h) Z88DK_FASTCALL PRESERVES_REGS(b
     
    void add_TIM (int_handler h) Z88DK_FASTCALL
     
    void add_SIO (int_handler h) Z88DK_FASTCALL
     
    void add_JOY (int_handler h) Z88DK_FASTCALL
     
    uint8_t cancel_pending_interrupts ()
     
    void move_bkg (uint8_t x, uint8_t y)
     
    void scroll_bkg (int8_t x, int8_t y)
     
    void wait_vbl_done () __preserves_regs(b
     
    void wait_vbl_done () PRESERVES_REGS(b
     
    void display_off ()
     
    void refresh_OAM ()
     
    void delay (uint16_t d) __z88dk_fastcall
     
    uint8_t joypad () OLDCALL __preserves_regs(b
     
    uint8_t waitpad (uint8_t mask) __z88dk_fastcall __preserves_regs(b
     
    void waitpadup () __preserves_regs(b
     
    uint8_t joypad_init (uint8_t npads, joypads_t *joypads) __z88dk_callee
     
    void joypad_ex (joypads_t *joypads) __z88dk_fastcall __preserves_regs(iyh
     
    void delay (uint16_t d) Z88DK_FASTCALL
     
    uint8_t joypad () OLDCALL PRESERVES_REGS(b
     
    uint8_t waitpad (uint8_t mask) Z88DK_FASTCALL PRESERVES_REGS(b
     
    void waitpadup () PRESERVES_REGS(b
     
    uint8_t joypad_init (uint8_t npads, joypads_t *joypads) Z88DK_CALLEE
     
    void joypad_ex (joypads_t *joypads) Z88DK_FASTCALL PRESERVES_REGS(iyh
     
    void set_default_palette ()
     
    void cpu_fast ()
     
    void set_palette_entry (uint8_t palette, uint8_t entry, uint16_t rgb_data) __z88dk_callee __preserves_regs(iyh
     
    void set_palette (uint8_t first_palette, uint8_t nb_palettes, palette_color_t *rgb_data) __z88dk_callee
     
    void set_native_tile_data (uint16_t start, uint16_t ntiles, const void *src) __z88dk_callee __preserves_regs(iyh
     
    void set_palette_entry (uint8_t palette, uint8_t entry, uint16_t rgb_data) Z88DK_CALLEE PRESERVES_REGS(iyh
     
    void set_palette (uint8_t first_palette, uint8_t nb_palettes, palette_color_t *rgb_data) Z88DK_CALLEE
     
    void set_native_tile_data (uint16_t start, uint16_t ntiles, const void *src) Z88DK_CALLEE PRESERVES_REGS(iyh
     
    void set_bkg_4bpp_data (uint16_t start, uint16_t ntiles, const void *src)
     
    void set_sprite_4bpp_data (uint16_t start, uint16_t ntiles, const void *src)
     
    void set_2bpp_palette (uint16_t palette)
     
    void set_tile_2bpp_data (uint16_t start, uint16_t ntiles, const void *src, uint16_t palette) __z88dk_callee __preserves_regs(iyh
     
    void set_tile_2bpp_data (uint16_t start, uint16_t ntiles, const void *src, uint16_t palette) Z88DK_CALLEE PRESERVES_REGS(iyh
     
    void set_bkg_data (uint16_t start, uint16_t ntiles, const void *src)
     
    void set_sprite_data (uint16_t start, uint16_t ntiles, const void *src)
     
    void set_1bpp_colors (uint8_t fgcolor, uint8_t bgcolor)
     
    void set_tile_1bpp_data (uint16_t start, uint16_t ntiles, const void *src, uint16_t colors) __z88dk_callee __preserves_regs(iyh
     
    void set_tile_1bpp_data (uint16_t start, uint16_t ntiles, const void *src, uint16_t colors) Z88DK_CALLEE PRESERVES_REGS(iyh
     
    void set_bkg_1bpp_data (uint16_t start, uint16_t ntiles, const void *src)
     
    void set_sprite_1bpp_data (uint16_t start, uint16_t ntiles, const void *src)
     
    void set_data (uint16_t dst, const void *src, uint16_t size) __z88dk_callee __preserves_regs(iyh
     
    void vmemcpy (uint16_t dst, const void *src, uint16_t size) __z88dk_callee __preserves_regs(iyh
     
    void set_tile_map (uint8_t x, uint8_t y, uint8_t w, uint8_t h, const uint8_t *tiles) __z88dk_callee __preserves_regs(iyh
     
    void set_tile_map_compat (uint8_t x, uint8_t y, uint8_t w, uint8_t h, const uint8_t *tiles) __z88dk_callee __preserves_regs(iyh
     
    void set_tile_submap (uint8_t x, uint8_t y, uint8_t w, uint8_t h, uint8_t map_w, const uint8_t *map) __z88dk_callee __preserves_regs(iyh
     
    void set_tile_submap_compat (uint8_t x, uint8_t y, uint8_t w, uint8_t h, uint8_t map_w, const uint8_t *map) __z88dk_callee __preserves_regs(iyh
     
    void set_data (uint16_t dst, const void *src, uint16_t size) Z88DK_CALLEE PRESERVES_REGS(iyh
     
    void vmemcpy (uint16_t dst, const void *src, uint16_t size) Z88DK_CALLEE PRESERVES_REGS(iyh
     
    void set_tile_map (uint8_t x, uint8_t y, uint8_t w, uint8_t h, const uint8_t *tiles) Z88DK_CALLEE PRESERVES_REGS(iyh
     
    void set_tile_map_compat (uint8_t x, uint8_t y, uint8_t w, uint8_t h, const uint8_t *tiles) Z88DK_CALLEE PRESERVES_REGS(iyh
     
    void set_bkg_based_tiles (uint8_t x, uint8_t y, uint8_t w, uint8_t h, const uint8_t *tiles, uint8_t base_tile)
     
    void set_win_based_tiles (uint8_t x, uint8_t y, uint8_t w, uint8_t h, const uint8_t *tiles, uint8_t base_tile)
     
    void set_tile_submap (uint8_t x, uint8_t y, uint8_t w, uint8_t h, uint8_t map_w, const uint8_t *map) Z88DK_CALLEE PRESERVES_REGS(iyh
     
    void set_tile_submap_compat (uint8_t x, uint8_t y, uint8_t w, uint8_t h, uint8_t map_w, const uint8_t *map) Z88DK_CALLEE PRESERVES_REGS(iyh
     
    void set_bkg_submap (uint8_t x, uint8_t y, uint8_t w, uint8_t h, const uint8_t *map, uint8_t map_w)
     
    void set_win_submap (uint8_t x, uint8_t y, uint8_t w, uint8_t h, const uint8_t *map, uint8_t map_w)
     
    void fill_rect (uint8_t x, uint8_t y, uint8_t w, uint8_t h, const uint16_t tile) __z88dk_callee __preserves_regs(iyh
     
    void fill_rect_compat (uint8_t x, uint8_t y, uint8_t w, uint8_t h, const uint16_t tile) __z88dk_callee __preserves_regs(iyh
     
    void set_bkg_based_submap (uint8_t x, uint8_t y, uint8_t w, uint8_t h, const uint8_t *map, uint8_t map_w, uint8_t base_tile)
     
    void set_win_based_submap (uint8_t x, uint8_t y, uint8_t w, uint8_t h, const uint8_t *map, uint8_t map_w, uint8_t base_tile)
     
    void fill_rect (uint8_t x, uint8_t y, uint8_t w, uint8_t h, const uint16_t tile) Z88DK_CALLEE PRESERVES_REGS(iyh
     
    void fill_rect_compat (uint8_t x, uint8_t y, uint8_t w, uint8_t h, const uint16_t tile) Z88DK_CALLEE PRESERVES_REGS(iyh
     
    void SET_SHADOW_OAM_ADDRESS (void *address)
     
    void set_sprite_tile (uint8_t nb, uint8_t tile)
     
    void hide_sprite (uint8_t nb)
     
    void set_vram_byte (uint8_t *addr, uint8_t v) __z88dk_callee __preserves_regs(iyh
     
    uint8_tset_attributed_tile_xy (uint8_t x, uint8_t y, uint16_t t) __z88dk_callee __preserves_regs(iyh
     
    uint8_tset_tile_xy (uint8_t x, uint8_t y, uint8_t t) __z88dk_callee __preserves_regs(iyh
     
    uint8_tget_bkg_xy_addr (uint8_t x, uint8_t y) __z88dk_callee __preserves_regs(iyh
     
    void set_vram_byte (uint8_t *addr, uint8_t v) Z88DK_CALLEE PRESERVES_REGS(iyh
     
    uint8_tset_attributed_tile_xy (uint8_t x, uint8_t y, uint16_t t) Z88DK_CALLEE PRESERVES_REGS(iyh
     
    uint8_tset_tile_xy (uint8_t x, uint8_t y, uint8_t t) Z88DK_CALLEE PRESERVES_REGS(iyh
     
    uint8_tget_bkg_xy_addr (uint8_t x, uint8_t y) Z88DK_CALLEE PRESERVES_REGS(iyh
     
    @@ -410,6 +419,10 @@ Variables + + + + @@ -460,8 +473,8 @@ Variables

    Variables

     
    uint16_t _current_1bpp_colors
     
    uint8_t _map_tile_offset
     
    uint8_t _submap_tile_offset
     
    volatile uint8_t shadow_OAM []
     
    volatile uint8_t _shadow_OAM_base

    Joypad bits. A logical OR of these is used in the wait_pad and joypad functions. For example, to see if the B button is pressed try

    -

    uint8_t keys; keys = joypad(); if (keys & J_B) { ... }

    -
    See also
    joypad
    +

    uint8_t keys; keys = joypad(); if (keys & J_B) { ... }

    +
    See also
    joypad
    @@ -728,9 +741,9 @@ Variables

    VBlank Interrupt occurs at the start of the vertical blank.

    -

    During this period the video ram may be freely accessed.

    See also
    set_interrupts(),
    +

    During this period the video ram may be freely accessed.

    See also
    set_interrupts(),
    -add_VBL
    +add_VBL
    @@ -745,9 +758,9 @@ Variables
    -

    LCD Interrupt when triggered by the STAT register.

    See also
    set_interrupts(),
    +

    LCD Interrupt when triggered by the STAT register.

    See also
    set_interrupts(),
    -add_LCD
    +add_LCD
    @@ -1322,7 +1335,7 @@ Variables
    - +
    #define set_bkg_palette_entry   set_palette_entry#define set_bkg_palette_entry   set_palette_entry
    @@ -1356,7 +1369,7 @@ Variables ) -    set_palette_entry(1,entry,rgb_data) +    set_palette_entry(1,entry,rgb_data)
    @@ -1370,7 +1383,7 @@ Variables
    - +
    #define set_bkg_palette   set_palette#define set_bkg_palette   set_palette
    @@ -1404,7 +1417,7 @@ Variables ) -    set_palette(1,1,rgb_data) +    set_palette(1,1,rgb_data)
    @@ -1458,7 +1471,7 @@ Variables
    - +
    #define set_bkg_tiles   set_tile_map_compat#define set_bkg_tiles   set_tile_map_compat
    @@ -1472,7 +1485,7 @@ Variables
    - +
    #define set_win_tiles   set_tile_map_compat#define set_win_tiles   set_tile_map_compat
    @@ -1486,7 +1499,7 @@ Variables
    - +
    #define fill_bkg_rect   fill_rect_compat#define fill_bkg_rect   fill_rect_compat
    @@ -1500,7 +1513,7 @@ Variables
    - +
    #define fill_win_rect   fill_rect_compat#define fill_win_rect   fill_rect_compat
    @@ -1559,7 +1572,7 @@ Variables
    - +
    #define set_bkg_tile_xy   set_tile_xy#define set_bkg_tile_xy   set_tile_xy
    @@ -1573,7 +1586,7 @@ Variables
    - +
    #define set_win_tile_xy   set_tile_xy#define set_win_tile_xy   set_tile_xy
    @@ -1587,7 +1600,7 @@ Variables
    - +
    #define get_win_xy_addr   get_bkg_xy_addr#define get_win_xy_addr   get_bkg_xy_addr
    @@ -1602,7 +1615,7 @@ Variables
    - +
    typedef void(* int_handler) (void) NONBANKEDtypedef void(* int_handler) (void) NONBANKED
    @@ -1611,8 +1624,8 @@ Variables

    Function Documentation

    - -

    ◆ WRITE_VDP_CMD()

    + +

    ◆ WRITE_VDP_CMD()

    @@ -1629,8 +1642,8 @@ Variables
    - -

    ◆ WRITE_VDP_DATA()

    + +

    ◆ WRITE_VDP_DATA()

    @@ -1689,8 +1702,8 @@ Variables
    - -

    ◆ set_interrupts()

    + +

    ◆ set_interrupts()

    @@ -1706,18 +1719,19 @@ Variables

    Clears any pending interrupts and sets the interrupt mask register IO to flags.

    Parameters
    - +
    flagsA logical OR of *_IFLAGS
    flagsA logical OR of *_IFLAGS
    -
    See also
    enable_interrupts(), disable_interrupts()
    +
    Note
    : This disables and then re-enables interrupts so it must be used outside of a critical section.
    +
    See also
    enable_interrupts(), disable_interrupts()
    VBL_IFLAG, LCD_IFLAG, TIM_IFLAG, SIO_IFLAG, JOY_IFLAG
    - -

    ◆ remove_VBL()

    + +

    ◆ remove_VBL()

    @@ -1731,12 +1745,12 @@ Variables
    -

    Removes the VBL interrupt handler.

    See also
    add_VBL()
    +

    Removes the VBL interrupt handler.

    See also
    add_VBL()
    - -

    ◆ remove_LCD()

    + +

    ◆ remove_LCD()

    @@ -1750,12 +1764,12 @@ Variables
    -

    Removes the LCD interrupt handler.

    See also
    add_LCD(), remove_VBL()
    +

    Removes the LCD interrupt handler.

    See also
    add_LCD(), remove_VBL()
    - -

    ◆ remove_TIM()

    + +

    ◆ remove_TIM()

    @@ -1772,8 +1786,8 @@ Variables
    - -

    ◆ remove_SIO()

    + +

    ◆ remove_SIO()

    @@ -1790,8 +1804,8 @@ Variables
    - -

    ◆ remove_JOY()

    + +

    ◆ remove_JOY()

    @@ -1808,8 +1822,8 @@ Variables
    - -

    ◆ add_VBL()

    + +

    ◆ add_VBL()

    @@ -1827,8 +1841,8 @@ Variables
    - -

    ◆ add_LCD()

    + +

    ◆ add_LCD()

    @@ -1846,8 +1860,8 @@ Variables
    - -

    ◆ add_TIM()

    + +

    ◆ add_TIM()

    @@ -1865,8 +1879,8 @@ Variables
    - -

    ◆ add_SIO()

    + +

    ◆ add_SIO()

    @@ -1884,8 +1898,8 @@ Variables
    - -

    ◆ add_JOY()

    + +

    ◆ add_JOY()

    @@ -2001,8 +2015,8 @@ Variables
    - -

    ◆ wait_vbl_done()

    + +

    ◆ wait_vbl_done()

    @@ -2066,8 +2080,8 @@ Variables
    - -

    ◆ delay()

    + +

    ◆ delay()

    @@ -2085,8 +2099,8 @@ Variables
    - -

    ◆ joypad()

    + +

    ◆ joypad()

    @@ -2103,8 +2117,8 @@ Variables
    - -

    ◆ waitpad()

    + +

    ◆ waitpad()

    @@ -2122,8 +2136,8 @@ Variables
    - -

    ◆ waitpadup()

    + +

    ◆ waitpadup()

    @@ -2141,8 +2155,8 @@ Variables
    - -

    ◆ joypad_init()

    + +

    ◆ joypad_init()

    @@ -2173,13 +2187,13 @@ Variables -

    Only required for joypad_ex, not required for calls to regular joypad()

    Returns
    number of joypads avaliable
    -
    See also
    joypad_ex(), joypads_t
    +

    Only required for joypad_ex, not required for calls to regular joypad()

    Returns
    number of joypads avaliable
    +
    See also
    joypad_ex(), joypads_t
    - -

    ◆ joypad_ex()

    + +

    ◆ joypad_ex()

    @@ -2195,11 +2209,11 @@ Variables

    Polls all avaliable joypads

    Parameters
    - +
    joypadspointer to joypads_t structure to be filled with joypad statuses, must be previously initialized with joypad_init()
    joypadspointer to joypads_t structure to be filled with joypad statuses, must be previously initialized with joypad_init()
    -
    See also
    joypad_init(), joypads_t
    +
    See also
    joypad_init(), joypads_t
    @@ -2252,8 +2266,8 @@ Variables
    - -

    ◆ set_palette_entry()

    + +

    ◆ set_palette_entry()

    @@ -2286,8 +2300,8 @@ Variables
    - -

    ◆ set_palette()

    + +

    ◆ set_palette()

    @@ -2320,8 +2334,8 @@ Variables
    - -

    ◆ set_native_tile_data()

    + +

    ◆ set_native_tile_data()

    @@ -2464,8 +2478,8 @@ Variables
    - -

    ◆ set_tile_2bpp_data()

    + +

    ◆ set_tile_2bpp_data()

    @@ -2708,8 +2722,8 @@ Variables
    - -

    ◆ set_tile_1bpp_data()

    + +

    ◆ set_tile_1bpp_data()

    @@ -2832,8 +2846,8 @@ Variables
    - -

    ◆ set_data()

    + +

    ◆ set_data()

    @@ -2876,8 +2890,8 @@ Variables
    - -

    ◆ vmemcpy()

    + +

    ◆ vmemcpy()

    @@ -2910,8 +2924,8 @@ Variables
    - -

    ◆ set_tile_map()

    + +

    ◆ set_tile_map()

    @@ -2956,8 +2970,8 @@ Variables
    - -

    ◆ set_tile_map_compat()

    + +

    ◆ set_tile_map_compat()

    @@ -3002,8 +3016,128 @@ Variables
    - -

    ◆ set_tile_submap()

    + +

    ◆ set_bkg_based_tiles()

    + +
    +
    + + + + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void set_bkg_based_tiles (uint8_t x,
    uint8_t y,
    uint8_t w,
    uint8_t h,
    const uint8_ttiles,
    uint8_t base_tile 
    )
    +
    +inline
    +
    + +
    +
    + +

    ◆ set_win_based_tiles()

    + +
    +
    + + + + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void set_win_based_tiles (uint8_t x,
    uint8_t y,
    uint8_t w,
    uint8_t h,
    const uint8_ttiles,
    uint8_t base_tile 
    )
    +
    +inline
    +
    + +
    +
    + +

    ◆ set_tile_submap()

    @@ -3054,8 +3188,8 @@ Variables
    - -

    ◆ set_tile_submap_compat()

    + +

    ◆ set_tile_submap_compat()

    @@ -3176,13 +3310,13 @@ Variables

    Entries are copied from map to the Background Tile Map starting at x, y writing across for w tiles and down for h tiles, using map_w as the rowstride for the source tile map.

    -

    Use this instead of set_bkg_tiles when the source map is wider than 32 tiles or when writing a width that does not match the source map width.

    +

    Use this instead of set_bkg_tiles when the source map is wider than 32 tiles or when writing a width that does not match the source map width.

    One byte per source tile map entry.

    Writes that exceed coordinate 31 on the x or y axis will wrap around to the Left and Top edges.

    -

    See set_bkg_tiles for setting CGB attribute maps with VBK_REG.

    +

    See set_bkg_tiles for setting CGB attribute maps with VBK_REG.

    See also
    SHOW_BKG
    -set_bkg_data, set_bkg_tiles, set_win_submap, set_tiles
    +set_bkg_data, set_bkg_tiles, set_win_submap, set_tiles
    @@ -3256,20 +3390,152 @@ Variables

    Entries are copied from map to the Window Tile Map starting at x, y writing across for w tiles and down for h tiles, using map_w as the rowstride for the source tile map.

    -

    Use this instead of set_win_tiles when the source map is wider than 32 tiles or when writing a width that does not match the source map width.

    +

    Use this instead of set_win_tiles when the source map is wider than 32 tiles or when writing a width that does not match the source map width.

    One byte per source tile map entry.

    Writes that exceed coordinate 31 on the x or y axis will wrap around to the Left and Top edges.

    GBC only: VBK_REG determines whether Tile Numbers or Tile Attributes get set.

    • VBK_REG=0 Tile Numbers are written
    • VBK_REG=1 Tile Attributes are written
    -

    See set_bkg_tiles for details about CGB attribute maps with VBK_REG.

    -
    See also
    SHOW_WIN, HIDE_WIN, set_win_tiles, set_bkg_submap, set_bkg_tiles, set_bkg_data, set_tiles
    +

    See set_bkg_tiles for details about CGB attribute maps with VBK_REG.

    +
    See also
    SHOW_WIN, HIDE_WIN, set_win_tiles, set_bkg_submap, set_bkg_tiles, set_bkg_data, set_tiles
    - -

    ◆ fill_rect()

    + +

    ◆ set_bkg_based_submap()

    + +
    +
    + + + + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void set_bkg_based_submap (uint8_t x,
    uint8_t y,
    uint8_t w,
    uint8_t h,
    const uint8_tmap,
    uint8_t map_w,
    uint8_t base_tile 
    )
    +
    +inline
    +
    + +
    +
    + +

    ◆ set_win_based_submap()

    + +
    +
    + + + + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void set_win_based_submap (uint8_t x,
    uint8_t y,
    uint8_t w,
    uint8_t h,
    const uint8_tmap,
    uint8_t map_w,
    uint8_t base_tile 
    )
    +
    +inline
    +
    + +
    +
    + +

    ◆ fill_rect()

    @@ -3314,8 +3580,8 @@ Variables
    - -

    ◆ fill_rect_compat()

    + +

    ◆ fill_rect_compat()

    @@ -3676,8 +3942,8 @@ Variables
    - -

    ◆ set_vram_byte()

    + +

    ◆ set_vram_byte()

    @@ -3712,8 +3978,8 @@ Variables
    - -

    ◆ set_attributed_tile_xy()

    + +

    ◆ set_attributed_tile_xy()

    @@ -3751,12 +4017,12 @@ Variables -
    Returns
    returns the address of tile, so you may use faster set_vram_byte() later
    +
    Returns
    returns the address of tile, so you may use faster set_vram_byte() later
    - -

    ◆ set_tile_xy()

    + +

    ◆ set_tile_xy()

    @@ -3794,12 +4060,12 @@ Variables -
    Returns
    returns the address of tile, so you may use faster set_vram_byte() later
    +
    Returns
    returns the address of tile, so you may use faster set_vram_byte() later
    - -

    ◆ get_bkg_xy_addr()

    + +

    ◆ get_bkg_xy_addr()

    @@ -3993,6 +4259,50 @@ Variables
    +
    +
    + +

    ◆ _map_tile_offset

    + +
    +
    + + + + + +
    + + + + +
    uint8_t _map_tile_offset
    +
    +extern
    +
    + +
    +
    + +

    ◆ _submap_tile_offset

    + +
    +
    + + + + + +
    + + + + +
    uint8_t _submap_tile_offset
    +
    +extern
    +
    +
    diff --git a/docs/api/sms_8h.js b/docs/api/sms_8h.js index 7df81e3c..b5e1c5b7 100644 --- a/docs/api/sms_8h.js +++ b/docs/api/sms_8h.js @@ -71,60 +71,64 @@ var sms_8h = [ "set_win_tile_xy", "sms_8h.html#a95d929d964d9988f4dc5a25ed399ae08", null ], [ "get_win_xy_addr", "sms_8h.html#a6eaafdbe6cf1695d30724ce75acb9412", null ], [ "int_handler", "sms_8h.html#a9508f919d9482d1d51534ccac212454d", null ], - [ "WRITE_VDP_CMD", "sms_8h.html#a4b7af81fec48ca3bee04234b417abaa6", null ], - [ "WRITE_VDP_DATA", "sms_8h.html#af513fcb34dd2aa1e9bc9bf65cb589eee", null ], + [ "WRITE_VDP_CMD", "sms_8h.html#a498b148efd22ab8ad9b844b2dc5e5bb8", null ], + [ "WRITE_VDP_DATA", "sms_8h.html#aa2ddf9662320c4a9d00fd4a94d347570", null ], [ "mode", "sms_8h.html#a3ea524204d839377cf39842eec23e202", null ], [ "get_mode", "sms_8h.html#ad9a83378f5ec1f6444c879e4cf1e1a83", null ], - [ "set_interrupts", "sms_8h.html#a46aa5fa208d6a58fe07a170db49a8849", null ], - [ "remove_VBL", "sms_8h.html#a9eeb134cad80f309ce86ab101a9e0026", null ], - [ "remove_LCD", "sms_8h.html#a0bd9fc648e26b8d494d082343f19d9ad", null ], - [ "remove_TIM", "sms_8h.html#afe6f5ff8fbb632868cb41f2a4c5995ae", null ], - [ "remove_SIO", "sms_8h.html#ab052e48d56856c376379c3a9cc686c76", null ], - [ "remove_JOY", "sms_8h.html#a10fc1ec5a17a7d25d95241db0f458eb9", null ], - [ "add_VBL", "sms_8h.html#a1828aeec4b83ef499e18ca1a5ad3b6a6", null ], - [ "add_LCD", "sms_8h.html#a99f5c1698cb6d3715690481d4e4b6da1", null ], - [ "add_TIM", "sms_8h.html#a17416b1bb39989e82948e3a97f23187f", null ], - [ "add_SIO", "sms_8h.html#adcbf35ca19c093d4565729fa7e868f5c", null ], - [ "add_JOY", "sms_8h.html#a049c5d8c901a23cccf95b02a911f9212", null ], + [ "set_interrupts", "sms_8h.html#aefda0091b2934571a11e07b512735f50", null ], + [ "remove_VBL", "sms_8h.html#a98f7ef49e1758c601979bcb0ff19a1f0", null ], + [ "remove_LCD", "sms_8h.html#aa8962b27b960bb0c8d3bb899246c690c", null ], + [ "remove_TIM", "sms_8h.html#a98785a1b0ddc91cd8e8c8fab8de1de20", null ], + [ "remove_SIO", "sms_8h.html#a98de9141f407585801fcbf55bf6dcc4c", null ], + [ "remove_JOY", "sms_8h.html#a35a3ff12ab34534b763517576afe38a6", null ], + [ "add_VBL", "sms_8h.html#ae59628e2237f301df1341e22bfc8296e", null ], + [ "add_LCD", "sms_8h.html#a51add93356a25c71e8c37a73c9065c9d", null ], + [ "add_TIM", "sms_8h.html#a6c66a583a8f0744e3985c89725e3dc10", null ], + [ "add_SIO", "sms_8h.html#a3372d61a07e0466bdb909a27f3aaaca9", null ], + [ "add_JOY", "sms_8h.html#a48163816121cd669526817d3e6266fd9", null ], [ "cancel_pending_interrupts", "sms_8h.html#ade5d4c955b871b0ed884273cc2b7215a", null ], [ "move_bkg", "sms_8h.html#a6261537edc74068e3f7f057e6a3e8a57", null ], [ "scroll_bkg", "sms_8h.html#a1f583f7a880daa6145ca78b086a209d1", null ], - [ "wait_vbl_done", "sms_8h.html#a68346350199018249bdf8019b7131514", null ], + [ "wait_vbl_done", "sms_8h.html#acd186eb292d441f9389e77b545a55619", null ], [ "display_off", "sms_8h.html#a7b09691f25fddd65f12ed199b3f88ef0", null ], [ "refresh_OAM", "sms_8h.html#a7542d00af674e3c58b6c9887ab01919f", null ], - [ "delay", "sms_8h.html#aea03b5b22f0a798a7935dc7d18931924", null ], - [ "joypad", "sms_8h.html#a15f46ef3d3443b452db0c38fc33bcfc1", null ], - [ "waitpad", "sms_8h.html#aec76b4ab16315eb97846be87b19fea10", null ], - [ "waitpadup", "sms_8h.html#a35fbfcc0bffc93a47217caff66ca36a7", null ], - [ "joypad_init", "sms_8h.html#a294f858312544fa89bf17adbba51f145", null ], - [ "joypad_ex", "sms_8h.html#aec8e36355bb7381000606b1871db5977", null ], + [ "delay", "sms_8h.html#a217232c82eb5f99f7639b5786ce5abc6", null ], + [ "joypad", "sms_8h.html#a176c477d759b814664785f3a0ad5e253", null ], + [ "waitpad", "sms_8h.html#a79b565677967da5ef9bf1a00aa6776ce", null ], + [ "waitpadup", "sms_8h.html#a955d3733e5018f18b17a572aff45cf26", null ], + [ "joypad_init", "sms_8h.html#abe90cc2b5bb10c0ed9e01e548ddf8862", null ], + [ "joypad_ex", "sms_8h.html#a1d45c65829490c5ec98362f5e60edc20", null ], [ "set_default_palette", "sms_8h.html#abd34836339579013c097ae4dea10c014", null ], [ "cpu_fast", "sms_8h.html#a884a743919b234cd9c37789380784d08", null ], - [ "set_palette_entry", "sms_8h.html#a675ad64b02d33ab3274f7fb54da14fa9", null ], - [ "set_palette", "sms_8h.html#a8668e421743bcba26411acaabe1af82d", null ], - [ "set_native_tile_data", "sms_8h.html#a5e48fbbda171d4c466e1d0d96fa73b50", null ], + [ "set_palette_entry", "sms_8h.html#a2c9aabf4519e01257b0d0e04e8108164", null ], + [ "set_palette", "sms_8h.html#a92109adcc20960f26e8bc5fbb141d27e", null ], + [ "set_native_tile_data", "sms_8h.html#a24764a152441b966ea04a83278c73207", null ], [ "set_bkg_4bpp_data", "sms_8h.html#aeff13dca11be49e8c159820c616016ec", null ], [ "set_sprite_4bpp_data", "sms_8h.html#a24f53cfe7e25c04fbb5dcb08cfb3b432", null ], [ "set_2bpp_palette", "sms_8h.html#aa224c9bac27c7fd268e62bdf33338a84", null ], - [ "set_tile_2bpp_data", "sms_8h.html#a30e9f94cf4e5cf198bc54ce1e0ac5979", null ], + [ "set_tile_2bpp_data", "sms_8h.html#ab752b1bb0f58da2a6d52e9747c4b3dd8", null ], [ "set_bkg_data", "sms_8h.html#a8130306da1177f4fef89e699f8e2add4", null ], [ "set_sprite_data", "sms_8h.html#a216a3e3d320ee4d8cf4845600487ae39", null ], [ "set_bkg_2bpp_data", "sms_8h.html#aa7ba76e4d44dbf19da351fd1ea8e3023", null ], [ "set_sprite_2bpp_data", "sms_8h.html#a10ee2919fcab7a5c482816ed718d1c4a", null ], [ "set_1bpp_colors", "sms_8h.html#adcb394299a1033616fc7d2faec8bd6ad", null ], - [ "set_tile_1bpp_data", "sms_8h.html#a6afae83728b6651075f0af9d55d4b9e0", null ], + [ "set_tile_1bpp_data", "sms_8h.html#a747033606e041b45ae09b38fdb06b871", null ], [ "set_bkg_1bpp_data", "sms_8h.html#a4d5f74eed0489ebfdc2410ee3f9f7f04", null ], [ "set_sprite_1bpp_data", "sms_8h.html#a2cc121fbeb5570248531b85a8f0b5b97", null ], - [ "set_data", "sms_8h.html#abe8c12f4c6675b2c671fe8ab32370533", null ], - [ "vmemcpy", "sms_8h.html#aee5c510efbda6e44f987088aa14d3482", null ], - [ "set_tile_map", "sms_8h.html#ad68f2f36b41febcc5f8ca23c3e379ec8", null ], - [ "set_tile_map_compat", "sms_8h.html#a6a9877d413f96540712d408d865625c9", null ], - [ "set_tile_submap", "sms_8h.html#ad7bf6d9629c0ee4e83c137a297aac169", null ], - [ "set_tile_submap_compat", "sms_8h.html#a35261bb6911ba7a123262efc32f4955a", null ], + [ "set_data", "sms_8h.html#a8fe17423c7ef7c44f1ccff27d3afbebc", null ], + [ "vmemcpy", "sms_8h.html#a33a749b14dfbd203c460e8d7f3500636", null ], + [ "set_tile_map", "sms_8h.html#a14fc41e69085b5aa3da2fae9a2aa3ef3", null ], + [ "set_tile_map_compat", "sms_8h.html#a7c38b146f77eda84981c06c2271fe116", null ], + [ "set_bkg_based_tiles", "sms_8h.html#a811c386cac0df2d260aacb5a43608be5", null ], + [ "set_win_based_tiles", "sms_8h.html#a739a212609ae60c9c56c095f96b4ea80", null ], + [ "set_tile_submap", "sms_8h.html#a84774e034fe0e70af62bd17ac716ba34", null ], + [ "set_tile_submap_compat", "sms_8h.html#aba0308b5e8e154cc920f041a185ac770", null ], [ "set_bkg_submap", "sms_8h.html#a0cfd261bc7a94b1f6093f423bad30298", null ], [ "set_win_submap", "sms_8h.html#abb50a392ca0d0419a080413287ee5d79", null ], - [ "fill_rect", "sms_8h.html#ab380f3a45e943a45a4cd3189a99ca4df", null ], - [ "fill_rect_compat", "sms_8h.html#aac998cb7f78186158ced5448dcfc3503", null ], + [ "set_bkg_based_submap", "sms_8h.html#abc8bc5808620a9717263b8c9ec2237f0", null ], + [ "set_win_based_submap", "sms_8h.html#a1b8a1026983cb2b2c0bd46334b4692a0", null ], + [ "fill_rect", "sms_8h.html#aba932d128338fb19644842565139a20d", null ], + [ "fill_rect_compat", "sms_8h.html#af2fc27409f907cfae9583b5ebf0c5ea8", null ], [ "SET_SHADOW_OAM_ADDRESS", "sms_8h.html#a7e0cdfd6b9a2ae1b7f30384f132d8687", null ], [ "set_sprite_tile", "sms_8h.html#a05bf0b9f1328de7b568a19a2a428bcfe", null ], [ "get_sprite_tile", "sms_8h.html#af5c0beff7d7a7d8641b51fd95c811b2a", null ], @@ -133,10 +137,10 @@ var sms_8h = [ "move_sprite", "sms_8h.html#ab42c12c1d9aed3fd963248fbea9830cd", null ], [ "scroll_sprite", "sms_8h.html#a6c59aa9a4f9ea42bed6ca6940b2741fe", null ], [ "hide_sprite", "sms_8h.html#ad22c51635d052399bbbe1777999c794d", null ], - [ "set_vram_byte", "sms_8h.html#a18ce02bf91fd93098176b5bcc94cdf4a", null ], - [ "set_attributed_tile_xy", "sms_8h.html#a968487c6f70c9e15de7af0efc0de0548", null ], - [ "set_tile_xy", "sms_8h.html#a256029356b8bc719e42ffafba844290f", null ], - [ "get_bkg_xy_addr", "sms_8h.html#af83d7fd4e4044ac6677f046f679bd7a9", null ], + [ "set_vram_byte", "sms_8h.html#afe1bc7117a68cd0939c2d03baaa06b89", null ], + [ "set_attributed_tile_xy", "sms_8h.html#a476f433ea736a1dd610490238f2a6250", null ], + [ "set_tile_xy", "sms_8h.html#a5834057f6297c0fa8f8e9a6b714f1ff7", null ], + [ "get_bkg_xy_addr", "sms_8h.html#a66b4bfb8c1ea3005ff01ce040a778e63", null ], [ "c", "sms_8h.html#a0b3366755f3276b0243c1e0497471b7a", null ], [ "d", "sms_8h.html#a0a3d95ad0ab8ad213016101d2e9c3d3e", null ], [ "e", "sms_8h.html#aeda4515a31485c9688c4601ac5ce2d79", null ], @@ -147,6 +151,8 @@ var sms_8h = [ "sys_time", "sms_8h.html#a78d2fd18666afec116f176d46debb4e7", null ], [ "_current_2bpp_palette", "sms_8h.html#a22dc57e538f0f49e2dc7d1c73f67fc8f", null ], [ "_current_1bpp_colors", "sms_8h.html#a250f5339e05523912926be566e9eb8c0", null ], + [ "_map_tile_offset", "sms_8h.html#aa82205e9629f984d0b3dc8055c211522", null ], + [ "_submap_tile_offset", "sms_8h.html#ab472d9bbb1bcfd141374f5babc71934c", null ], [ "shadow_OAM", "sms_8h.html#af02f9e73bd894cc25e03aedb0a10a91d", null ], [ "_shadow_OAM_base", "sms_8h.html#a5435fd985412934e96a490e103c6bc49", null ], [ "_shadow_OAM_OFF", "sms_8h.html#a388d1dff2698172ba8574e43f5c77c93", null ] diff --git a/docs/api/sms_8h_source.html b/docs/api/sms_8h_source.html index c886ba8e..eb37d462 100644 --- a/docs/api/sms_8h_source.html +++ b/docs/api/sms_8h_source.html @@ -29,6 +29,7 @@
    GBDK 2020 Docs +  4.0.6
    API Documentation for GBDK 2020
    @@ -144,8 +145,8 @@ $(document).ready(function(){initNavTree('sms_8h_source.html',''); initResizable
    83 #define __WRITE_VDP_REG(REG, v) shadow_##REG=(v);__critical{VDP_CMD=(shadow_##REG),VDP_CMD=REG;}
    84 #define __READ_VDP_REG(REG) shadow_##REG
    85 
    -
    86 void WRITE_VDP_CMD(uint16_t cmd) __z88dk_fastcall __preserves_regs(b, c, d, e, iyh, iyl);
    -
    87 void WRITE_VDP_DATA(uint16_t data) __z88dk_fastcall __preserves_regs(b, c, d, e, iyh, iyl);
    + +
    88 
    96 
    @@ -164,7 +165,7 @@ $(document).ready(function(){initNavTree('sms_8h_source.html',''); initResizable
    123 
    125 #define JOY_IFLAG 0x10U
    126 
    -
    127 void set_interrupts(uint8_t flags) __z88dk_fastcall;
    +
    128 
    129 /* Limits */
    132 #define SCREENWIDTH DEVICE_SCREEN_PX_WIDTH
    @@ -180,25 +181,25 @@ $(document).ready(function(){initNavTree('sms_8h_source.html',''); initResizable
    147 #define MAXWNDPOSY 0x00U
    148 
    149 
    -
    152 typedef void (*int_handler)(void) NONBANKED;
    +
    152 typedef void (*int_handler)(void) NONBANKED;
    153 
    -
    157 void remove_VBL(int_handler h) __z88dk_fastcall __preserves_regs(iyh, iyl);
    +
    158 
    -
    162 void remove_LCD(int_handler h) __z88dk_fastcall __preserves_regs(b, c, iyh, iyl);
    +
    163 
    -
    164 void remove_TIM(int_handler h) __z88dk_fastcall;
    -
    165 void remove_SIO(int_handler h) __z88dk_fastcall;
    -
    166 void remove_JOY(int_handler h) __z88dk_fastcall;
    + + +
    167 
    -
    170 void add_VBL(int_handler h) __z88dk_fastcall __preserves_regs(d, e, iyh, iyl);
    +
    171 
    -
    174 void add_LCD(int_handler h) __z88dk_fastcall __preserves_regs(b, c, iyh, iyl);
    +
    175 
    -
    178 void add_TIM(int_handler h) __z88dk_fastcall;
    +
    179 
    -
    182 void add_SIO(int_handler h) __z88dk_fastcall;
    +
    183 
    -
    186 void add_JOY(int_handler h) __z88dk_fastcall;
    +
    187 
    191  return VDP_STATUS;
    @@ -215,7 +216,7 @@ $(document).ready(function(){initNavTree('sms_8h_source.html',''); initResizable
    202  __WRITE_VDP_REG(VDP_RSCY, (tmp < 0) ? 224 + tmp : tmp % 224u);
    203 }
    204 
    -
    215 void wait_vbl_done() __preserves_regs(b, c, d, e, h, l, iyh, iyl);
    +
    216 
    221 inline void display_off() {
    @@ -287,14 +288,14 @@ $(document).ready(function(){initNavTree('sms_8h_source.html',''); initResizable
    383 #define DISABLE_RAM RAM_CONTROL&=(~RAMCTL_RAM)
    384 
    385 
    -
    390 void delay(uint16_t d) __z88dk_fastcall;
    +
    391 
    392 
    -
    395 uint8_t joypad() OLDCALL __preserves_regs(b, c, d, e, h, iyh, iyl);
    +
    396 
    -
    399 uint8_t waitpad(uint8_t mask) __z88dk_fastcall __preserves_regs(b, c, d, e, iyh, iyl);
    +
    400 
    -
    406 void waitpadup() __preserves_regs(b, c, d, e, iyh, iyl);
    +
    407 
    413 typedef struct {
    414  uint8_t npads;
    @@ -306,9 +307,9 @@ $(document).ready(function(){initNavTree('sms_8h_source.html',''); initResizable
    420  };
    421 } joypads_t;
    422 
    -
    431 uint8_t joypad_init(uint8_t npads, joypads_t * joypads) __z88dk_callee;
    +
    432 
    -
    439 void joypad_ex(joypads_t * joypads) __z88dk_fastcall __preserves_regs(iyh, iyl);
    +
    440 
    441 
    442 #if defined(__TARGET_sms)
    @@ -373,19 +374,19 @@ $(document).ready(function(){initNavTree('sms_8h_source.html',''); initResizable
    506 inline void cpu_fast() {}
    507 
    -
    508 void set_palette_entry(uint8_t palette, uint8_t entry, uint16_t rgb_data) __z88dk_callee __preserves_regs(iyh, iyl);
    +
    509 #define set_bkg_palette_entry set_palette_entry
    510 #define set_sprite_palette_entry(palette,entry,rgb_data) set_palette_entry(1,entry,rgb_data)
    -
    511 void set_palette(uint8_t first_palette, uint8_t nb_palettes, palette_color_t *rgb_data) __z88dk_callee;
    +
    511 void set_palette(uint8_t first_palette, uint8_t nb_palettes, palette_color_t *rgb_data) Z88DK_CALLEE;
    512 #define set_bkg_palette set_palette
    513 #define set_sprite_palette(first_palette,nb_palettes,rgb_data) set_palette(1,1,rgb_data)
    514 
    -
    515 void set_native_tile_data(uint16_t start, uint16_t ntiles, const void *src) __z88dk_callee __preserves_regs(iyh,iyl);
    +
    515 void set_native_tile_data(uint16_t start, uint16_t ntiles, const void *src) Z88DK_CALLEE PRESERVES_REGS(iyh, iyl);
    516 inline void set_bkg_4bpp_data(uint16_t start, uint16_t ntiles, const void *src) {
    -
    517  set_native_tile_data(start, ntiles, src);
    +
    517  set_native_tile_data(start, ntiles, src);
    518 }
    519 inline void set_sprite_4bpp_data(uint16_t start, uint16_t ntiles, const void *src) {
    -
    520  set_native_tile_data((uint8_t)(start) + 0x100u, ntiles, src);
    +
    520  set_native_tile_data((uint8_t)(start) + 0x100u, ntiles, src);
    521 }
    522 
    523 #define COMPAT_PALETTE(C0,C1,C2,C3) (((uint16_t)(C3) << 12) | ((uint16_t)(C2) << 8) | ((uint16_t)(C1) << 4) | (uint16_t)(C0))
    @@ -393,221 +394,254 @@ $(document).ready(function(){initNavTree('sms_8h_source.html',''); initResizable
    525 inline void set_2bpp_palette(uint16_t palette) {
    526  _current_2bpp_palette = palette;
    527 }
    -
    528 void set_tile_2bpp_data(uint16_t start, uint16_t ntiles, const void *src, uint16_t palette) __z88dk_callee __preserves_regs(iyh,iyl);
    +
    528 void set_tile_2bpp_data(uint16_t start, uint16_t ntiles, const void *src, uint16_t palette) Z88DK_CALLEE PRESERVES_REGS(iyh, iyl);
    529 inline void set_bkg_data(uint16_t start, uint16_t ntiles, const void *src) {
    -
    530  set_tile_2bpp_data(start, ntiles, src, _current_2bpp_palette);
    +
    530  set_tile_2bpp_data(start, ntiles, src, _current_2bpp_palette);
    531 }
    532 inline void set_sprite_data(uint16_t start, uint16_t ntiles, const void *src) {
    -
    533  set_tile_2bpp_data((uint8_t)(start) + 0x100u, ntiles, src, _current_2bpp_palette);
    +
    533  set_tile_2bpp_data((uint8_t)(start) + 0x100u, ntiles, src, _current_2bpp_palette);
    534 }
    535 inline void set_bkg_2bpp_data(uint16_t start, uint16_t ntiles, const void *src) {
    -
    536  set_tile_2bpp_data(start, ntiles, src, _current_2bpp_palette);
    +
    536  set_tile_2bpp_data(start, ntiles, src, _current_2bpp_palette);
    537 }
    538 inline void set_sprite_2bpp_data(uint16_t start, uint16_t ntiles, const void *src) {
    -
    539  set_tile_2bpp_data((uint8_t)(start) + 0x100u, ntiles, src, _current_2bpp_palette);
    +
    539  set_tile_2bpp_data((uint8_t)(start) + 0x100u, ntiles, src, _current_2bpp_palette);
    540 }
    541 
    543 inline void set_1bpp_colors(uint8_t fgcolor, uint8_t bgcolor) {
    544  _current_1bpp_colors = ((uint16_t)bgcolor << 8) | fgcolor;
    545 }
    -
    546 void set_tile_1bpp_data(uint16_t start, uint16_t ntiles, const void *src, uint16_t colors) __z88dk_callee __preserves_regs(iyh,iyl);
    +
    546 void set_tile_1bpp_data(uint16_t start, uint16_t ntiles, const void *src, uint16_t colors) Z88DK_CALLEE PRESERVES_REGS(iyh, iyl);
    547 inline void set_bkg_1bpp_data(uint16_t start, uint16_t ntiles, const void *src) {
    -
    548  set_tile_1bpp_data(start, ntiles, src, _current_1bpp_colors);
    +
    548  set_tile_1bpp_data(start, ntiles, src, _current_1bpp_colors);
    549 }
    550 inline void set_sprite_1bpp_data(uint16_t start, uint16_t ntiles, const void *src) {
    -
    551  set_tile_1bpp_data((uint8_t)(start) + 0x100u, ntiles, src, _current_1bpp_colors);
    +
    551  set_tile_1bpp_data((uint8_t)(start) + 0x100u, ntiles, src, _current_1bpp_colors);
    552 }
    553 
    554 
    -
    563 void set_data(uint16_t dst, const void *src, uint16_t size) __z88dk_callee __preserves_regs(iyh, iyl);
    -
    564 void vmemcpy(uint16_t dst, const void *src, uint16_t size) __z88dk_callee __preserves_regs(iyh, iyl);
    +
    563 void set_data(uint16_t dst, const void *src, uint16_t size) Z88DK_CALLEE PRESERVES_REGS(iyh, iyl);
    +
    564 void vmemcpy(uint16_t dst, const void *src, uint16_t size) Z88DK_CALLEE PRESERVES_REGS(iyh, iyl);
    565 
    -
    566 void set_tile_map(uint8_t x, uint8_t y, uint8_t w, uint8_t h, const uint8_t *tiles) __z88dk_callee __preserves_regs(iyh, iyl);
    -
    567 void set_tile_map_compat(uint8_t x, uint8_t y, uint8_t w, uint8_t h, const uint8_t *tiles) __z88dk_callee __preserves_regs(iyh, iyl);
    + +
    568 #define set_bkg_tiles set_tile_map_compat
    569 #define set_win_tiles set_tile_map_compat
    570 
    -
    571 void set_tile_submap(uint8_t x, uint8_t y, uint8_t w, uint8_t h, uint8_t map_w, const uint8_t *map) __z88dk_callee __preserves_regs(iyh, iyl);
    -
    572 void set_tile_submap_compat(uint8_t x, uint8_t y, uint8_t w, uint8_t h, uint8_t map_w, const uint8_t *map) __z88dk_callee __preserves_regs(iyh, iyl);
    -
    573 inline void set_bkg_submap(uint8_t x, uint8_t y, uint8_t w, uint8_t h, const uint8_t *map, uint8_t map_w) {
    -
    574  set_tile_submap_compat(x, y, w, h, map_w, map);
    -
    575 }
    -
    576 inline void set_win_submap(uint8_t x, uint8_t y, uint8_t w, uint8_t h, const uint8_t *map, uint8_t map_w) {
    -
    577  set_tile_submap_compat(x, y, w, h, map_w, map);
    -
    578 }
    -
    579 
    -
    580 void fill_rect(uint8_t x, uint8_t y, uint8_t w, uint8_t h, const uint16_t tile) __z88dk_callee __preserves_regs(iyh, iyl);
    -
    581 void fill_rect_compat(uint8_t x, uint8_t y, uint8_t w, uint8_t h, const uint16_t tile) __z88dk_callee __preserves_regs(iyh, iyl);
    -
    582 #define fill_bkg_rect fill_rect_compat
    -
    583 #define fill_win_rect fill_rect_compat
    -
    584 
    -
    587 extern volatile uint8_t shadow_OAM[];
    -
    588 
    -
    591 extern volatile uint8_t _shadow_OAM_base;
    -
    592 
    -
    617 extern volatile uint8_t _shadow_OAM_OFF;
    -
    618 
    -
    621 #define DISABLE_VBL_TRANSFER \
    -
    622  _shadow_OAM_base = 0
    -
    623 
    -
    626 #define ENABLE_VBL_TRANSFER \
    -
    627  _shadow_OAM_base = (uint8_t)((uint16_t)&shadow_OAM >> 8)
    -
    628 
    -
    631 #define MAX_HARDWARE_SPRITES 64
    -
    632 
    -
    635 inline void SET_SHADOW_OAM_ADDRESS(void * address) {
    -
    636  _shadow_OAM_base = (uint8_t)((uint16_t)address >> 8);
    -
    637 }
    -
    638 
    -
    655 inline void set_sprite_tile(uint8_t nb, uint8_t tile) {
    -
    656  shadow_OAM[0x41+(nb << 1)] = tile;
    -
    657 }
    -
    658 
    -
    659 
    - -
    667  return shadow_OAM[0x41+(nb << 1)];
    -
    668 }
    -
    669 
    -
    670 inline void set_sprite_prop(uint8_t nb, uint8_t prop) {
    -
    671  nb; prop;
    -
    672 }
    -
    673 
    - -
    675  nb;
    -
    676  return 0;
    -
    677 }
    -
    678 
    -
    691 inline void move_sprite(uint8_t nb, uint8_t x, uint8_t y) {
    -
    692  shadow_OAM[nb] = (y < VDP_SAT_TERM) ? y : 0xC0;
    -
    693  shadow_OAM[0x40+(nb << 1)] = x;
    -
    694 }
    -
    695 
    -
    696 
    -
    707 inline void scroll_sprite(uint8_t nb, int8_t x, int8_t y) {
    -
    708  uint8_t new_y = shadow_OAM[nb] + y;
    -
    709  shadow_OAM[nb] = (new_y < VDP_SAT_TERM) ? new_y : 0xC0;
    -
    710  shadow_OAM[0x40+(nb << 1)] = x;
    -
    711 }
    -
    712 
    -
    713 
    -
    718 inline void hide_sprite(uint8_t nb) {
    -
    719  shadow_OAM[nb] = 0xC0;
    -
    720 }
    -
    721 
    -
    728 void set_vram_byte(uint8_t * addr, uint8_t v) __z88dk_callee __preserves_regs(iyh, iyl);
    -
    729 
    -
    737 uint8_t * set_attributed_tile_xy(uint8_t x, uint8_t y, uint16_t t) __z88dk_callee __preserves_regs(iyh, iyl);
    -
    738 
    -
    746 uint8_t * set_tile_xy(uint8_t x, uint8_t y, uint8_t t) __z88dk_callee __preserves_regs(iyh, iyl);
    -
    747 #define set_bkg_tile_xy set_tile_xy
    -
    748 #define set_win_tile_xy set_tile_xy
    -
    749 
    -
    753 uint8_t * get_bkg_xy_addr(uint8_t x, uint8_t y) __z88dk_callee __preserves_regs(iyh, iyl);
    -
    754 #define get_win_xy_addr get_bkg_xy_addr
    -
    755 
    -
    756 #endif /* _SMS_H */
    + +
    572 inline void set_bkg_based_tiles(uint8_t x, uint8_t y, uint8_t w, uint8_t h, const uint8_t *tiles, uint8_t base_tile) {
    +
    573  _map_tile_offset = base_tile;
    +
    574  set_tile_map_compat(x, y, w, h, tiles);
    +
    575  _map_tile_offset = 0;
    +
    576 }
    +
    577 inline void set_win_based_tiles(uint8_t x, uint8_t y, uint8_t w, uint8_t h, const uint8_t *tiles, uint8_t base_tile) {
    +
    578  _map_tile_offset = base_tile;
    +
    579  set_tile_map_compat(x, y, w, h, tiles);
    +
    580  _map_tile_offset = 0;
    +
    581 }
    +
    582 
    + + +
    585 inline void set_bkg_submap(uint8_t x, uint8_t y, uint8_t w, uint8_t h, const uint8_t *map, uint8_t map_w) {
    +
    586  set_tile_submap_compat(x, y, w, h, map_w, map);
    +
    587 }
    +
    588 inline void set_win_submap(uint8_t x, uint8_t y, uint8_t w, uint8_t h, const uint8_t *map, uint8_t map_w) {
    +
    589  set_tile_submap_compat(x, y, w, h, map_w, map);
    +
    590 }
    +
    591 
    + +
    593 inline void set_bkg_based_submap(uint8_t x, uint8_t y, uint8_t w, uint8_t h, const uint8_t *map, uint8_t map_w, uint8_t base_tile) {
    +
    594  _submap_tile_offset = base_tile;
    +
    595  set_tile_submap_compat(x, y, w, h, map_w, map);
    + +
    597 }
    +
    598 inline void set_win_based_submap(uint8_t x, uint8_t y, uint8_t w, uint8_t h, const uint8_t *map, uint8_t map_w, uint8_t base_tile) {
    +
    599  _submap_tile_offset = base_tile;
    +
    600  set_tile_submap_compat(x, y, w, h, map_w, map);
    + +
    602 }
    +
    603 
    + + +
    606 #define fill_bkg_rect fill_rect_compat
    +
    607 #define fill_win_rect fill_rect_compat
    +
    608 
    +
    611 extern volatile uint8_t shadow_OAM[];
    +
    612 
    +
    615 extern volatile uint8_t _shadow_OAM_base;
    +
    616 
    +
    641 extern volatile uint8_t _shadow_OAM_OFF;
    +
    642 
    +
    645 #define DISABLE_VBL_TRANSFER \
    +
    646  _shadow_OAM_base = 0
    +
    647 
    +
    650 #define ENABLE_VBL_TRANSFER \
    +
    651  _shadow_OAM_base = (uint8_t)((uint16_t)&shadow_OAM >> 8)
    +
    652 
    +
    655 #define MAX_HARDWARE_SPRITES 64
    +
    656 
    +
    659 inline void SET_SHADOW_OAM_ADDRESS(void * address) {
    +
    660  _shadow_OAM_base = (uint8_t)((uint16_t)address >> 8);
    +
    661 }
    +
    662 
    +
    679 inline void set_sprite_tile(uint8_t nb, uint8_t tile) {
    +
    680  shadow_OAM[0x41+(nb << 1)] = tile;
    +
    681 }
    +
    682 
    +
    683 
    + +
    691  return shadow_OAM[0x41+(nb << 1)];
    +
    692 }
    +
    693 
    +
    694 inline void set_sprite_prop(uint8_t nb, uint8_t prop) {
    +
    695  nb; prop;
    +
    696 }
    +
    697 
    + +
    699  nb;
    +
    700  return 0;
    +
    701 }
    +
    702 
    +
    715 inline void move_sprite(uint8_t nb, uint8_t x, uint8_t y) {
    +
    716  shadow_OAM[nb] = (y < VDP_SAT_TERM) ? y : 0xC0;
    +
    717  shadow_OAM[0x40+(nb << 1)] = x;
    +
    718 }
    +
    719 
    +
    720 
    +
    731 inline void scroll_sprite(uint8_t nb, int8_t x, int8_t y) {
    +
    732  uint8_t new_y = shadow_OAM[nb] + y;
    +
    733  shadow_OAM[nb] = (new_y < VDP_SAT_TERM) ? new_y : 0xC0;
    +
    734  shadow_OAM[0x40+(nb << 1)] = x;
    +
    735 }
    +
    736 
    +
    737 
    +
    742 inline void hide_sprite(uint8_t nb) {
    +
    743  shadow_OAM[nb] = 0xC0;
    +
    744 }
    +
    745 
    + +
    753 
    + +
    762 
    + +
    771 #define set_bkg_tile_xy set_tile_xy
    +
    772 #define set_win_tile_xy set_tile_xy
    +
    773 
    + +
    778 #define get_win_xy_addr get_bkg_xy_addr
    +
    779 
    +
    780 #endif /* _SMS_H */
    +
    void set_data(uint16_t dst, const void *src, uint16_t size) Z88DK_CALLEE PRESERVES_REGS(iyh
    void set_sprite_2bpp_data(uint16_t start, uint16_t ntiles, const void *src)
    Definition: sms.h:538
    +
    void set_bkg_based_tiles(uint8_t x, uint8_t y, uint8_t w, uint8_t h, const uint8_t *tiles, uint8_t base_tile)
    Definition: sms.h:572
    unsigned char uint8_t
    Definition: stdint.h:51
    void set_bkg_2bpp_data(uint16_t start, uint16_t ntiles, const void *src)
    Definition: sms.h:535
    signed char int8_t
    Definition: stdint.h:43
    +
    void add_LCD(int_handler h) Z88DK_FASTCALL PRESERVES_REGS(b
    +
    void add_TIM(int_handler h) Z88DK_FASTCALL
    +
    void set_tile_map(uint8_t x, uint8_t y, uint8_t w, uint8_t h, const uint8_t *tiles) Z88DK_CALLEE PRESERVES_REGS(iyh
    void set_bkg_4bpp_data(uint16_t start, uint16_t ntiles, const void *src)
    Definition: sms.h:516
    -
    void set_interrupts(uint8_t flags) __z88dk_fastcall
    -
    Definition: gb.h:592
    +
    Definition: gb.h:615
    void display_off()
    Definition: sms.h:221
    -
    void set_sprite_tile(uint8_t nb, uint8_t tile)
    Definition: sms.h:655
    +
    void waitpadup() PRESERVES_REGS(b
    +
    void set_sprite_tile(uint8_t nb, uint8_t tile)
    Definition: sms.h:679
    void d
    Definition: sms.h:86
    -
    void hide_sprite(uint8_t nb)
    Definition: sms.h:718
    -
    void remove_SIO(int_handler h) __z88dk_fastcall
    -
    void add_VBL(int_handler h) __z88dk_fastcall __preserves_regs(d
    -
    uint8_t joypad() OLDCALL __preserves_regs(b
    +
    void hide_sprite(uint8_t nb)
    Definition: sms.h:742
    +
    void remove_JOY(int_handler h) Z88DK_FASTCALL
    +
    uint8_t _submap_tile_offset
    +
    void set_win_based_tiles(uint8_t x, uint8_t y, uint8_t w, uint8_t h, const uint8_t *tiles, uint8_t base_tile)
    Definition: sms.h:577
    void set_bkg_1bpp_data(uint16_t start, uint16_t ntiles, const void *src)
    Definition: sms.h:547
    -
    void joypad_ex(joypads_t *joypads) __z88dk_fastcall __preserves_regs(iyh
    -
    #define VDP_R1
    Definition: hardware.h:63
    -
    void set_tile_map_compat(uint8_t x, uint8_t y, uint8_t w, uint8_t h, const uint8_t *tiles) __z88dk_callee __preserves_regs(iyh
    -
    void set_win_submap(uint8_t x, uint8_t y, uint8_t w, uint8_t h, const uint8_t *map, uint8_t map_w)
    Definition: sms.h:576
    +
    #define VDP_R1
    Definition: hardware.h:74
    +
    void set_win_submap(uint8_t x, uint8_t y, uint8_t w, uint8_t h, const uint8_t *map, uint8_t map_w)
    Definition: sms.h:588
    volatile uint16_t sys_time
    -
    uint8_t * set_attributed_tile_xy(uint8_t x, uint8_t y, uint16_t t) __z88dk_callee __preserves_regs(iyh
    -
    void set_bkg_submap(uint8_t x, uint8_t y, uint8_t w, uint8_t h, const uint8_t *map, uint8_t map_w)
    Definition: sms.h:573
    +
    void set_bkg_submap(uint8_t x, uint8_t y, uint8_t w, uint8_t h, const uint8_t *map, uint8_t map_w)
    Definition: sms.h:585
    void l
    Definition: sms.h:215
    uint8_t cancel_pending_interrupts()
    Definition: sms.h:190
    -
    uint8_t waitpad(uint8_t mask) __z88dk_fastcall __preserves_regs(b
    +
    uint8_t waitpad(uint8_t mask) Z88DK_FASTCALL PRESERVES_REGS(b
    +
    void set_win_based_submap(uint8_t x, uint8_t y, uint8_t w, uint8_t h, const uint8_t *map, uint8_t map_w, uint8_t base_tile)
    Definition: sms.h:598
    unsigned short int uint16_t
    Definition: stdint.h:52
    -
    void WRITE_VDP_CMD(uint16_t cmd) __z88dk_fastcall __preserves_regs(b
    +
    void WRITE_VDP_DATA(uint16_t data) Z88DK_FASTCALL PRESERVES_REGS(b
    +
    void set_tile_2bpp_data(uint16_t start, uint16_t ntiles, const void *src, uint16_t palette) Z88DK_CALLEE PRESERVES_REGS(iyh
    +
    void set_vram_byte(uint8_t *addr, uint8_t v) Z88DK_CALLEE PRESERVES_REGS(iyh
    void refresh_OAM()
    -
    void set_data(uint16_t dst, const void *src, uint16_t size) __z88dk_callee __preserves_regs(iyh
    -
    #define R1_DISP_ON
    Definition: hardware.h:68
    -
    void set_tile_2bpp_data(uint16_t start, uint16_t ntiles, const void *src, uint16_t palette) __z88dk_callee __preserves_regs(iyh
    -
    uint8_t get_sprite_tile(uint8_t nb)
    Definition: sms.h:666
    +
    void add_JOY(int_handler h) Z88DK_FASTCALL
    +
    #define R1_DISP_ON
    Definition: hardware.h:79
    +
    uint8_t * set_tile_xy(uint8_t x, uint8_t y, uint8_t t) Z88DK_CALLEE PRESERVES_REGS(iyh
    +
    uint8_t * get_bkg_xy_addr(uint8_t x, uint8_t y) Z88DK_CALLEE PRESERVES_REGS(iyh
    +
    uint8_t get_sprite_tile(uint8_t nb)
    Definition: sms.h:690
    +
    void fill_rect(uint8_t x, uint8_t y, uint8_t w, uint8_t h, const uint16_t tile) Z88DK_CALLEE PRESERVES_REGS(iyh
    void c
    Definition: sms.h:86
    -
    uint8_t joypad_init(uint8_t npads, joypads_t *joypads) __z88dk_callee
    -
    void vmemcpy(uint16_t dst, const void *src, uint16_t size) __z88dk_callee __preserves_regs(iyh
    -
    void wait_vbl_done() __preserves_regs(b
    -
    void set_tile_submap(uint8_t x, uint8_t y, uint8_t w, uint8_t h, uint8_t map_w, const uint8_t *map) __z88dk_callee __preserves_regs(iyh
    -
    void set_palette(uint8_t first_palette, uint8_t nb_palettes, palette_color_t *rgb_data) __z88dk_callee
    -
    #define VDP_RSCX
    Definition: hardware.h:113
    -
    void set_vram_byte(uint8_t *addr, uint8_t v) __z88dk_callee __preserves_regs(iyh
    +
    void add_SIO(int_handler h) Z88DK_FASTCALL
    +
    void set_tile_1bpp_data(uint16_t start, uint16_t ntiles, const void *src, uint16_t colors) Z88DK_CALLEE PRESERVES_REGS(iyh
    +
    #define Z88DK_CALLEE
    Definition: types.h:42
    +
    void set_tile_submap_compat(uint8_t x, uint8_t y, uint8_t w, uint8_t h, uint8_t map_w, const uint8_t *map) Z88DK_CALLEE PRESERVES_REGS(iyh
    +
    #define VDP_RSCX
    Definition: hardware.h:124
    short int int16_t
    Definition: stdint.h:44
    +
    void fill_rect_compat(uint8_t x, uint8_t y, uint8_t w, uint8_t h, const uint16_t tile) Z88DK_CALLEE PRESERVES_REGS(iyh
    void move_bkg(uint8_t x, uint8_t y)
    Definition: sms.h:194
    -
    void set_sprite_prop(uint8_t nb, uint8_t prop)
    Definition: sms.h:670
    -
    void add_SIO(int_handler h) __z88dk_fastcall
    -
    void remove_LCD(int_handler h) __z88dk_fastcall __preserves_regs(b
    +
    void vmemcpy(uint16_t dst, const void *src, uint16_t size) Z88DK_CALLEE PRESERVES_REGS(iyh
    +
    void set_sprite_prop(uint8_t nb, uint8_t prop)
    Definition: sms.h:694
    +
    void set_palette(uint8_t first_palette, uint8_t nb_palettes, palette_color_t *rgb_data) Z88DK_CALLEE
    +
    void WRITE_VDP_CMD(uint16_t cmd) Z88DK_FASTCALL PRESERVES_REGS(b
    #define __READ_VDP_REG(REG)
    Definition: sms.h:84
    void mode(uint8_t m) OLDCALL
    -
    void fill_rect(uint8_t x, uint8_t y, uint8_t w, uint8_t h, const uint16_t tile) __z88dk_callee __preserves_regs(iyh
    +
    void add_VBL(int_handler h) Z88DK_FASTCALL PRESERVES_REGS(d
    #define __WRITE_VDP_REG(REG, v)
    Definition: sms.h:83
    -
    void fill_rect_compat(uint8_t x, uint8_t y, uint8_t w, uint8_t h, const uint16_t tile) __z88dk_callee __preserves_regs(iyh
    uint8_t get_mode() OLDCALL
    -
    void add_LCD(int_handler h) __z88dk_fastcall __preserves_regs(b
    -
    #define VDP_RSCY
    Definition: hardware.h:118
    -
    void scroll_sprite(uint8_t nb, int8_t x, int8_t y)
    Definition: sms.h:707
    +
    #define VDP_RSCY
    Definition: hardware.h:129
    +
    void set_bkg_based_submap(uint8_t x, uint8_t y, uint8_t w, uint8_t h, const uint8_t *map, uint8_t map_w, uint8_t base_tile)
    Definition: sms.h:593
    +
    void scroll_sprite(uint8_t nb, int8_t x, int8_t y)
    Definition: sms.h:731
    void cpu_fast()
    Definition: sms.h:506
    -
    void delay(uint16_t d) __z88dk_fastcall
    void set_1bpp_colors(uint8_t fgcolor, uint8_t bgcolor)
    Definition: sms.h:543
    uint16_t palette_color_t
    Definition: cgb.h:85
    -
    volatile uint8_t _shadow_OAM_base
    Definition: gb.h:1271
    -
    void b
    Definition: gb.h:585
    +
    void set_native_tile_data(uint16_t start, uint16_t ntiles, const void *src) Z88DK_CALLEE PRESERVES_REGS(iyh
    +
    volatile uint8_t _shadow_OAM_base
    Definition: gb.h:1404
    +
    void b
    Definition: gb.h:608
    void set_sprite_4bpp_data(uint16_t start, uint16_t ntiles, const void *src)
    Definition: sms.h:519
    -
    #define OLDCALL
    Definition: types.h:21
    +
    #define OLDCALL
    Definition: types.h:19
    +
    uint8_t * set_attributed_tile_xy(uint8_t x, uint8_t y, uint16_t t) Z88DK_CALLEE PRESERVES_REGS(iyh
    void set_sprite_data(uint16_t start, uint16_t ntiles, const void *src)
    Definition: sms.h:532
    -
    void set_tile_submap_compat(uint8_t x, uint8_t y, uint8_t w, uint8_t h, uint8_t map_w, const uint8_t *map) __z88dk_callee __preserves_regs(iyh
    -
    uint8_t * get_bkg_xy_addr(uint8_t x, uint8_t y) __z88dk_callee __preserves_regs(iyh
    +
    void joypad_ex(joypads_t *joypads) Z88DK_FASTCALL PRESERVES_REGS(iyh
    +
    uint8_t joypad_init(uint8_t npads, joypads_t *joypads) Z88DK_CALLEE
    +
    #define Z88DK_FASTCALL
    Definition: types.h:43
    volatile uint8_t shadow_OAM[]
    void set_bkg_data(uint16_t start, uint16_t ntiles, const void *src)
    Definition: sms.h:529
    -
    void remove_VBL(int_handler h) __z88dk_fastcall __preserves_regs(iyh
    -
    void remove_JOY(int_handler h) __z88dk_fastcall
    -
    #define NONBANKED
    Definition: types.h:12
    -
    void set_tile_map(uint8_t x, uint8_t y, uint8_t w, uint8_t h, const uint8_t *tiles) __z88dk_callee __preserves_regs(iyh
    -
    void SET_SHADOW_OAM_ADDRESS(void *address)
    Definition: sms.h:635
    +
    void remove_LCD(int_handler h) Z88DK_FASTCALL PRESERVES_REGS(b
    +
    void SET_SHADOW_OAM_ADDRESS(void *address)
    Definition: sms.h:659
    +
    void delay(uint16_t d) Z88DK_FASTCALL
    +
    void remove_SIO(int_handler h) Z88DK_FASTCALL
    uint16_t _current_1bpp_colors
    -
    void move_sprite(uint8_t nb, uint8_t x, uint8_t y)
    Definition: sms.h:691
    -
    uint8_t get_sprite_prop(uint8_t nb)
    Definition: sms.h:674
    +
    void move_sprite(uint8_t nb, uint8_t x, uint8_t y)
    Definition: sms.h:715
    +
    uint8_t get_sprite_prop(uint8_t nb)
    Definition: sms.h:698
    uint16_t _current_2bpp_palette
    -
    #define VDP_SAT_TERM
    Definition: hardware.h:177
    +
    void remove_VBL(int_handler h) Z88DK_FASTCALL PRESERVES_REGS(iyh
    +
    #define VDP_SAT_TERM
    Definition: hardware.h:188
    void set_2bpp_palette(uint16_t palette)
    Definition: sms.h:525
    volatile uint8_t _shadow_OAM_OFF
    void iyl
    Definition: sms.h:86
    -
    uint8_t * set_tile_xy(uint8_t x, uint8_t y, uint8_t t) __z88dk_callee __preserves_regs(iyh
    -
    void set_native_tile_data(uint16_t start, uint16_t ntiles, const void *src) __z88dk_callee __preserves_regs(iyh
    -
    void add_TIM(int_handler h) __z88dk_fastcall
    +
    uint8_t joypad() OLDCALL PRESERVES_REGS(b
    +
    void set_tile_map_compat(uint8_t x, uint8_t y, uint8_t w, uint8_t h, const uint8_t *tiles) Z88DK_CALLEE PRESERVES_REGS(iyh
    +
    #define NONBANKED
    Definition: types.h:36
    void set_default_palette()
    +
    void wait_vbl_done() PRESERVES_REGS(b
    void scroll_bkg(int8_t x, int8_t y)
    Definition: sms.h:199
    -
    void add_JOY(int_handler h) __z88dk_fastcall
    -
    void WRITE_VDP_DATA(uint16_t data) __z88dk_fastcall __preserves_regs(b
    -
    void set_palette_entry(uint8_t palette, uint8_t entry, uint16_t rgb_data) __z88dk_callee __preserves_regs(iyh
    +
    void remove_TIM(int_handler h) Z88DK_FASTCALL
    +
    #define PRESERVES_REGS(...)
    Definition: types.h:29
    +
    uint8_t _map_tile_offset
    void set_sprite_1bpp_data(uint16_t start, uint16_t ntiles, const void *src)
    Definition: sms.h:550
    +
    void set_palette_entry(uint8_t palette, uint8_t entry, uint16_t rgb_data) Z88DK_CALLEE PRESERVES_REGS(iyh
    void h
    Definition: sms.h:215
    void iyh
    Definition: sms.h:86
    void(* int_handler)(void) NONBANKED
    Definition: sms.h:152
    -
    void waitpadup() __preserves_regs(b
    +
    void set_interrupts(uint8_t flags) Z88DK_FASTCALL
    +
    void set_tile_submap(uint8_t x, uint8_t y, uint8_t w, uint8_t h, uint8_t map_w, const uint8_t *map) Z88DK_CALLEE PRESERVES_REGS(iyh
    void e
    Definition: sms.h:86
    -
    void set_tile_1bpp_data(uint16_t start, uint16_t ntiles, const void *src, uint16_t colors) __z88dk_callee __preserves_regs(iyh
    -
    void remove_TIM(int_handler h) __z88dk_fastcall
    -
    void d
    Definition: gb.h:585
    +
    void d
    Definition: gb.h:608

    Function Documentation

    - -

    ◆ clock()

    + +

    ◆ clock()

    - + @@ -163,7 +164,7 @@ Functions
    clock_t clock clock_t clock ( )

    Returns an approximation of processor time used by the program in Clocks

    -

    The value returned is the CPU time (ticks) used so far as a clock_t.

    +

    The value returned is the CPU time (ticks) used so far as a clock_t.

    To get the number of seconds used, divide by CLOCKS_PER_SEC.

    This is based on sys_time, which will wrap around every ~18 minutes. (unsigned 16 bits = 65535 / 60 / 60 = 18.2)

    See also
    sys_time, time()
    @@ -185,15 +186,15 @@ Functions
    -

    Converts clock() time to Seconds

    +

    Converts clock() time to Seconds

    Parameters
    tIf pointer t is not NULL, it's value will be set to the same seconds calculation as returned by the function.
    -

    The calculation is clock() / CLOCKS_PER_SEC

    -

    Returns: time in seconds

    See also
    sys_time, clock()
    +

    The calculation is clock() / CLOCKS_PER_SEC

    +

    Returns: time in seconds

    See also
    sys_time, clock()
    diff --git a/docs/api/time_8h.js b/docs/api/time_8h.js index ac7c1dad..d7b6e857 100644 --- a/docs/api/time_8h.js +++ b/docs/api/time_8h.js @@ -2,6 +2,6 @@ var time_8h = [ [ "CLOCKS_PER_SEC", "time_8h.html#a3d9fc3c745d0880902fe3ea3d5d5f71e", null ], [ "time_t", "time_8h.html#ac84921d4d15eedac7d7b8051a7944c84", null ], - [ "clock", "time_8h.html#a9e660b4ddc93c500ce46593917de2bbf", null ], + [ "clock", "time_8h.html#acc1f88818af5706d57262377382ae4ac", null ], [ "time", "time_8h.html#ae7841e681c8c9d59818568d39553642c", null ] ]; \ No newline at end of file diff --git a/docs/api/time_8h_source.html b/docs/api/time_8h_source.html index bd7bcc0c..47046650 100644 --- a/docs/api/time_8h_source.html +++ b/docs/api/time_8h_source.html @@ -29,6 +29,7 @@
    GBDK 2020 Docs +  4.0.6
    API Documentation for GBDK 2020
    @@ -100,7 +101,7 @@ $(document).ready(function(){initNavTree('time_8h_source.html',''); initResizabl
    11 
    12 typedef uint16_t time_t;
    13 
    - +
    26 
    37 
    @@ -110,10 +111,11 @@ $(document).ready(function(){initNavTree('time_8h_source.html',''); initResizabl
    uint16_t time_t
    Definition: time.h:12
    unsigned short int uint16_t
    Definition: stdint.h:52
    -
    clock_t clock()
    -
    UINT16 clock_t
    Definition: types.h:65
    time_t time(time_t *t)
    +
    #define OLDCALL
    Definition: types.h:19
    +
    unsigned int clock_t
    Definition: types.h:68
    +
    clock_t clock() OLDCALL