fix windows build for once
This commit is contained in:
parent
cb6f058389
commit
2d3580a05c
262 changed files with 76249 additions and 22 deletions
|
|
@ -1,5 +1,9 @@
|
|||
#include "taAudio.h"
|
||||
#ifdef _WIN32
|
||||
#include <SDL.h>
|
||||
#else
|
||||
#include <SDL2/SDL.h>
|
||||
#endif
|
||||
|
||||
class TAAudioSDL: public TAAudio {
|
||||
SDL_AudioSpec ac, ar;
|
||||
|
|
|
|||
|
|
@ -6,8 +6,13 @@
|
|||
|
||||
#define GB_CLOCK_RATE 0x400000
|
||||
|
||||
#ifdef __GNUC__
|
||||
#define likely(x) __builtin_expect((x), 1)
|
||||
#define unlikely(x) __builtin_expect((x), 0)
|
||||
#else
|
||||
#define likely(x) x
|
||||
#define unlikely(x) x
|
||||
#endif
|
||||
|
||||
static const uint8_t duties[] = {
|
||||
0, 0, 0, 0, 0, 0, 0, 1,
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
#ifndef GB_h
|
||||
#define GB_h
|
||||
#define typeof __typeof__
|
||||
#include <stdbool.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdint.h>
|
||||
|
|
@ -94,14 +93,6 @@ typedef union {
|
|||
uint8_t data[5];
|
||||
} GB_rtc_time_t;
|
||||
|
||||
typedef struct __attribute__((packed)) {
|
||||
uint64_t last_rtc_second;
|
||||
uint16_t minutes;
|
||||
uint16_t days;
|
||||
uint16_t alarm_minutes, alarm_days;
|
||||
uint8_t alarm_enabled;
|
||||
} GB_huc3_rtc_time_t;
|
||||
|
||||
typedef enum {
|
||||
// GB_MODEL_DMG_0 = 0x000,
|
||||
// GB_MODEL_DMG_A = 0x001,
|
||||
|
|
@ -285,11 +276,11 @@ typedef enum {
|
|||
#define INTERNAL_DIV_CYCLES (0x40000)
|
||||
|
||||
#if !defined(MIN)
|
||||
#define MIN(A, B) ({ __typeof__(A) __a = (A); __typeof__(B) __b = (B); __a < __b ? __a : __b; })
|
||||
#define MIN(a,b) (((a)<(b))?(a):(b))
|
||||
#endif
|
||||
|
||||
#if !defined(MAX)
|
||||
#define MAX(A, B) ({ __typeof__(A) __a = (A); __typeof__(B) __b = (B); __a < __b ? __b : __a; })
|
||||
#define MAX(a,b) (((a)>(b))?(a):(b))
|
||||
#endif
|
||||
|
||||
typedef void (*GB_vblank_callback_t)(GB_gameboy_t *gb);
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
#define _SAFEREADER_H
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdint.h>
|
||||
#include "../ta-utils.h"
|
||||
|
||||
class SafeReader;
|
||||
|
|
|
|||
32
src/main.cpp
32
src/main.cpp
|
|
@ -1,15 +1,30 @@
|
|||
#include <stdio.h>
|
||||
#include <mutex>
|
||||
#include "ta-log.h"
|
||||
#include "engine/engine.h"
|
||||
|
||||
#ifdef _WIN32
|
||||
#include <windows.h>
|
||||
#else
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
#define DIV_VERSION "dev6"
|
||||
|
||||
DivEngine e;
|
||||
|
||||
std::mutex m;
|
||||
|
||||
int main(int argc, char** argv) {
|
||||
#ifdef _WIN32
|
||||
HANDLE winin=GetStdHandle(STD_INPUT_HANDLE);
|
||||
HANDLE winout=GetStdHandle(STD_OUTPUT_HANDLE);
|
||||
int termprop=0;
|
||||
int termpropi=0;
|
||||
GetConsoleMode(winout,(LPDWORD)&termprop);
|
||||
GetConsoleMode(winin,(LPDWORD)&termpropi);
|
||||
termprop|=ENABLE_VIRTUAL_TERMINAL_PROCESSING;
|
||||
termpropi&=~ENABLE_LINE_INPUT;
|
||||
SetConsoleMode(winout,termprop);
|
||||
SetConsoleMode(winin,termpropi);
|
||||
#endif
|
||||
if (argc<2) {
|
||||
logI("usage: %s file\n",argv[0]);
|
||||
return 1;
|
||||
|
|
@ -62,11 +77,14 @@ int main(int argc, char** argv) {
|
|||
return 1;
|
||||
}
|
||||
logI("loaded! :o\n");
|
||||
logI("playing...\n");
|
||||
e.play();
|
||||
while (true) {
|
||||
logI("locking...\n");
|
||||
e.play();
|
||||
m.lock();
|
||||
m.lock();
|
||||
#ifdef _WIN32
|
||||
Sleep(500);
|
||||
#else
|
||||
usleep(500000);
|
||||
#endif
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,4 +9,9 @@ typedef std::string String;
|
|||
#define MIN(a,b) (((a)<(b))?(a):(b))
|
||||
#define MAX(a,b) (((a)>(b))?(a):(b))
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#include <BaseTsd.h>
|
||||
typedef SSIZE_T ssize_t;
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue