Compare commits
30 Commits
ph3nom/upd
...
pGta-Menu-
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a2d7ce9132 | ||
|
|
3188550311 | ||
|
|
9a1ea298d9 | ||
|
|
383442c6aa | ||
|
|
9b775dff3f | ||
|
|
353b7cc56d | ||
|
|
52c4946111 | ||
|
|
77b40f3004 | ||
|
|
ff2368da21 | ||
|
|
4ac38c0d64 | ||
|
|
ed2898ae2a | ||
|
|
a14f51246d | ||
|
|
19f22e8edb | ||
|
|
354b1ae92c | ||
|
|
a6a1fdb9cb | ||
|
|
309232c221 | ||
|
|
70df292c7a | ||
|
|
554a668897 | ||
|
|
3998368791 | ||
|
|
730302180a | ||
|
|
87bfbcab2d | ||
|
|
bdc27bf2fc | ||
|
|
1ee51d5136 | ||
|
|
725d60a9fb | ||
|
|
05e9e7452e | ||
|
|
51b21c02b9 | ||
|
|
86806215a5 | ||
|
|
a056fdecc7 | ||
|
|
b6d5c628b2 | ||
|
|
8c81349c69 |
@@ -79,6 +79,9 @@ OBJS_TEXCONV += \
|
||||
../vendor/librw/src/d3d-x/d3d.texconv.o \
|
||||
../vendor/librw/src/d3d-x/d3d8.texconv.o \
|
||||
../vendor/librw/src/d3d-x/d3d8render.texconv.o \
|
||||
../vendor/librw/src/bmp.texconv.o \
|
||||
../vendor/librw/src/png.texconv.o \
|
||||
../vendor/librw/src/lodepng/lodepng.texconv.o
|
||||
|
||||
# Add compilation units to this list to explicity compile them with
|
||||
# -O3 optimizations, while the rest get the default (-Os) treatment
|
||||
@@ -283,7 +286,17 @@ texconv: $(OBJS_TEXCONV) | pvrtex # You'll have to rebuild pvrtex manually if yo
|
||||
|
||||
TXD_OPTS_fonts = 256 256
|
||||
TXD_OPTS_hud = 128 128
|
||||
TXD_OPTS_menu = 512 512
|
||||
TXD_OPTS_menu = 512 512 \
|
||||
--include-tex assets/mapBot01.png mapBot01 \
|
||||
--include-tex assets/mapBot02.png mapBot02 \
|
||||
--include-tex assets/mapBot03.png mapBot03 \
|
||||
--include-tex assets/mapMid01.png mapMid01 \
|
||||
--include-tex assets/mapMid02.png mapMid02 \
|
||||
--include-tex assets/mapMid03.png mapMid03 \
|
||||
--include-tex assets/mapTop01.png mapTop01 \
|
||||
--include-tex assets/mapTop02.png mapTop02 \
|
||||
--include-tex assets/mapTop03.png mapTop03
|
||||
|
||||
TXD_OPTS_LOADSC0 = 512 512
|
||||
TXD_OPTS_LOADSC1 = 512 512
|
||||
TXD_OPTS_LOADSC10 = 512 512
|
||||
@@ -316,6 +329,22 @@ TXD_OPTS_NEWS = 512 512
|
||||
TXD_OPTS_SPLASH1 = 512 512
|
||||
TXD_OPTS_SPLASH2 = 512 512
|
||||
TXD_OPTS_SPLASH3 = 512 512
|
||||
TXD_OPTS_frontend = 512 512 \
|
||||
--delete-tex "fe_arrows4" \
|
||||
--delete-tex "fe_arrows2" \
|
||||
--delete-tex "fe_arrows1" \
|
||||
--delete-tex "fe_controllersh" \
|
||||
--delete-tex "fe_controller" \
|
||||
\
|
||||
--include-tex assets/dc_ps2d.png dc_ps2d \
|
||||
--include-tex assets/dc_ps2f.png dc_ps2f \
|
||||
--include-tex assets/dc_xboxd.png dc_xboxd \
|
||||
--include-tex assets/dc_xboxf.png dc_xboxf \
|
||||
--include-tex assets/ps4_d.png ps4_d \
|
||||
--include-tex assets/ps4_f.png ps4_f \
|
||||
--include-tex assets/xbox_d.png xbox_d \
|
||||
--include-tex assets/xbox_f.png xbox_f
|
||||
|
||||
DEFAULT_RES = 512
|
||||
|
||||
PVR_ENCODER ?= PVRTEX
|
||||
|
||||
BIN
dreamcast/assets/dc_ps2d.png
Normal file
|
After Width: | Height: | Size: 88 KiB |
BIN
dreamcast/assets/dc_ps2f.png
Normal file
|
After Width: | Height: | Size: 91 KiB |
BIN
dreamcast/assets/dc_xboxd.png
Normal file
|
After Width: | Height: | Size: 87 KiB |
BIN
dreamcast/assets/dc_xboxf.png
Normal file
|
After Width: | Height: | Size: 90 KiB |
BIN
dreamcast/assets/ps4_d.png
Normal file
|
After Width: | Height: | Size: 6.3 KiB |
BIN
dreamcast/assets/ps4_f.png
Normal file
|
After Width: | Height: | Size: 77 KiB |
BIN
dreamcast/assets/xbox_d.png
Normal file
|
After Width: | Height: | Size: 6.3 KiB |
BIN
dreamcast/assets/xbox_f.png
Normal file
|
After Width: | Height: | Size: 79 KiB |
@@ -3,6 +3,7 @@
|
||||
#include <cstring>
|
||||
|
||||
#include <set>
|
||||
#include <vector>
|
||||
|
||||
#include <iostream>
|
||||
using namespace std;
|
||||
@@ -238,6 +239,40 @@ PluginAttach(void)
|
||||
|
||||
const char* currentFile;
|
||||
|
||||
namespace rw {
|
||||
Image* readBMP(const char *filename);
|
||||
Image* readPNG(const char *filename);
|
||||
}
|
||||
|
||||
void InsertImage(RwTexDictionary* texDict, const char* file, const char* texName) {
|
||||
RwTexture *tex;
|
||||
RwRaster *raster;
|
||||
RwInt32 width, height, depth, format;
|
||||
RwImage *image = rw::readBMP(file);
|
||||
if (!image) {
|
||||
image = rw::readPNG(file);
|
||||
}
|
||||
|
||||
assert(image);
|
||||
|
||||
RwImageFindRasterFormat(image, rwRASTERTYPETEXTURE, &width, &height, &depth, &format);
|
||||
raster = RwRasterCreate(width, height, depth, format);
|
||||
RwRasterSetFromImage(raster, image);
|
||||
|
||||
tex = RwTextureCreate(raster);
|
||||
RwTextureSetName(tex, texName);
|
||||
|
||||
RwTextureSetFilterMode(tex, rwFILTERLINEAR);
|
||||
|
||||
RwTexDictionaryAddTexture(texDict, tex);
|
||||
|
||||
RwImageDestroy(image);
|
||||
}
|
||||
|
||||
std::vector<std::pair<const char*, const char*>> ImagesToAdd;
|
||||
std::vector<const char*> ImagesToRemove;
|
||||
bool listTextures = false;
|
||||
|
||||
int main(int argc, const char** argv) {
|
||||
if (argc >= 5) {
|
||||
int width = atoi(argv[3]);
|
||||
@@ -247,7 +282,7 @@ int main(int argc, const char** argv) {
|
||||
if(height >= 16 && height <= 1024)
|
||||
rw::dc::maxRasterHeight = height;
|
||||
}
|
||||
for (int i = 0; i < argc; i++) {
|
||||
for (int i = 5; i < argc; i++) {
|
||||
if (argv[i] != nullptr) {
|
||||
// Downsample Parameter
|
||||
if (strcmp(argv[i], "-d") == 0 || strcmp(argv[i], "-D") == 0) {
|
||||
@@ -271,6 +306,22 @@ int main(int argc, const char** argv) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (strcmp(argv[i], "--include-tex") == 0) {
|
||||
assert(i + 2 < argc);
|
||||
ImagesToAdd.emplace_back(argv[i+1], argv[i+2]);
|
||||
i += 2;
|
||||
}
|
||||
|
||||
if (strcmp(argv[i], "--delete-tex") == 0) {
|
||||
assert(i + 1 < argc);
|
||||
ImagesToRemove.emplace_back(argv[i+1]);
|
||||
i += 1;
|
||||
}
|
||||
|
||||
if (strcmp(argv[i], "--list-tex") == 0) {
|
||||
listTextures = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -298,6 +349,31 @@ int main(int argc, const char** argv) {
|
||||
|
||||
RwStreamClose(stream, nil);
|
||||
|
||||
if (listTextures) {
|
||||
fprintf(stdout, "Incoming textures:\n");
|
||||
FORLIST(lnk, texDict->textures) {
|
||||
auto tex = rw::Texture::fromDict(lnk);
|
||||
fprintf(stdout, "texture: '%s'\n", tex->name);
|
||||
}
|
||||
}
|
||||
|
||||
for (auto&& removedTextureName: ImagesToRemove) {
|
||||
auto removedTexture = texDict->find(removedTextureName);
|
||||
assert(removedTexture);
|
||||
texDict->remove(removedTexture);
|
||||
}
|
||||
for (auto&& extraTexture: ImagesToAdd) {
|
||||
InsertImage(texDict, extraTexture.first, extraTexture.second);
|
||||
}
|
||||
|
||||
if (listTextures) {
|
||||
fprintf(stdout, "Processing textures:\n");
|
||||
FORLIST(lnk, texDict->textures) {
|
||||
auto tex = rw::Texture::fromDict(lnk);
|
||||
fprintf(stdout, "texture: '%s'\n", tex->name);
|
||||
}
|
||||
}
|
||||
|
||||
auto streamOut = RwStreamOpen(rwSTREAMFILENAME, rwSTREAMWRITE, argv[2]);
|
||||
assert(streamOut && "failed to open output");
|
||||
|
||||
|
||||
@@ -174,6 +174,10 @@ public:
|
||||
|
||||
void UpdateEffectsVolume(void);
|
||||
|
||||
#ifdef DC_SH4
|
||||
void UpdateChannelVolume(uint32 nChannel);
|
||||
#endif
|
||||
|
||||
void SetEffectsMasterVolume(uint8 nVolume);
|
||||
void SetMusicMasterVolume (uint8 nVolume);
|
||||
void SetEffectsFadeVolume (uint8 nVolume);
|
||||
|
||||
@@ -151,7 +151,6 @@ void aica_snd_sfx_freq_vol(int chn, int freq, int vol) {
|
||||
|
||||
cSampleManager SampleManager;
|
||||
bool8 _bSampmanInitialised = FALSE;
|
||||
bool _dcAudioInitialized = false;
|
||||
|
||||
uint32 BankStartOffset[MAX_SFX_BANKS];
|
||||
char SampleBankDescFilename[] = "sfx/sfx_all.dsc";
|
||||
@@ -462,7 +461,7 @@ cSampleManager::Initialise(void)
|
||||
|
||||
assert(fdPedSfx >= 0);
|
||||
|
||||
_dcAudioInitialized = true;
|
||||
_bSampmanInitialised = true;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@@ -485,7 +484,14 @@ char cSampleManager::GetCDAudioDriveLetter(void)
|
||||
void
|
||||
cSampleManager::UpdateEffectsVolume(void)
|
||||
{
|
||||
// TODO
|
||||
if(_bSampmanInitialised) {
|
||||
std::lock_guard<std::mutex> lk(channel_mtx);
|
||||
for (int i = 0; i < MAXCHANNELS+MAX2DCHANNELS; i++) {
|
||||
if (channels[i].ch != -1) {
|
||||
UpdateChannelVolume(i);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -851,9 +857,10 @@ cSampleManager::InitialiseChannel(uint32 nChannel, uint32 nSfx, uint8 nBank)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void updateVol(uint32 nChannel) {
|
||||
void cSampleManager::UpdateChannelVolume(uint32 nChannel) {
|
||||
|
||||
auto newVol = channels[nChannel].emittingVol * channels[nChannel].attenuationVol / 255;
|
||||
newVol = m_nEffectsFadeVolume * newVol * m_nEffectsVolume >> 14;
|
||||
// newVol = 255;
|
||||
// printf("updateVol(nChannel: %d) vol: %d, newVol: %d\n", nChannel, channels[nChannel].vol, newVol);
|
||||
if (channels[nChannel].vol != newVol) {
|
||||
@@ -876,7 +883,7 @@ cSampleManager::SetChannelVolume(uint32 nChannel, uint32 nVolume)
|
||||
channels[nChannel].emittingVol = linearlize_volume(nVolume);// nVolume * 255 / MAX_VOLUME;
|
||||
channels[nChannel].attenuationVol = 255;
|
||||
|
||||
updateVol(nChannel);
|
||||
UpdateChannelVolume(nChannel);
|
||||
verbosef("SetChannelVolume(nChannel: %d) vol: %d\n", nChannel, nVolume);
|
||||
}
|
||||
|
||||
@@ -1182,6 +1189,7 @@ cSampleManager::SetStreamedVolumeAndPan(uint8 nVolume, uint8 nPan, uint8 nEffect
|
||||
if (nVolume > MAX_VOLUME)
|
||||
nVolume = MAX_VOLUME;
|
||||
nVolume = linearlize_volume(nVolume); //nVolume * 255 / MAX_VOLUME;
|
||||
nVolume = m_nMusicFadeVolume * nVolume * m_nMusicVolume >> 14;
|
||||
if (streams[nStream].vol != nVolume || streams[nStream].nPan != nPan) {
|
||||
streams[nStream].vol = nVolume;
|
||||
streams[nStream].nPan = nPan;
|
||||
@@ -1293,9 +1301,17 @@ void cSampleManager::SetChannelEmittingVolume(uint32 nChannel, uint32 nVolume)
|
||||
if (nVolume > MAX_VOLUME)
|
||||
nVolume = MAX_VOLUME;
|
||||
|
||||
// reduce channel volume when JB.MP3 or S4_BDBD.MP3 playing
|
||||
if ( MusicManager.GetMusicMode() == MUSICMODE_CUTSCENE
|
||||
&& MusicManager.GetNextTrack() != STREAMED_SOUND_NEWS_INTRO
|
||||
&& MusicManager.GetNextTrack() != STREAMED_SOUND_CUTSCENE_SAL4_BDBD )
|
||||
{
|
||||
nVolume /= 4;
|
||||
}
|
||||
|
||||
std::lock_guard<std::mutex> lk(channel_mtx);
|
||||
channels[nChannel].emittingVol = linearlize_volume(nVolume); // nVolume * 255 / MAX_VOLUME;
|
||||
updateVol(nChannel);
|
||||
UpdateChannelVolume(nChannel);
|
||||
}
|
||||
|
||||
float calculatePan(float x, float z) {
|
||||
@@ -1340,7 +1356,7 @@ void cSampleManager::SetChannel3DPosition (uint32 nChannel, float fX, float
|
||||
channels[nChannel].fY = fY;
|
||||
channels[nChannel].fZ = fZ;
|
||||
channels[nChannel].attenuationVol = calculateAttenuation(channels[nChannel].fX, channels[nChannel].fY, channels[nChannel].fZ, channels[nChannel].distMin, channels[nChannel].distMax) * 255;
|
||||
updateVol(nChannel);
|
||||
UpdateChannelVolume(nChannel);
|
||||
}
|
||||
|
||||
SetChannelPan(nChannel, calculatePan(-fX, fZ) * 63 + 64);
|
||||
@@ -1353,7 +1369,7 @@ void cSampleManager::SetChannel3DDistances (uint32 nChannel, float fMax, floa
|
||||
channels[nChannel].distMin = fMin;
|
||||
channels[nChannel].distMax = fMax;
|
||||
channels[nChannel].attenuationVol = calculateAttenuation(channels[nChannel].fX, channels[nChannel].fY, channels[nChannel].fZ, channels[nChannel].distMin, channels[nChannel].distMax) * 255;
|
||||
updateVol(nChannel);
|
||||
UpdateChannelVolume(nChannel);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
@@ -379,7 +379,7 @@ enum Config {
|
||||
# define CUSTOM_FRONTEND_OPTIONS
|
||||
|
||||
# ifdef CUSTOM_FRONTEND_OPTIONS
|
||||
# define MENU_MAP // VC-like menu map. Won't appear if you don't have our menu.txd
|
||||
# define MENU_MAP // Enabled on Dca3 now, but could use some controller mapping**
|
||||
# define GRAPHICS_MENU_OPTIONS // otherwise Display settings will be scrollable
|
||||
# define NO_ISLAND_LOADING // disable loadscreen between islands via loading all island data at once, consumes more memory and CPU
|
||||
# define CUTSCENE_BORDERS_SWITCH
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
# include <dc/sound/sound.h>
|
||||
# endif
|
||||
|
||||
extern bool _dcAudioInitialized;
|
||||
extern bool _bSampmanInitialised;
|
||||
|
||||
// ====== STATIC METHODS =====
|
||||
|
||||
@@ -86,7 +86,7 @@ void VmuProfiler::run() {
|
||||
|
||||
#ifdef DC_SH4
|
||||
if(auto *dev = maple_enum_type(0, MAPLE_FUNC_MEMCARD);
|
||||
dev && _dcAudioInitialized && updated_)
|
||||
dev && _bSampmanInitialised && updated_)
|
||||
{
|
||||
pvr_stats_t pvrStats; pvr_get_stats(&pvrStats);
|
||||
uint32_t sramStats = snd_mem_available();
|
||||
|
||||
28
vendor/librw/src/dc/rwdc.cpp
vendored
@@ -174,7 +174,6 @@ static pvr_dr_state_t drState;
|
||||
#include <kos/dbglog.h>
|
||||
|
||||
#if !defined(DC_TEXCONV) && !defined(DC_SIM)
|
||||
#include "Timecycle.h"
|
||||
#include <kos.h>
|
||||
|
||||
#define VIDEO_MODE_WIDTH vid_mode->width
|
||||
@@ -307,6 +306,7 @@ void rw_mat_load_4x4(rw::Matrix* mtx) {
|
||||
#define pvr_fog_table_color(a,r,g,b)
|
||||
#define pvr_fog_table_linear(s,e)
|
||||
#define pvr_fog_table_exp(d)
|
||||
#define pvr_fog_table_custom(d)
|
||||
#endif
|
||||
|
||||
#define mat_trans_single3_nomod(x_, y_, z_, x2, y2, z2) do { \
|
||||
@@ -665,7 +665,10 @@ void malloc_stats() { }
|
||||
#define UNIMPL_LOGV(...)
|
||||
#endif
|
||||
|
||||
Camera* rwdcCam;
|
||||
|
||||
void beginUpdate(Camera* cam) {
|
||||
rwdcCam = cam;
|
||||
float view[16], proj[16];
|
||||
|
||||
// View Matrix
|
||||
@@ -1203,7 +1206,7 @@ setRenderState(int32 state, void *pvalue)
|
||||
case FOGCOLOR:
|
||||
#if !defined(DC_TEXCONV)
|
||||
// Set fog color when state changes
|
||||
if(fogColor != value || fogStart != CTimeCycle::GetFogStart()) {
|
||||
if(fogColor != value || fogStart != RwCameraGetFogDistance(rwdcCam)) {
|
||||
fogColor = value;
|
||||
RGBA c;
|
||||
c.red = value;
|
||||
@@ -1212,16 +1215,17 @@ setRenderState(int32 state, void *pvalue)
|
||||
c.alpha = value>>24;
|
||||
pvr_fog_table_color(c.alpha / 255.0f, c.red / 255.0f, c.green / 255.0f, c.blue / 255.0f);
|
||||
|
||||
fogStart = CTimeCycle::GetFogStart();
|
||||
//pvr_fog_table_linear(fogStart + 200.0f, fogStart + 450.0f);
|
||||
|
||||
// Fog ranges between -200 (Most Fog) and +100 (least fog) (these are loaded from TIMECYC.DAT)
|
||||
// This formula will transform these values into a density between 0 and 0.02f
|
||||
const float MAX_DENSITY = 0.02f;
|
||||
const float FOG_RANGE = 300.0f;
|
||||
const float FOG_OFFSET = 200.0f;
|
||||
float density = ((FOG_RANGE - (fogStart + FOG_OFFSET)) / FOG_RANGE) * MAX_DENSITY;
|
||||
pvr_fog_table_exp(density);
|
||||
fogStart = RwCameraGetFogDistance(rwdcCam);
|
||||
float fogEnd = RwCameraGetFarClipPlane(rwdcCam);
|
||||
float fogIntensity[129];
|
||||
uint8_t idx = 0;
|
||||
float startIntensity = (-fogStart) / (fogEnd - fogStart); //interpolate between start and end to get initial intensity
|
||||
float step = (1.0f - startIntensity) / 129; // we have 129 entries, create a step such that start + (step*129) = 1.0
|
||||
for(int i = 128; i >= 0; i--) {
|
||||
fogIntensity[i] = startIntensity + (idx++ * step);
|
||||
}
|
||||
pvr_fog_far_depth(fogEnd);
|
||||
pvr_fog_table_custom(fogIntensity);
|
||||
}
|
||||
#endif
|
||||
break;
|
||||
|
||||