sgdk
minimus.h
00001 #ifndef MINIMUS_H_
00002 #define MINIMUS_H_
00003 
00004 // SGDK replacement for stdint.h
00005 #include "types.h"
00006 
00007 #define MINIMUSIC_MEMORY_BARRIER() asm volatile ("" : : : "memory")
00008 
00009 static inline void MINIMUSIC_Z80_GUARD_BEGIN() {
00010    volatile uint16_t *port = (uint16_t*)(0xA11100);
00011    MINIMUSIC_MEMORY_BARRIER();
00012    *port = 0x100;
00013    MINIMUSIC_MEMORY_BARRIER();
00014 }
00015 
00016 static inline void MINIMUSIC_Z80_GUARD_END() {
00017    volatile uint16_t *port = (uint16_t*)(0xA11100);
00018    MINIMUSIC_MEMORY_BARRIER();
00019    *port = 0x000;
00020    MINIMUSIC_MEMORY_BARRIER();
00021 }
00022 
00023 #define MINIMUSIC_STATUS_BGM        0x01
00024 
00025 void minimusic_init(const void *, uint16_t);
00026 void minimusic_sendcmd(uint8_t);
00027 uint8_t minimusic_get_status(void);
00028 
00029 #endif
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Defines