2009-05-21 17:48:31 +02:00
|
|
|
/* gameplaySP
|
|
|
|
*
|
|
|
|
* Copyright (C) 2006 Exophase <exophase@gmail.com>
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License as
|
|
|
|
* published by the Free Software Foundation; either version 2 of
|
|
|
|
* the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef MAIN_H
|
|
|
|
#define MAIN_H
|
|
|
|
|
|
|
|
typedef enum
|
|
|
|
{
|
|
|
|
TIMER_INACTIVE,
|
|
|
|
TIMER_PRESCALE,
|
|
|
|
TIMER_CASCADE
|
|
|
|
} timer_status_type;
|
|
|
|
|
|
|
|
typedef enum
|
|
|
|
{
|
|
|
|
TIMER_NO_IRQ,
|
|
|
|
TIMER_TRIGGER_IRQ
|
|
|
|
} timer_irq_type;
|
|
|
|
|
|
|
|
|
|
|
|
typedef enum
|
|
|
|
{
|
|
|
|
TIMER_DS_CHANNEL_NONE,
|
|
|
|
TIMER_DS_CHANNEL_A,
|
|
|
|
TIMER_DS_CHANNEL_B,
|
|
|
|
TIMER_DS_CHANNEL_BOTH
|
|
|
|
} timer_ds_channel_type;
|
|
|
|
|
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
s32 count;
|
|
|
|
u32 reload;
|
|
|
|
u32 prescale;
|
|
|
|
u32 stop_cpu_ticks;
|
2011-09-06 19:18:34 +02:00
|
|
|
fixed8_24 frequency_step;
|
2009-05-21 17:48:31 +02:00
|
|
|
timer_ds_channel_type direct_sound_channels;
|
|
|
|
timer_irq_type irq;
|
|
|
|
timer_status_type status;
|
|
|
|
} timer_type;
|
|
|
|
|
|
|
|
typedef enum
|
|
|
|
{
|
|
|
|
auto_frameskip,
|
|
|
|
manual_frameskip,
|
|
|
|
no_frameskip
|
|
|
|
} frameskip_type;
|
|
|
|
|
|
|
|
extern u32 cpu_ticks;
|
|
|
|
extern u32 frame_ticks;
|
|
|
|
extern u32 execute_cycles;
|
|
|
|
extern frameskip_type current_frameskip_type;
|
|
|
|
extern u32 frameskip_value;
|
|
|
|
extern u32 random_skip;
|
|
|
|
extern u32 global_cycles_per_instruction;
|
|
|
|
extern u32 synchronize_flag;
|
|
|
|
extern u32 skip_next_frame;
|
|
|
|
|
|
|
|
extern u32 cycle_memory_access;
|
|
|
|
extern u32 cycle_pc_relative_access;
|
|
|
|
extern u32 cycle_sp_relative_access;
|
|
|
|
extern u32 cycle_block_memory_access;
|
|
|
|
extern u32 cycle_block_memory_sp_access;
|
|
|
|
extern u32 cycle_block_memory_words;
|
|
|
|
extern u32 cycle_dma16_words;
|
|
|
|
extern u32 cycle_dma32_words;
|
|
|
|
extern u32 flush_ram_count;
|
|
|
|
|
|
|
|
extern u64 base_timestamp;
|
|
|
|
|
2011-09-05 18:31:58 +02:00
|
|
|
extern char main_path[512];
|
2009-05-21 17:48:31 +02:00
|
|
|
|
|
|
|
extern u32 update_backup_flag;
|
|
|
|
|
|
|
|
u32 update_gba();
|
|
|
|
void reset_gba();
|
2014-12-09 00:17:28 +01:00
|
|
|
#ifdef __LIBRETRO__
|
|
|
|
#define synchronize()
|
2014-12-09 02:43:59 +01:00
|
|
|
void init_main();
|
2014-12-09 00:17:28 +01:00
|
|
|
#else
|
2009-05-21 17:48:31 +02:00
|
|
|
void synchronize();
|
2014-12-09 00:17:28 +01:00
|
|
|
#endif
|
2009-05-21 17:48:31 +02:00
|
|
|
void quit();
|
|
|
|
void delay_us(u32 us_count);
|
|
|
|
void get_ticks_us(u64 *tick_return);
|
2011-09-05 18:31:58 +02:00
|
|
|
void game_name_ext(char *src, char *buffer, char *extension);
|
2009-05-21 17:48:31 +02:00
|
|
|
void main_write_mem_savestate(file_tag_type savestate_file);
|
|
|
|
void main_read_savestate(file_tag_type savestate_file);
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef PSP_BUILD
|
|
|
|
|
2011-09-05 18:31:58 +02:00
|
|
|
u32 file_length(char *filename, s32 dummy);
|
2009-05-21 17:48:31 +02:00
|
|
|
|
2011-09-02 23:55:13 +02:00
|
|
|
#else
|
|
|
|
|
2014-12-09 00:17:28 +01:00
|
|
|
u32 file_length(const char *dummy, FILE *fp);
|
2011-09-02 23:55:13 +02:00
|
|
|
|
2009-05-21 17:48:31 +02:00
|
|
|
#endif
|
|
|
|
|
|
|
|
extern u32 real_frame_count;
|
|
|
|
extern u32 virtual_frame_count;
|
|
|
|
extern u32 max_frameskip;
|
|
|
|
extern u32 num_skipped_frames;
|
|
|
|
|
2011-09-05 18:31:58 +02:00
|
|
|
void change_ext(const char *src, char *buffer, const char *extension);
|
2011-09-07 22:45:45 +02:00
|
|
|
void make_rpath(char *buff, size_t size, const char *ext);
|
2009-05-21 17:48:31 +02:00
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|