Commit 03f815c8 authored by Donald Haase's avatar Donald Haase
Browse files

Changes to allow compilation with modern KOS, readd Exit for testing

parent 5ac0b2df
./bin/
./data.iso
\ No newline at end of file
......@@ -7,16 +7,18 @@ OBJS += dsp1.o fxdbg.o fxemu.o fxinst.o gfx.o globals.o loadzip.o memmap.o netpl
OBJS += sdd1.o sdd1emu.o server.o seta010.o seta011.o seta018.o seta.o snaporig.o snapshot.o snes9x.o soundux.o spc700.o
OBJS += spc7110.o spc.o spccycles.o srtc.o tile.o explode.o unreduce.o unshrink.o unzip.o cheats.o scanf.o dc_utils.o
OBJS += dc_vmu.o XML.o dc_menu.o pvr_texture.o dc_controller.o dc_mouse.o dc_file_browser.o test.o sa1.o scherzo_snd_stream.o
OBJS += offsets.o
OBJS += offsets.o romdisk.o
CPP_CPU_OBJS = cpuexec.o cpuops.o sa1cpu.o
ASM_CPU_OBJS = sh/cpuexec.o sh/cpuops.o sh/sa1ops.o
MY_AFLAGS = -Wa,-little -DSPC700_C -DVAR_CYCLES -DCPU_SHUTDOWN -DSPC700_SHUTDOWN
KOS_ROMDISK_DIR = romdisk
MY_AFLAGS = -DSPC700_C -DVAR_CYCLES -DCPU_SHUTDOWN -DSPC700_SHUTDOWN
OBJS += $(ASM_CPU_OBJS)
KOS_EXTRA_FLAGS = -D_XBOX -DUNZIP_SUPPORT -DNOASM -DSDD1_DECOMP -DSPC700_C -DVAR_CYCLES -DCPU_SHUTDOWN -DSPC700_SHUTDOWN -funroll-loops
KOS_EXTRA_FLAGS = -D_XBOX -DNO_INLINE_SET_GET -DUNZIP_SUPPORT -DNOASM -DSDD1_DECOMP -DSPC700_C -DVAR_CYCLES -DCPU_SHUTDOWN -DSPC700_SHUTDOWN -funroll-loops
KOS_CFLAGS += $(KOS_EXTRA_FLAGS)
KOS_CPPFLAGS += $(KOS_EXTRA_FLAGS)
......@@ -33,28 +35,17 @@ cleanasm:
rm-elf:
-rm -f $(TARGET) $(BIN) romdisk.*
$(TARGET): $(OBJS) romdisk.o
$(KOS_CC) $(KOS_STARTUP) $(OBJS) romdisk.o -o $(TARGET) $(KOS_LDFLAGS) $(KOS_LIBS) -lmp3 -loggvorbisplay -lparallax -lkmg -lpng -ljpeg -lgl -lm -lkallisti -lz -lm -lgcc -lk++ -lkosutils
$(KOS_STRIP) $(TARGET)
$(KOS_OBJCOPY) -O binary $(TARGET) bin/raw.bin
scramble bin/raw.bin bin/1ST_READ.BIN
cp bin/1ST_READ.BIN cd/1ST_READ.BIN
cp $(TARGET) bin/$(TARGET)
romdisk.img:
$(KOS_GENROMFS) -f romdisk.img -d romdisk -v
romdisk.o: romdisk.img
$(KOS_BASE)/utils/bin2o/bin2o romdisk.img romdisk_boot romdisk.o
sh/cpuexec.o:
$(KOS_CC) $(MY_AFLAGS) -c sh/cpuexec.S -o sh/cpuexec.o
$(TARGET): $(OBJS)
kos-c++ -o $(TARGET) $(OBJS) -lmp3 -loggvorbisplay -lvorbis -logg -lparallax -lkmg -lpng -ljpeg -lGL -lm -lkallisti -lz -lm -lgcc -lkosutils
# $(KOS_STRIP) $(TARGET)
# $(KOS_OBJCOPY) -O binary $(TARGET) bin/raw.bin
# scramble bin/raw.bin bin/1ST_READ.BIN
# cp bin/1ST_READ.BIN cd/1ST_READ.BIN
# cp $(TARGET) bin/$(TARGET)
sh/cpuops.o:
$(KOS_CC) $(MY_AFLAGS) -c sh/cpuops.S -o sh/cpuops.o
sh/sa1ops.o:
$(KOS_CC) $(MY_AFLAGS) -c sh/sa1ops.S -o sh/sa1ops.o
%.o: %.S
kos-cc $(MY_AFLAGS) -c $< -o $@
cdimg:
mkisofs -J -o data.iso cd
#if !defined(AFX_XARRAY_H__D03AF296_9FA8_499F_A47D_155DDACDA5CC__INCLUDED_)
#define AFX_XARRAY_H__D03AF296_9FA8_499F_A47D_155DDACDA5CC__INCLUDED_
#include "port.h"
template<class _mytype>
class XArray
{
......
......@@ -735,7 +735,7 @@ void S9xFixEnvelope (int channel, uint8 gain, uint8 adsr1, uint8 adsr2)
1200, 740, 440, 290, 180, 110, 74, 37
};
static unsigned long SustainRate [32] = {
~0, 38000, 28000, 24000, 19000, 14000, 12000, 9400,
0xffffffff, 38000, 28000, 24000, 19000, 14000, 12000, 9400,
7100, 5900, 4700, 3500, 2900, 2400, 1800, 1500,
1200, 880, 740, 590, 440, 370, 290, 220,
180, 150, 110, 92, 74, 55, 37, 18
......@@ -777,13 +777,13 @@ void S9xFixEnvelope (int channel, uint8 gain, uint8 adsr1, uint8 adsr2)
else
{
static unsigned long IncreaseRate [32] = {
~0, 4100, 3100, 2600, 2000, 1500, 1300, 1000,
0xffffffff, 4100, 3100, 2600, 2000, 1500, 1300, 1000,
770, 640, 510, 380, 320, 260, 190, 160,
130, 96, 80, 64, 48, 40, 32, 24,
20, 16, 12, 10, 8, 6, 4, 2
};
static unsigned long DecreaseRateExp [32] = {
~0, 38000, 28000, 24000, 19000, 14000, 12000, 9400,
0xffffffff, 38000, 28000, 24000, 19000, 14000, 12000, 9400,
7100, 5900, 4700, 3500, 2900, 2400, 1800, 1500,
1200, 880, 740, 590, 440, 370, 290, 220,
180, 150, 110, 92, 74, 55, 37, 18
......
......@@ -2,12 +2,6 @@
#include "dc_controller.h"
#include "scherzo_snd_stream.h"
extern struct
{
int32 x1, y1, x2, y2;
float xscale, yscale;
} screen_adjustments;
DCMenuItem::DCMenuItem()
{
m_text = NULL;
......@@ -478,7 +472,7 @@ bool DCMenu::Run()
return success;
}
void DCMenu::Stop(bool cascade = false)
void DCMenu::Stop(bool cascade)
{
m_running = false;
if (cascade && m_parent)
......
......@@ -17,12 +17,6 @@ dc_maple_info_t dc_maple_controller_info[DC_MAPLE_INFO_SIZE];
dc_maple_info_t dc_maple_mouse_info[DC_MAPLE_INFO_SIZE];
dc_maple_info_t dc_maple_keyboard_info[DC_MAPLE_INFO_SIZE];
extern struct
{
int32 x1, y1, x2, y2;
float xscale, yscale;
} screen_adjustments;
void dc_maple_init ()
{
int n;
......
......@@ -56,6 +56,13 @@ typedef struct {
extern dc_screen_offset_t dc_screen_offset;
typedef struct {
int32 x1, y1, x2, y2;
float xscale, yscale;
} sa_struct_t;
extern sa_struct_t screen_adjustments;
extern pvr_vertex_t main_vert;
void dc_screen_offset_init();
......
......@@ -285,8 +285,8 @@ START_EXTERN_C
void S9xResetDSP1 ();
uint8 S9xGetDSP (uint16 Address);
void S9xSetDSP (uint8 Byte, uint16 Address);
END_EXTERN_C
extern struct SDSP1 DSP1;
END_EXTERN_C
#endif
......@@ -93,27 +93,27 @@
START_EXTERN_C
char String[513];
struct Missing missing __attribute__ ((aligned (32)));
struct Missing missing;
struct SICPU ICPU __attribute__ ((aligned (32)));
struct SICPU ICPU;
struct SCPUState CPU __attribute__ ((aligned (32)));
struct SCPUState CPU;
struct SRegisters Registers __attribute__ ((aligned (32)));
struct SRegisters Registers;
struct SAPU APU __attribute__ ((aligned (32)));
struct SAPU APU;
struct SIAPU IAPU __attribute__ ((aligned (32)));
struct SIAPU IAPU;
struct SAPURegisters APURegisters __attribute__ ((aligned (32)));
struct SAPURegisters APURegisters;
struct SSettings Settings __attribute__ ((aligned (32)));
struct SSettings Settings;
struct SDSP1 DSP1 __attribute__ ((aligned (32)));
struct SDSP1 DSP1;
struct SSA1Registers SA1Registers __attribute__ ((aligned (32)));
struct SSA1Registers SA1Registers;
struct SSA1 SA1 __attribute__ ((aligned (32)));
struct SSA1 SA1;
SSoundData SoundData;
......@@ -143,6 +143,8 @@ unsigned char OpenBus = 0;
END_EXTERN_C
#ifndef ZSNES_FX
struct FxInit_s SuperFX;
#else
......
......@@ -4,6 +4,8 @@
#include "vorbisfile.h"
#include <mp3/sndmp3.h>
#include <math.h>
#include <strings.h>
#include <sys/time.h>
#include "snes9x.h"
#include "memmap.h"
......@@ -125,11 +127,7 @@ void ShowSplash(const char* filename, uint16 duration, uint16 fade_duration, voi
void PrintOffsetsAsm();
struct
{
int32 x1, y1, x2, y2;
float xscale, yscale;
} screen_adjustments = {0, 0, SCREEN_WIDTH, SCREEN_HEIGHT, 1.0f, 1.0f};
sa_struct_t screen_adjustments = {0, 0, SCREEN_WIDTH, SCREEN_HEIGHT, 1.0f, 1.0f};
struct SSuperFamicastSettings
{
......@@ -464,8 +462,8 @@ static void display_snes_screen()
}
/* romdisk */
extern uint8 romdisk_boot[];
KOS_INIT_ROMDISK(romdisk_boot);
extern uint8 romdisk[];
KOS_INIT_ROMDISK(romdisk);
void _splitpath (const char *path, char *drive, char *dir, char *fname, char *ext)
{
......@@ -1745,7 +1743,7 @@ void OnConfigureControllers(DCMenu* pMenu, DCMenuItem* pMenuItem, int value)
void OnExit(DCMenu* pMenu, DCMenuItem* pMenuItem, int value)
{
arch_exit();
}
void OnSaveSettings(DCMenu* pMenu, DCMenuItem* pMenuItem, int value)
......@@ -1814,7 +1812,7 @@ void ShowMainMenu()
main_menu.AddItem("Save Settings", OnSaveSettings);
main_menu.AddItem("Change Theme", OnChangeTheme);
//main_menu.AddItem("Credits", OnCredits);
//main_menu.AddItem("Exit", OnExit);
main_menu.AddItem("Exit", OnExit);
main_menu.Run();
} while (!game_loaded);
just_entered_game = true;
......
......@@ -240,8 +240,8 @@ void _makepath (char *path, const char *drive, const char *dir,
void _splitpath (const char *path, char *drive, char *dir, char *fname,
char *ext);
//SCHERZO ADDED THIS
#define strcasecmp stricmp
#define strncasecmp strnicmp
#define stricmp strcasecmp
#define strnicmp strncasecmp
#else /* __WIN32__ */
#define strcasecmp stricmp
......@@ -281,6 +281,7 @@ EXTERN_C void MixSound(void);
#ifdef _arch_dreamcast
#define LSB_FIRST
#include <malloc.h>
#else
#if defined(__i386__) || defined(__i486__) || defined(__i586__) || \
defined(__WIN32__) || defined(__alpha__)
......
......@@ -2,12 +2,6 @@
#include "dc_utils.h"
#include <math.h>
extern struct
{
int32 x1, y1, x2, y2;
float xscale, yscale;
} screen_adjustments;
CPVRTexture::CPVRTexture()
{
m_ptr = NULL;
......@@ -167,7 +161,7 @@ void CPVRTexture::Draw(int16 x, int16 y, int16 z, float alpha)
pvr_prim (&vert, sizeof(vert));
}
void CPVRTexture::DrawFullscreen(int16 z, float alpha = 1.0f)
void CPVRTexture::DrawFullscreen(int16 z, float alpha)
{
pvr_vertex_t vert;
......
......@@ -21,8 +21,6 @@
#include "aica_cmd_iface.h"
CVSID("$Id: snd_stream.c,v 1.13 2003/03/09 01:26:37 bardtx Exp $");
/*
This module uses a nice circularly queued data stream in SPU RAM, which is
......
......@@ -78,6 +78,8 @@
Super NES and Super Nintendo Entertainment System are trademarks of
Nintendo Co., Limited and its subsidiary companies.
******************************************************************************/
#ifndef __ASMSTRUC_H
#define __ASMSTRUC_H
#if defined(__GCC)
#define S9xTraceMessage _S9xTraceMessage
......@@ -286,3 +288,4 @@
mov.l @r15+,r6
.endm
#endif /* __ASMSTRUC_H */
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment