Compare commits
50 Commits
alpha-rc0
...
ph3nom/fsa
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
dac22aedf0 | ||
|
|
1fcf0a2338 | ||
|
|
714f34464e | ||
|
|
214d913c4a | ||
|
|
2065c9a93f | ||
|
|
a2caa56275 | ||
|
|
fa65f637ad | ||
|
|
0a0a664428 | ||
|
|
5abd0641a4 | ||
|
|
ca866bdb2a | ||
|
|
bf0e36858e | ||
|
|
b90e8433da | ||
|
|
133110c15c | ||
|
|
6f71cfc458 | ||
|
|
02d0103b20 | ||
|
|
72da27ef0b | ||
|
|
ff9df6c760 | ||
|
|
0c0d8c88b6 | ||
|
|
ab6a65ba4f | ||
|
|
d8b6a02494 | ||
|
|
d6e5be5a5d | ||
|
|
a6a3b9e7b4 | ||
|
|
ddfc21dd97 | ||
|
|
62bfbbc3a7 | ||
|
|
a4342f3abf | ||
|
|
8023daf18a | ||
|
|
6c39b294ca | ||
|
|
2e0dcf9c3f | ||
|
|
77e43aa727 | ||
|
|
e7b97ed558 | ||
|
|
d0c97eedb5 | ||
|
|
267f39b9fd | ||
|
|
76c5fae015 | ||
|
|
f179638f46 | ||
|
|
8e6a952da3 | ||
|
|
970ac8c691 | ||
|
|
fcd2e4bb91 | ||
|
|
1e03ff65d8 | ||
|
|
c458e6c466 | ||
|
|
a12489844b | ||
|
|
d06d827833 | ||
|
|
0e3fd254b0 | ||
|
|
0bfd0a3b06 | ||
|
|
9a91660f50 | ||
|
|
5a7dd57720 | ||
|
|
292a83165b | ||
|
|
4e8f09ac66 | ||
|
|
d523140fa4 | ||
|
|
6a1fbd3704 | ||
|
|
4c07bbfd53 |
2
.gitignore
vendored
2
.gitignore
vendored
@@ -387,4 +387,6 @@ dreamcast/aud2adpcm*
|
||||
dreamcast/repack-data
|
||||
dreamcast/output.map
|
||||
dreamcast/dca3.ds.iso
|
||||
dreamcast/git-version.h
|
||||
dreamcast/git-version.tmp
|
||||
.DS_Store
|
||||
|
||||
67
README.md
67
README.md
@@ -6,15 +6,70 @@ re3 a fully reversed source code for GTA III.
|
||||
|
||||
This project was started by [Stefanos Kornilios Mitsis Poiitidis](https://x.com/poiitidis) and uses [KallistiOS](https://kos-docs.dreamcast.wiki/).
|
||||
|
||||
## Building
|
||||
## Baking the CDI
|
||||
### Prerequisites
|
||||
You need GTA 3 installed. This version has been tested and works: https://store.rockstargames.com/game/buy-grand-theft-auto-the-trilogy.
|
||||
|
||||
dca3 requires PC game assets to work, so you **must** have GTA III. We have tested the 2cd version, others might work.
|
||||
Please note that *SOME VERSIONS* of the game may not work. It has been reported that `d4_gta.mp3` is corrupted sometimes.
|
||||
|
||||
You need to have installed:
|
||||
Make sure you have a LEGIT copy with no corrupted files, as this process wont work otherwise.
|
||||
|
||||
- GTA III PC
|
||||
- [DreamSDK R3](https://github.com/dreamsdk/dreamsdk/releases/tag/r3-3.0.4.2311)
|
||||
- more instructions to follow soon
|
||||
You will also need the following tools installed
|
||||
- git-scm http://git-scm.com/downloads/win
|
||||
- dreamsdk r3 https://github.com/dreamsdk/dreamsdk/releases
|
||||
|
||||
### Preparing the gta3 folder
|
||||
- Open dreamsdk shell
|
||||
- type `mkdir gta3` (and press enter)
|
||||
- type `explorer .` (and press enter)
|
||||
- This will open a folder named gta3. Copy your gta3 files in there.
|
||||
- If you use the 2cdrom version of the game, make sure to also copy the contents of the play disc to this folder.
|
||||
- close the folder and the dreamsdk shell and proceed to the next step.
|
||||
|
||||
### Cloning the dca3-game repo and downloading the prebuilt elf
|
||||
- Open dreamsdk shell
|
||||
- type `git clone --branch alpha https://gitlab.com/skmp/dca3-game.git` (and press enter)
|
||||
- It should take a moment and successfully clone the repo
|
||||
- type `cd dca3-game/dreamcast` (and press enter)
|
||||
- type `explorer .` (and press enter).
|
||||
- A folder named dreamcast with some files should be open. Keep it on the side.
|
||||
- Download the Alpha Prebuilt Elf from https://gitlab.com/skmp/dca3-game/-/releases
|
||||
- Open artifacts.zip and extract dca3.elf to the folder that was kept open before.
|
||||
- Close the folder and dreamsdk shell
|
||||
|
||||
### Repacking and making a prebuilt cdi FOR GD-EMU
|
||||
- Open dreamsdk shell
|
||||
- type `cd dca3-game/dreamcast` (and press enter)
|
||||
- type `make cdi-prebuilt` (and press enter)
|
||||
- This should take a while (5-15 mins)
|
||||
- Due to an issue with dreamsdk, this won't fully complete the first time
|
||||
- type `make cdi-prebuilt` (and press enter)
|
||||
- It will continue where it left off before
|
||||
- It should run to completion now and show "*** Repack Completed Successfully ***"
|
||||
- type `explorer .` (and press enter)
|
||||
- The dreamcast folder should open up, and it should contain dca3.cdi for you (~ 900 megs)
|
||||
|
||||
### Repacking and making a prebuilt cdi FOR burning CD-ROM
|
||||
- Open dreamsdk shell
|
||||
- type `cd dca3-game/dreamcast` (and press enter)
|
||||
- type `make FOR_DISC=1 cdi-prebuilt` (and press enter)
|
||||
- This should take a while (5-15 mins)
|
||||
- Due to an issue with dreamsdk, this won't fully complete the first time
|
||||
- type `make FOR_DISC=1 cdi-prebuilt` (and press enter)
|
||||
- It will continue where it left off before
|
||||
- It should run to completion now and show "*** Repack Completed Successfully ***"
|
||||
- type `explorer .` (and press enter)
|
||||
- The dreamcast folder should open up, and it should contain dca3.cdi for you (~ 700 megs or ~260 megs)
|
||||
- If the .cdi is not ~ 700 megs (linux/mkdcdisc) or ~260 megs (windows/cdi4dc), then you did something wrong.
|
||||
- You can type `rm -rf repack-data` (and press enter)
|
||||
- And then start this step from the beggining
|
||||
|
||||
|
||||
## How to report issues
|
||||
- Take a photo of your tv/monitor and vmu
|
||||
- open a ticket via https://gitlab.com/skmp/dca3-game/-/issues/new
|
||||
- state which elf you have used (eg, https://gitlab.com/skmp/dca3-game/-/jobs/8725216645)
|
||||
- write something descriptive of what is/went wrong
|
||||
|
||||
## License
|
||||
|
||||
|
||||
@@ -40,6 +40,8 @@ AUDIO_STREAM_OPTION=-q
|
||||
MKDCDISC_PAD_OPTION=
|
||||
endif
|
||||
|
||||
all: $(TARGET)
|
||||
|
||||
include common.mk
|
||||
|
||||
OBJS = $(RE3_OBJS) $(RW_OBJS) \
|
||||
@@ -100,11 +102,11 @@ OBJS_NO_FAST_MATH = \
|
||||
KOS_CPPFLAGS += -fbuiltin -ffast-math -ffp-contract=fast \
|
||||
-mfsrra -mfsca
|
||||
|
||||
# The rm-elf step is to remove the target before building, to force the
|
||||
# re-creation of the rom disk.
|
||||
all: $(TARGET)
|
||||
|
||||
ifdef KOS_BASE
|
||||
include $(KOS_BASE)/Makefile.rules
|
||||
else
|
||||
$(warning "KOS_BASE is not set. Only prebuilt targets will work.")
|
||||
endif
|
||||
|
||||
DEPS = $(OBJS:.o=.d) $(OBJS_TEXCONV:.o:.d)
|
||||
|
||||
@@ -153,7 +155,7 @@ $(OBJS_NO_FAST_MATH): %.o: %.cpp
|
||||
|
||||
$(TARGET): $(OBJS)
|
||||
kos-c++ -o $(TARGET) $(OBJS) -Wl,--gc-sections -Wl,--as-needed -Wl,-Map,output.map \
|
||||
-flto=auto $(if $(WITH_IDE),-lkosfat) $(if $(WITH_SD),-lkosfat)
|
||||
-flto=auto $(if $(WITH_IDE),-lkosfat) $(if $(WITH_SD),-lkosfat) -Wl,--build-id=sha1
|
||||
@echo && echo && echo "*** Build Completed Successfully ***" && echo && echo
|
||||
|
||||
run: $(TARGET)
|
||||
@@ -210,22 +212,28 @@ $(PROJECT_NAME)-prebuilt.iso: IP.BIN 1ST_READ_PREBUILT.BIN $(REPACK_DIR)/repacke
|
||||
ifeq ($(HAVE_CDI4DC), yes)
|
||||
$(PROJECT_NAME).cdi: $(PROJECT_NAME).iso
|
||||
cdi4dc $(PROJECT_NAME).iso $(PROJECT_NAME).cdi > cdi.log
|
||||
@echo && echo && echo "*** CDI Baked Successfully ***" && echo && echo
|
||||
|
||||
$(PROJECT_NAME)-no-repack.cdi: $(PROJECT_NAME)-no-repack.iso
|
||||
cdi4dc $(PROJECT_NAME)-no-repack.iso $(PROJECT_NAME)-no-repack.cdi > cdi.log
|
||||
@echo && echo && echo "*** CDI Baked Successfully ***" && echo && echo
|
||||
|
||||
$(PROJECT_NAME)-prebuilt.cdi: $(PROJECT_NAME)-prebuilt.iso
|
||||
cdi4dc $(PROJECT_NAME).iso $(PROJECT_NAME).cdi > cdi.log
|
||||
rm 1ST_READ_PREBUILT.BIN
|
||||
@echo && echo && echo "*** CDI Baked Successfully ***" && echo && echo
|
||||
else
|
||||
$(PROJECT_NAME).cdi: $(TARGET) $(REPACK_DIR)/repacked $(REPACK_GTA_DIR)/GTA3SF8.b
|
||||
mkdcdisc -e $(TARGET) -o $(PROJECT_NAME).cdi -d $(REPACK_GTA_DIR)/ $(MKDCDISC_PAD_OPTION) -n DCA3 -a "the gang"
|
||||
@echo && echo && echo "*** CDI Baked Successfully ***" && echo && echo
|
||||
|
||||
$(PROJECT_NAME)-no-repack.cdi: $(TARGET) $(REPACK_GTA_DIR)/GTA3SF8.b
|
||||
mkdcdisc -e $(TARGET) -o $(PROJECT_NAME)-no-repack.cdi -d $(REPACK_GTA_DIR)/ $(MKDCDISC_PAD_OPTION) -n DCA3 -a "the gang"
|
||||
@echo && echo && echo "*** CDI Baked Successfully ***" && echo && echo
|
||||
|
||||
$(PROJECT_NAME)-prebuilt.cdi: $(REPACK_DIR)/repacked $(REPACK_GTA_DIR)/GTA3SF8.b
|
||||
mkdcdisc -e $(TARGET) -o $(PROJECT_NAME).cdi -d $(REPACK_GTA_DIR)/ $(MKDCDISC_PAD_OPTION) -n DCA3 -a "the gang"
|
||||
@echo && echo && echo "*** CDI Baked Successfully ***" && echo && echo
|
||||
endif
|
||||
|
||||
cdi: $(PROJECT_NAME).cdi
|
||||
@@ -345,7 +353,8 @@ STREAM_WAV_DECODED = $(addprefix $(REPACK_STREAM_DECODED_DIR)/, $(STREAM_WAV))
|
||||
|
||||
$(REPACK_DIR)/repacked: $(REPACK_GTA_DIR)/models/gta3.img $(REPACK_GTA_DIR)/models/gta3.dir $(LOOSE_FILES_DC) $(STREAM_ADPCM_DC) $(SFX_DC_RAW) $(SFX_DC_DSC)
|
||||
mkdir -p $(@D)
|
||||
touch $@
|
||||
@git archive --format zip --output "$(REPACK_GTA_DIR)/DCA3-$(GIT_VERSION).zip" HEAD
|
||||
@touch $@
|
||||
@echo && echo && echo "*** Repack Completed Successfully ***" && echo && echo
|
||||
|
||||
$(REPACK_DIR)/unpacked: imgtool $(GTA_DIR)/models/gta3.img $(GTA_DIR)/models/gta3.dir
|
||||
@@ -425,20 +434,20 @@ $(REPACK_DIR)/packed: $(IMG_TEXTURES_DC) $(IMG_MODELS_DC)
|
||||
mkdir -p $(@D)
|
||||
mkdir -p "$(REPACK_GTA_DIR)/models/gta3"
|
||||
./imgtool pack "$(REPACK_GTA_DIR)/models/gta3" "$(REPACK_IMG_DC_DIR)"
|
||||
touch $@
|
||||
@touch $@
|
||||
|
||||
$(REPACK_GTA_DIR)/models/gta3.img $(REPACK_GTA_DIR)/models/gta3.dir: $(REPACK_DIR)/packed
|
||||
touch $@
|
||||
@touch $@
|
||||
|
||||
# sfx processing
|
||||
$(REPACK_DIR)/unpacked-sfx: extract-sfx $(GTA_DIR)/audio/sfx.SDT $(GTA_DIR)/audio/sfx.RAW
|
||||
mkdir -p $(@D)
|
||||
mkdir -p "$(REPACK_SFX_ORIG_DIR)"
|
||||
./extract-sfx "$(GTA_DIR)/audio/sfx.SDT" "$(GTA_DIR)/audio/sfx.RAW" "$(REPACK_SFX_ORIG_DIR)"
|
||||
touch $@
|
||||
@touch $@
|
||||
|
||||
$(SFX_ORIG): $(REPACK_DIR)/unpacked-sfx
|
||||
touch $@
|
||||
@touch $@
|
||||
|
||||
$(SFX_ORIG_LOOP): $(SFX_ORIG)
|
||||
@touch $@
|
||||
|
||||
@@ -278,17 +278,17 @@ int validate_wav_header(wavhdr_t *wavhdr, wavhdr3_t *wavhdr3, int format, int bi
|
||||
|
||||
if (memcmp(wavhdr->hdr1, "RIFF", 4)) {
|
||||
fprintf(stderr, "Invalid RIFF header.\n");
|
||||
result = -1;
|
||||
result = 1;
|
||||
}
|
||||
|
||||
if (memcmp(wavhdr->hdr2, "WAVEfmt ", 8)) {
|
||||
fprintf(stderr, "Invalid WAVEfmt header.\n");
|
||||
result = -1;
|
||||
result = 1;
|
||||
}
|
||||
|
||||
if (wavhdr->hdrsize < 0x10) {
|
||||
fprintf(stderr, "Invalid header size, %d bytes\n", wavhdr->hdrsize);
|
||||
result = -1;
|
||||
result = 1;
|
||||
} else if (wavhdr->hdrsize > 0x10) {
|
||||
fprintf(stderr, "Unusual header size, seeking %d bytes\n", wavhdr->hdrsize - 0x10);
|
||||
fseek(in, wavhdr->hdrsize - 0x10, SEEK_CUR);
|
||||
@@ -296,29 +296,29 @@ int validate_wav_header(wavhdr_t *wavhdr, wavhdr3_t *wavhdr3, int format, int bi
|
||||
|
||||
if (wavhdr->format != format) {
|
||||
fprintf(stderr, "Unsupported format.\n");
|
||||
result = -1;
|
||||
result = 1;
|
||||
}
|
||||
|
||||
if (wavhdr->channels != 1 && wavhdr->channels != 2) {
|
||||
fprintf(stderr, "Unsupported number of channels.\n");
|
||||
result = -1;
|
||||
result = 1;
|
||||
}
|
||||
|
||||
if (wavhdr->bits != bits) {
|
||||
fprintf(stderr, "Unsupported bit depth.\n");
|
||||
result = -1;
|
||||
result = 1;
|
||||
}
|
||||
|
||||
for (;;) {
|
||||
if (fread(wavhdr3->hdr3, 1, 4, in) != 4) {
|
||||
fprintf(stderr, "Failed to read next chunk header!\n");
|
||||
result = -1;
|
||||
result = 1;
|
||||
break;
|
||||
}
|
||||
|
||||
if (fread(&wavhdr3->datasize, 1, 4, in) != 4) {
|
||||
fprintf(stderr, "Failed to read chunk size!\n");
|
||||
result = -1;
|
||||
result = 1;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -446,7 +446,7 @@ int aud2adpcm(const char *infile, const char *outfile, int use_hdr, int to_mono,
|
||||
!loadMp3(infile, &pcmsize, &pcmbuf, &channels, &freq) &&
|
||||
!loadWavIMA(infile, &pcmsize, &pcmbuf, &channels, &freq)) {
|
||||
fprintf(stderr, "Cannot load input file as wav, mp3, or IMA ADPCM.\n");
|
||||
return -1;
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (to_mono && channels == 2) {
|
||||
@@ -544,7 +544,7 @@ int aud2adpcm(const char *infile, const char *outfile, int use_hdr, int to_mono,
|
||||
fclose(out);
|
||||
free(pcmbuf);
|
||||
free(adpcmbuf);
|
||||
return -1;
|
||||
return 1;
|
||||
}
|
||||
|
||||
fclose(out);
|
||||
@@ -567,6 +567,7 @@ void usage() {
|
||||
}
|
||||
|
||||
int main(int argc, char **argv) {
|
||||
|
||||
if (argc == 4) {
|
||||
if (!strcmp(argv[1], "-t")) {
|
||||
return aud2adpcm(argv[2], argv[3], 1, 0, 0);
|
||||
@@ -576,10 +577,10 @@ int main(int argc, char **argv) {
|
||||
return aud2adpcm(argv[2], argv[3], 0, 0, 0);
|
||||
} else {
|
||||
usage();
|
||||
return -1;
|
||||
return 1;
|
||||
}
|
||||
} else {
|
||||
usage();
|
||||
return -1;
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,3 +1,28 @@
|
||||
GIT_VERSION := $(shell git describe --always --tags --long --dirty 2>/dev/null || echo "NO_GIT")
|
||||
CI_JOB_ID ?= 00000000
|
||||
|
||||
|
||||
git-version.tmp:
|
||||
@echo "Generating git-version.tmp with GIT_VERSION = \"$(GIT_VERSION)\""
|
||||
@echo "#pragma once" > git-version.tmp
|
||||
@echo "#ifndef VERSION_H" >> git-version.tmp
|
||||
@echo "#define VERSION_H" >> git-version.tmp
|
||||
@echo "#define GIT_VERSION \"$(GIT_VERSION)\"" >> git-version.tmp
|
||||
@echo "#define CI_JOB_ID \"$(CI_JOB_ID)\"" >> git-version.tmp
|
||||
@echo "#endif // VERSION_H" >> git-version.tmp
|
||||
|
||||
git-version.h: git-version.tmp
|
||||
@if [ ! -f git-version.h ] || ! cmp -s git-version.tmp git-version.h; then \
|
||||
echo "Updating git-version.h"; \
|
||||
cp git-version.tmp git-version.h; \
|
||||
else \
|
||||
echo "git-version.h is up to date. No change."; \
|
||||
fi
|
||||
|
||||
.PHONY: git-version.tmp
|
||||
|
||||
../src/skel/dc/dc.cpp: git-version.h
|
||||
|
||||
|
||||
# List all of your C files here, but change the extension to ".o"
|
||||
# Include "romdisk.o" if you want a rom disk.
|
||||
|
||||
@@ -3,6 +3,8 @@ TARGET ?= dca3-sim.elf
|
||||
IS_MAC := $(shell uname -s | grep -i "darwin" > /dev/null && echo "yes" || echo "no")
|
||||
|
||||
|
||||
all: $(TARGET)
|
||||
|
||||
include common.mk
|
||||
|
||||
OBJS = $(RE3_OBJS) $(RW_OBJS) \
|
||||
@@ -52,8 +54,6 @@ else
|
||||
$(CXX) -msse2 -mfpmath=sse -c -O3 -g -fno-pic -no-pie -o $@ $(CXXFLAGS) -I../vendor/koshle -I../vendor/emu -m32 -U_WIN32 -UWIN32 -UWINNT -Ui386 -DDC_SIM -D_FILE_OFFSET_BITS=64 $<
|
||||
endif
|
||||
|
||||
all: $(TARGET)
|
||||
|
||||
clean:
|
||||
-rm -f $(OBJS_SIM) $(TARGET)
|
||||
|
||||
|
||||
@@ -314,7 +314,7 @@ int main(int argc, const char** argv) {
|
||||
StoreModelFile(argv[2], clump);
|
||||
} else {
|
||||
printf("Invalid format: %s\n", argv[1]);
|
||||
return -1;
|
||||
return 1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
@@ -3,100 +3,10 @@
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>DCA3 - A port of RE3 for Dreamcast</title>
|
||||
<!-- Bootstrap CSS -->
|
||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet">
|
||||
<style>
|
||||
body {
|
||||
background-color: #121212;
|
||||
color: #ffffff;
|
||||
}
|
||||
.navbar {
|
||||
background-color: #1f1f1f;
|
||||
}
|
||||
.hero {
|
||||
text-align: center;
|
||||
padding: 100px 20px;
|
||||
background-color: #333333;
|
||||
border-radius: 10px;
|
||||
}
|
||||
.features {
|
||||
margin-top: 50px;
|
||||
}
|
||||
.footer {
|
||||
text-align: center;
|
||||
padding: 20px;
|
||||
background-color: #1f1f1f;
|
||||
margin-top: 20px;
|
||||
border-radius: 10px;
|
||||
}
|
||||
</style>
|
||||
<title>DCA3 Redirect</title>
|
||||
<meta http-equiv="refresh" content="5;url=https://dca3.net">
|
||||
</head>
|
||||
<body>
|
||||
<!-- Navbar -->
|
||||
<nav class="navbar navbar-expand-lg navbar-dark">
|
||||
<div class="container">
|
||||
<a class="navbar-brand" href="#">DCA3</a>
|
||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav">
|
||||
<span class="navbar-toggler-icon"></span>
|
||||
</button>
|
||||
<div class="collapse navbar-collapse" id="navbarNav">
|
||||
<ul class="navbar-nav ms-auto">
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="#">Home</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="#features">Features</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="#download">Download</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
|
||||
<!-- Hero Section -->
|
||||
<div class="container">
|
||||
<div class="hero mt-4">
|
||||
<h1>DCA3</h1>
|
||||
<p>The first-ever port of Grand Theft Auto III to the SEGA Dreamcast, built from the REGTA reverse engineering project.</p>
|
||||
<a href="#download" class="btn btn-primary">Download Now</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Features Section -->
|
||||
<div class="container features text-center">
|
||||
<h2 id="features" class="mb-4">Key Features</h2>
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
<h3>Faithful Port</h3>
|
||||
<p>Experience GTA3 as it was meant to be, now on the Dreamcast with okay visuals and sluggish gameplay.</p>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<h3>Open Source</h3>
|
||||
<p>Built on the REGTA reverse engineering project, ensuring accuracy and community-driven development.</p>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<h3>First Release</h3>
|
||||
<p>Celebrating our first release with not very much optimized performance and compatibility for Dreamcast hardware.</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Download Section -->
|
||||
<div class="container text-center mt-5">
|
||||
<h2 id="download" class="mb-4">Download DCA3</h2>
|
||||
<p>Get started with the first release of and bring GTA3 to your Dreamcast. You'll need a PC copy of GTA3 to create your .cdi</p>
|
||||
<a href="#" class="btn btn-success btn-lg">Download Version 1.0</a>
|
||||
</div>
|
||||
|
||||
<!-- Footer -->
|
||||
<footer class="footer mt-4">
|
||||
<p>No rights reserved. Made with love for the Dreamcast community.</p>
|
||||
</footer>
|
||||
|
||||
<!-- Bootstrap JS Bundle -->
|
||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js"></script>
|
||||
<p>You will be redirected to <a href="https://dca3.net">dca3.net</a> in 5 seconds.</p>
|
||||
</body>
|
||||
</html>
|
||||
</html>
|
||||
@@ -6302,7 +6302,7 @@ cPedComments::Process()
|
||||
{
|
||||
case LOADING_STATUS_NOT_LOADED:
|
||||
SampleManager.LoadPedComment(sampleIndex);
|
||||
#ifdef GTA_PS2 // on PC ped comment is loaded at once
|
||||
#if defined(GTA_PS2) || defined(RW_DC) // on PC ped comment is loaded at once
|
||||
break;
|
||||
#endif
|
||||
case LOADING_STATUS_LOADED:
|
||||
|
||||
@@ -166,8 +166,12 @@ struct sfx_bank {
|
||||
std::map<int, sfx_bank> sfx_banks;
|
||||
|
||||
int nPedSlotSfx[MAX_PEDSFX];
|
||||
uint32 nPedSlotSfxReqId[MAX_PEDSFX];
|
||||
uintptr_t nPedSlotSfxAddr[MAX_PEDSFX];
|
||||
uint8_t nCurrentPedSlot;
|
||||
file_t fdPedSfx;
|
||||
volatile uint32 nPedSfxReqReadId = 1;
|
||||
volatile uint32 nPedSfxReqNextId = 1;
|
||||
|
||||
struct WavHeader {
|
||||
// RIFF Header
|
||||
@@ -442,15 +446,22 @@ cSampleManager::Initialise(void)
|
||||
}
|
||||
});
|
||||
|
||||
nPedSfxReqNextId = 1;
|
||||
nPedSfxReqReadId = 1;
|
||||
for ( int32 i = 0; i < MAX_PEDSFX; i++ )
|
||||
{
|
||||
nPedSlotSfx[i] = -1;
|
||||
nPedSlotSfxReqId[i] = 0;
|
||||
nPedSlotSfxAddr[i] = snd_mem_malloc(PED_BLOCKSIZE_ADPCM);
|
||||
debugf("PedSlot %d buffer: %p\n", i, (void*)nPedSlotSfxAddr[i]);
|
||||
}
|
||||
|
||||
nCurrentPedSlot = 0;
|
||||
|
||||
fdPedSfx = fs_open(SampleBankDataFilename, O_RDONLY);
|
||||
|
||||
assert(fdPedSfx >= 0);
|
||||
|
||||
_dcAudioInitialized = true;
|
||||
return TRUE;
|
||||
}
|
||||
@@ -458,7 +469,7 @@ cSampleManager::Initialise(void)
|
||||
void
|
||||
cSampleManager::Terminate(void)
|
||||
{
|
||||
|
||||
fs_close(fdPedSfx);
|
||||
}
|
||||
|
||||
bool8 cSampleManager::CheckForAnAudioFileOnCD(void)
|
||||
@@ -637,7 +648,7 @@ cSampleManager::IsPedCommentLoaded(uint32 nComment)
|
||||
slot += ARRAY_SIZE(nPedSlotSfx);
|
||||
#endif
|
||||
if ( nComment == nPedSlotSfx[slot] )
|
||||
return LOADING_STATUS_LOADED;
|
||||
return nPedSlotSfxReqId[slot] <= nPedSfxReqReadId ? LOADING_STATUS_LOADED : LOADING_STATUS_LOADING;
|
||||
}
|
||||
|
||||
return LOADING_STATUS_NOT_LOADED;
|
||||
@@ -698,27 +709,28 @@ cSampleManager::LoadPedComment(uint32 nComment)
|
||||
|
||||
assert(m_aSamples[nComment].nByteSize < PED_BLOCKSIZE_ADPCM);
|
||||
|
||||
file_t fd = fs_open(SampleBankDataFilename, O_RDONLY);
|
||||
|
||||
assert(fd >= 0);
|
||||
debugf("Loading ped comment %d, offset: %d, size: %d\n", nComment, m_aSamples[nComment].nFileOffset, m_aSamples[nComment].nByteSize);
|
||||
fs_seek(fd, m_aSamples[nComment].nFileOffset, SEEK_SET);
|
||||
CdStreamQueueAudioRead(nComment, (void*)nPedSlotSfxAddr[nCurrentPedSlot], m_aSamples[nComment].nByteSize, m_aSamples[nComment].nFileOffset, [](AudioReadCmd* cmd) {
|
||||
debugf("Loading ped comment %d, offset: %d, size: %d\n", nComment, m_aSamples[nComment].nFileOffset, m_aSamples[nComment].nByteSize);
|
||||
fs_seek(fdPedSfx, cmd->seek, SEEK_SET);
|
||||
|
||||
|
||||
// TODO: When we can dma directly to AICA, we can use this instead
|
||||
// fs_read(fd, SPU_BASE_U8 + nPedSlotSfxAddr[nCurrentPedSlot], sizeof(nPedSlotSfxAddr));
|
||||
// TODO: When we can dma directly to AICA, we can use this instead
|
||||
// fs_read(fdPedSfx, SPU_BASE_U8 + (uintptr_t)cmd->dest, cmd->size);
|
||||
|
||||
void* stagingBuffer = memalign(32, m_aSamples[nComment].nByteSize);
|
||||
assert(stagingBuffer != 0);
|
||||
debugf("Allocated %d bytes at %p\n", m_aSamples[nComment].nByteSize, stagingBuffer);
|
||||
int rs = fs_read(fd, stagingBuffer, m_aSamples[nComment].nByteSize);
|
||||
debugf("Read %d bytes, expected %d\n", rs, m_aSamples[nComment].nByteSize);
|
||||
assert(rs == m_aSamples[nComment].nByteSize);
|
||||
void* stagingBuffer = memalign(32, cmd->size);
|
||||
assert(stagingBuffer != 0);
|
||||
debugf("Allocated %d bytes at %p\n", cmd->size, stagingBuffer);
|
||||
int rs = fs_read(fdPedSfx, stagingBuffer, cmd->size);
|
||||
debugf("Read %d bytes, expected %d\n", rs, cmd->size);
|
||||
assert(rs == cmd->size);
|
||||
|
||||
fs_close(fd);
|
||||
spu_memload((uintptr_t)cmd->dest, stagingBuffer, cmd->size);
|
||||
free(stagingBuffer);
|
||||
nPedSfxReqReadId = nPedSfxReqReadId + 1;
|
||||
});
|
||||
|
||||
spu_memload(nPedSlotSfxAddr[nCurrentPedSlot], stagingBuffer, m_aSamples[nComment].nByteSize);
|
||||
free(stagingBuffer);
|
||||
nPedSlotSfxReqId[nCurrentPedSlot] = ++nPedSfxReqNextId;
|
||||
|
||||
nPedSlotSfx[nCurrentPedSlot] = nComment;
|
||||
|
||||
if ( ++nCurrentPedSlot >= MAX_PEDSFX )
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
#pragma once
|
||||
#include <functional>
|
||||
|
||||
#define CDSTREAM_SECTOR_SIZE 2048
|
||||
|
||||
@@ -43,7 +44,14 @@ char *CdStreamGetImageName(int32 cd);
|
||||
void CdStreamRemoveImages(void);
|
||||
int32 CdStreamGetNumImages(void);
|
||||
|
||||
void CdStreamQueueAudioRead(int fd, void* pBuffer, size_t bytes, size_t seek);
|
||||
struct AudioReadCmd {
|
||||
void* dest;
|
||||
int fd;
|
||||
size_t size;
|
||||
size_t seek;
|
||||
std::function<void(AudioReadCmd*)> callback;
|
||||
};
|
||||
void CdStreamQueueAudioRead(int fd, void* pBuffer, size_t bytes, size_t seek, std::function<void(AudioReadCmd*)> callback = nullptr);
|
||||
void CdStreamDiscardAudioRead(int fd);
|
||||
|
||||
#ifdef FLUSHABLE_STREAMING
|
||||
|
||||
@@ -26,12 +26,6 @@
|
||||
#include "CdStream.h"
|
||||
#include "rwcore.h"
|
||||
#include "MemoryMgr.h"
|
||||
struct AudioReadCmd {
|
||||
void* dest;
|
||||
int fd;
|
||||
size_t size;
|
||||
size_t seek;
|
||||
};
|
||||
|
||||
#define CDDEBUG(f, ...) debug ("%s: " f "\n", "cdvd_stream", ## __VA_ARGS__)
|
||||
#define CDTRACE(f, ...) printf("%s: " f "\n", "cdvd_stream", ## __VA_ARGS__)
|
||||
@@ -489,8 +483,16 @@ std::vector<AudioReadCmd> pendingAudioReads;
|
||||
std::mutex pendingAudioReadsMutex;
|
||||
#endif
|
||||
// Will replace a previous read request for the same file descriptor
|
||||
void CdStreamQueueAudioRead(int fd, void* pBuffer, size_t bytes, size_t seek) {
|
||||
void CdStreamQueueAudioRead(int fd, void* pBuffer, size_t bytes, size_t seek, std::function<void(AudioReadCmd*)> callback) {
|
||||
AudioReadCmd cmd = { pBuffer, fd, bytes, seek};
|
||||
if (!callback) {
|
||||
cmd.callback = [](AudioReadCmd* cmd){
|
||||
lseek(cmd->fd, cmd->seek, SEEK_SET);
|
||||
read(cmd->fd, cmd->dest, cmd->size);
|
||||
};
|
||||
} else {
|
||||
cmd.callback = callback;
|
||||
}
|
||||
{
|
||||
#if !defined(DC_SH4)
|
||||
std::lock_guard<std::mutex> lock(pendingAudioReadsMutex);
|
||||
@@ -514,6 +516,7 @@ void CdStreamQueueAudioRead(int fd, void* pBuffer, size_t bytes, size_t seek) {
|
||||
sem_post(gCdStreamSema);
|
||||
}
|
||||
|
||||
|
||||
void CdStreamDiscardAudioRead(int fd) {
|
||||
#if !defined(DC_SH4)
|
||||
std::lock_guard<std::mutex> lock(pendingAudioReadsMutex);
|
||||
@@ -564,8 +567,7 @@ int read_loop(int fd, void* pBuffer, size_t bytes) {
|
||||
total_read += read_bytes;
|
||||
auto cmd = CdStreamNextAudioRead();
|
||||
while (cmd.fd != -1) {
|
||||
lseek(cmd.fd, cmd.seek, SEEK_SET);
|
||||
read(cmd.fd, cmd.dest, cmd.size);
|
||||
cmd.callback(&cmd);
|
||||
cmd = CdStreamNextAudioRead();
|
||||
}
|
||||
}
|
||||
@@ -581,8 +583,7 @@ void *CdStreamThread(void *param)
|
||||
|
||||
auto cmd = CdStreamNextAudioRead();
|
||||
while (cmd.fd != -1) {
|
||||
lseek(cmd.fd, cmd.seek, SEEK_SET);
|
||||
read(cmd.fd, cmd.dest, cmd.size);
|
||||
cmd.callback(&cmd);
|
||||
cmd = CdStreamNextAudioRead();
|
||||
}
|
||||
|
||||
|
||||
380
src/core/ControllerConfig.cpp
Normal file → Executable file
380
src/core/ControllerConfig.cpp
Normal file → Executable file
@@ -2054,21 +2054,60 @@ wchar *CControllerConfigManager::GetControllerSettingTextWithOrderNumber(e_Contr
|
||||
static const char* Dreamcast_DPad_Down = "D-Pad Down";
|
||||
static const char* Dreamcast_DPad_Left = "D-Pad Left";
|
||||
static const char* Dreamcast_DPad_Right = "D-Pad Right";
|
||||
static const char* Dreamcast_LefAnalog_Up = "Joystick Up";
|
||||
static const char* Dreamcast_LefAnalog_Down = "Joystick Down";
|
||||
static const char* Dreamcast_LefAnalog_Left = "Joystick Left";
|
||||
static const char* Dreamcast_LefAnalog_Right = "Joystick Right";
|
||||
static const char* Dreamcast_NotAssigned = "Not Assigned";
|
||||
static const char* Dreamcast_Stick_Up = "Joystick Up";
|
||||
static const char* Dreamcast_Stick_Down = "Joystick Down";
|
||||
static const char* Dreamcast_Stick_Left = "Joystick Left";
|
||||
static const char* Dreamcast_Stick_Right = "Joystick Right";
|
||||
static const char* Dreamcast_VehicleLookLeft = "A + Joystick Left";
|
||||
static const char* Dreamcast_VehicleLookRight = "A + Joystick Right";
|
||||
static const char* Dreamcast_CenterCamera = "Double click X";
|
||||
static const char* Dreamcast_CameraUp = "X + Joystick Up";
|
||||
static const char* Dreamcast_CameraDown = "X + Joystick Down";
|
||||
static const char* Dreamcast_CameraLeft = "X + Joystick Left";
|
||||
static const char* Dreamcast_CameraRight = "X + Joystick Right";
|
||||
static const char* Dreamcast_LookBehind = "Right trigger + Left trigger";
|
||||
static const char* Dreamcast_NotAssigned = "Not Assigned";
|
||||
|
||||
if (CMenuManager::m_ControlMethod == CONTROL_CLASSIC) // CONTROL_CLASSIC
|
||||
//Dual sticks
|
||||
static const char* LefAnalog_Up = "Left Stick Up";
|
||||
static const char* LefAnalog_Down = "Left Stick Down";
|
||||
static const char* LefAnalog_Left = "Left Stick Left";
|
||||
static const char* LefAnalog_Right = "Left Stick Right";
|
||||
|
||||
static const char* RightAnalog_Up = "Right Stick Up";
|
||||
static const char* RightAnalog_Down = "Right Stick Down";
|
||||
static const char* RightAnalog_Left = "Right Stick Left";
|
||||
static const char* RightAnalog_Right = "Right Stick Right";
|
||||
|
||||
//Xbox Specific
|
||||
static const char* Xbox_VehicleLookLeft = "LB";
|
||||
static const char* Xbox_VehicleLookRight = "RB";
|
||||
static const char* Xbox_VehicleLookBehind = "RB + LB";
|
||||
static const char* Xbox_Back = "Back";
|
||||
|
||||
|
||||
//PS2 Specific
|
||||
static const char* Dreamcast_PS2_VehicleLookLeft = "B + Joystick Left";
|
||||
static const char* Dreamcast_PS2_VehicleLookRight = "B + Joystick Right";
|
||||
static const char* PS2_L1 = "L1";
|
||||
static const char* PS2_R1 = "R1";
|
||||
static const char* PS2_L2 = "L2";
|
||||
static const char* PS2_R2 = "R2";
|
||||
static const char* PS2_Cross = "Cross";
|
||||
static const char* PS2_Square = "Square";
|
||||
static const char* PS2_Circle = "Circle";
|
||||
static const char* PS2_Triangle = "Triangle";
|
||||
|
||||
|
||||
if ((CPad::GetPad(0)->Mode == 0) && (CPad::GetPad(0)->IsDualAnalog == 0)) // Standard DC controller, Xbox like bindings
|
||||
{
|
||||
switch (action)
|
||||
{
|
||||
case VEHICLE_LOOKLEFT:
|
||||
for (int i = 0; (ActionText[i] = Dreamcast_DPad_Left[i]) != '\0' && i < iLimitCopy; i++);
|
||||
for (int i = 0; (ActionText[i] = Dreamcast_VehicleLookLeft[i]) != '\0' && i < iLimitCopy; i++);
|
||||
break;
|
||||
case VEHICLE_LOOKRIGHT:
|
||||
for (int i = 0; (ActionText[i] = Dreamcast_DPad_Right[i]) != '\0' && i < iLimitCopy; i++);
|
||||
for (int i = 0; (ActionText[i] = Dreamcast_VehicleLookRight[i]) != '\0' && i < iLimitCopy; i++);
|
||||
break;
|
||||
case VEHICLE_HORN:
|
||||
for (int i = 0; (ActionText[i] = Dreamcast_DPad_Down[i]) != '\0' && i < iLimitCopy; i++);
|
||||
@@ -2083,28 +2122,28 @@ wchar *CControllerConfigManager::GetControllerSettingTextWithOrderNumber(e_Contr
|
||||
for (int i = 0; (ActionText[i] = Dreamcast_RightTrigger[i]) != '\0' && i < iLimitCopy; i++);
|
||||
break;
|
||||
case VEHICLE_CHANGE_RADIO_STATION:
|
||||
for (int i = 0; (ActionText[i] = Dreamcast_DPad_Right[i]) != '\0' && i < iLimitCopy; i++);
|
||||
for (int i = 0; (ActionText[i] = Dreamcast_DPad_Left[i]) != '\0' && i < iLimitCopy; i++);
|
||||
break;
|
||||
case VEHICLE_BRAKE:
|
||||
for (int i = 0; (ActionText[i] = Dreamcast_LeftTrigger[i]) != '\0' && i < iLimitCopy; i++);
|
||||
break;
|
||||
case TOGGLE_SUBMISSIONS:
|
||||
for (int i = 0; (ActionText[i] = Dreamcast_DPad_Left[i]) != '\0' && i < iLimitCopy; i++);
|
||||
for (int i = 0; (ActionText[i] = Dreamcast_DPad_Right[i]) != '\0' && i < iLimitCopy; i++);
|
||||
break;
|
||||
case GO_LEFT:
|
||||
for (int i = 0; (ActionText[i] = Dreamcast_LefAnalog_Left[i]) != '\0' && i < iLimitCopy; i++);
|
||||
for (int i = 0; (ActionText[i] = Dreamcast_Stick_Left[i]) != '\0' && i < iLimitCopy; i++);
|
||||
break;
|
||||
case GO_RIGHT:
|
||||
for (int i = 0; (ActionText[i] = Dreamcast_LefAnalog_Right[i]) != '\0' && i < iLimitCopy; i++);
|
||||
for (int i = 0; (ActionText[i] = Dreamcast_Stick_Right[i]) != '\0' && i < iLimitCopy; i++);
|
||||
break;
|
||||
case GO_FORWARD:
|
||||
for (int i = 0; (ActionText[i] = Dreamcast_LefAnalog_Up[i]) != '\0' && i < iLimitCopy; i++);
|
||||
for (int i = 0; (ActionText[i] = Dreamcast_Stick_Up[i]) != '\0' && i < iLimitCopy; i++);
|
||||
break;
|
||||
case GO_BACK:
|
||||
for (int i = 0; (ActionText[i] = Dreamcast_LefAnalog_Down[i]) != '\0' && i < iLimitCopy; i++);
|
||||
for (int i = 0; (ActionText[i] = Dreamcast_Stick_Down[i]) != '\0' && i < iLimitCopy; i++);
|
||||
break;
|
||||
case PED_LOOKBEHIND:
|
||||
for (int i = 0; (ActionText[i] = Dreamcast_LefAnalog_Down[i]) != '\0' && i < iLimitCopy; i++);
|
||||
for (int i = 0; (ActionText[i] = Dreamcast_DPad_Down[i]) != '\0' && i < iLimitCopy; i++);
|
||||
break;
|
||||
case PED_FIREWEAPON:
|
||||
for (int i = 0; (ActionText[i] = Dreamcast_RightTrigger[i]) != '\0' && i < iLimitCopy; i++);
|
||||
@@ -2122,22 +2161,22 @@ wchar *CControllerConfigManager::GetControllerSettingTextWithOrderNumber(e_Contr
|
||||
for (int i = 0; (ActionText[i] = Dreamcast_LeftTrigger[i]) != '\0' && i < iLimitCopy; i++);
|
||||
break;
|
||||
case PED_JUMPING:
|
||||
for (int i = 0; (ActionText[i] = Dreamcast_X[i]) != '\0' && i < iLimitCopy; i++);
|
||||
for (int i = 0; (ActionText[i] = Dreamcast_B[i]) != '\0' && i < iLimitCopy; i++);
|
||||
break;
|
||||
case PED_SPRINT:
|
||||
for (int i = 0; (ActionText[i] = Dreamcast_A[i]) != '\0' && i < iLimitCopy; i++);
|
||||
break;
|
||||
case PED_CYCLE_TARGET_LEFT:
|
||||
for (int i = 0; (ActionText[i] = Dreamcast_A[i]) != '\0' && i < iLimitCopy; i++);
|
||||
for (int i = 0; (ActionText[i] = Dreamcast_DPad_Left[i]) != '\0' && i < iLimitCopy; i++);
|
||||
break;
|
||||
case PED_CYCLE_TARGET_RIGHT:
|
||||
for (int i = 0; (ActionText[i] = Dreamcast_A[i]) != '\0' && i < iLimitCopy; i++);
|
||||
for (int i = 0; (ActionText[i] = Dreamcast_DPad_Right[i]) != '\0' && i < iLimitCopy; i++);
|
||||
break;
|
||||
case PED_CENTER_CAMERA_BEHIND_PLAYER:
|
||||
for (int i = 0; (ActionText[i] = Dreamcast_A[i]) != '\0' && i < iLimitCopy; i++);
|
||||
for (int i = 0; (ActionText[i] = Dreamcast_CenterCamera[i]) != '\0' && i < iLimitCopy; i++);
|
||||
break;
|
||||
case PED_SNIPER_ZOOM_IN:
|
||||
for (int i = 0; (ActionText[i] = Dreamcast_A[i]) != '\0' && i < iLimitCopy; i++);
|
||||
for (int i = 0; (ActionText[i] = Dreamcast_X[i]) != '\0' && i < iLimitCopy; i++);
|
||||
break;
|
||||
case PED_SNIPER_ZOOM_OUT:
|
||||
for (int i = 0; (ActionText[i] = Dreamcast_A[i]) != '\0' && i < iLimitCopy; i++);
|
||||
@@ -2170,7 +2209,7 @@ wchar *CControllerConfigManager::GetControllerSettingTextWithOrderNumber(e_Contr
|
||||
for (int i = 0; (ActionText[i] = Dreamcast_DPad_Up[i]) != '\0' && i < iLimitCopy; i++);
|
||||
break;
|
||||
case VEHICLE_LOOKBEHIND:
|
||||
for (int i = 0; (ActionText[i] = Dreamcast_DPad_Down[i]) != '\0' && i < iLimitCopy; i++);
|
||||
for (int i = 0; (ActionText[i] = Dreamcast_LookBehind[i]) != '\0' && i < iLimitCopy; i++);
|
||||
break;
|
||||
case NETWORK_TALK: // Not Used on Dreamcast
|
||||
for (int i = 0; (ActionText[i] = Dreamcast_NotAssigned[i]) != '\0' && i < iLimitCopy; i++);
|
||||
@@ -2198,15 +2237,15 @@ wchar *CControllerConfigManager::GetControllerSettingTextWithOrderNumber(e_Contr
|
||||
break;
|
||||
}
|
||||
}
|
||||
else // CONTROL_STANDARD
|
||||
if ((CPad::GetPad(0)->Mode == 0) && (CPad::GetPad(0)->IsDualAnalog == 1)) // Dual analog, Xbox like bindings
|
||||
{
|
||||
switch (action)
|
||||
{
|
||||
case VEHICLE_LOOKLEFT:
|
||||
for (int i = 0; (ActionText[i] = Dreamcast_DPad_Left[i]) != '\0' && i < iLimitCopy; i++);
|
||||
for (int i = 0; (ActionText[i] = Xbox_VehicleLookLeft[i]) != '\0' && i < iLimitCopy; i++);
|
||||
break;
|
||||
case VEHICLE_LOOKRIGHT:
|
||||
for (int i = 0; (ActionText[i] = Dreamcast_DPad_Right[i]) != '\0' && i < iLimitCopy; i++);
|
||||
for (int i = 0; (ActionText[i] = Xbox_VehicleLookRight[i]) != '\0' && i < iLimitCopy; i++);
|
||||
break;
|
||||
case VEHICLE_HORN:
|
||||
for (int i = 0; (ActionText[i] = Dreamcast_DPad_Down[i]) != '\0' && i < iLimitCopy; i++);
|
||||
@@ -2230,19 +2269,19 @@ wchar *CControllerConfigManager::GetControllerSettingTextWithOrderNumber(e_Contr
|
||||
for (int i = 0; (ActionText[i] = Dreamcast_DPad_Left[i]) != '\0' && i < iLimitCopy; i++);
|
||||
break;
|
||||
case GO_LEFT:
|
||||
for (int i = 0; (ActionText[i] = Dreamcast_LefAnalog_Left[i]) != '\0' && i < iLimitCopy; i++);
|
||||
for (int i = 0; (ActionText[i] = LefAnalog_Left[i]) != '\0' && i < iLimitCopy; i++);
|
||||
break;
|
||||
case GO_RIGHT:
|
||||
for (int i = 0; (ActionText[i] = Dreamcast_LefAnalog_Right[i]) != '\0' && i < iLimitCopy; i++);
|
||||
for (int i = 0; (ActionText[i] = LefAnalog_Right[i]) != '\0' && i < iLimitCopy; i++);
|
||||
break;
|
||||
case GO_FORWARD:
|
||||
for (int i = 0; (ActionText[i] = Dreamcast_LefAnalog_Up[i]) != '\0' && i < iLimitCopy; i++);
|
||||
for (int i = 0; (ActionText[i] = LefAnalog_Up[i]) != '\0' && i < iLimitCopy; i++);
|
||||
break;
|
||||
case GO_BACK:
|
||||
for (int i = 0; (ActionText[i] = Dreamcast_LefAnalog_Down[i]) != '\0' && i < iLimitCopy; i++);
|
||||
for (int i = 0; (ActionText[i] = LefAnalog_Down[i]) != '\0' && i < iLimitCopy; i++);
|
||||
break;
|
||||
case PED_LOOKBEHIND:
|
||||
for (int i = 0; (ActionText[i] = Dreamcast_LefAnalog_Down[i]) != '\0' && i < iLimitCopy; i++);
|
||||
for (int i = 0; (ActionText[i] = Dreamcast_DPad_Down[i]) != '\0' && i < iLimitCopy; i++);
|
||||
break;
|
||||
case PED_FIREWEAPON:
|
||||
for (int i = 0; (ActionText[i] = Dreamcast_RightTrigger[i]) != '\0' && i < iLimitCopy; i++);
|
||||
@@ -2266,17 +2305,155 @@ wchar *CControllerConfigManager::GetControllerSettingTextWithOrderNumber(e_Contr
|
||||
for (int i = 0; (ActionText[i] = Dreamcast_A[i]) != '\0' && i < iLimitCopy; i++);
|
||||
break;
|
||||
case PED_CYCLE_TARGET_LEFT:
|
||||
for (int i = 0; (ActionText[i] = Dreamcast_A[i]) != '\0' && i < iLimitCopy; i++);
|
||||
for (int i = 0; (ActionText[i] = Dreamcast_DPad_Left[i]) != '\0' && i < iLimitCopy; i++);
|
||||
break;
|
||||
case PED_CYCLE_TARGET_RIGHT:
|
||||
for (int i = 0; (ActionText[i] = Dreamcast_A[i]) != '\0' && i < iLimitCopy; i++);
|
||||
for (int i = 0; (ActionText[i] = Dreamcast_DPad_Right[i]) != '\0' && i < iLimitCopy; i++);
|
||||
break;
|
||||
case PED_CENTER_CAMERA_BEHIND_PLAYER:
|
||||
for (int i = 0; (ActionText[i] = Dreamcast_A[i]) != '\0' && i < iLimitCopy; i++);
|
||||
for (int i = 0; (ActionText[i] = Dreamcast_CenterCamera[i]) != '\0' && i < iLimitCopy; i++);
|
||||
break;
|
||||
case PED_SNIPER_ZOOM_IN:
|
||||
for (int i = 0; (ActionText[i] = Dreamcast_X[i]) != '\0' && i < iLimitCopy; i++);
|
||||
break;
|
||||
case PED_SNIPER_ZOOM_OUT:
|
||||
for (int i = 0; (ActionText[i] = Dreamcast_A[i]) != '\0' && i < iLimitCopy; i++);
|
||||
break;
|
||||
case PED_1RST_PERSON_LOOK_LEFT:
|
||||
for (int i = 0; (ActionText[i] = Dreamcast_A[i]) != '\0' && i < iLimitCopy; i++);
|
||||
break;
|
||||
case PED_1RST_PERSON_LOOK_RIGHT:
|
||||
for (int i = 0; (ActionText[i] = Dreamcast_A[i]) != '\0' && i < iLimitCopy; i++);
|
||||
break;
|
||||
case PED_1RST_PERSON_LOOK_UP:
|
||||
for (int i = 0; (ActionText[i] = Dreamcast_A[i]) != '\0' && i < iLimitCopy; i++);
|
||||
break;
|
||||
case PED_1RST_PERSON_LOOK_DOWN:
|
||||
for (int i = 0; (ActionText[i] = Dreamcast_A[i]) != '\0' && i < iLimitCopy; i++);
|
||||
break;
|
||||
case VEHICLE_TURRETLEFT:
|
||||
for (int i = 0; (ActionText[i] = Dreamcast_A[i]) != '\0' && i < iLimitCopy; i++);
|
||||
break;
|
||||
case VEHICLE_TURRETRIGHT:
|
||||
for (int i = 0; (ActionText[i] = Dreamcast_A[i]) != '\0' && i < iLimitCopy; i++);
|
||||
break;
|
||||
case VEHICLE_TURRETUP:
|
||||
for (int i = 0; (ActionText[i] = Dreamcast_A[i]) != '\0' && i < iLimitCopy; i++);
|
||||
break;
|
||||
case VEHICLE_TURRETDOWN:
|
||||
for (int i = 0; (ActionText[i] = Dreamcast_A[i]) != '\0' && i < iLimitCopy; i++);
|
||||
break;
|
||||
case CAMERA_CHANGE_VIEW_ALL_SITUATIONS:
|
||||
for (int i = 0; (ActionText[i] = Xbox_Back[i]) != '\0' && i < iLimitCopy; i++);
|
||||
break;
|
||||
case VEHICLE_LOOKBEHIND:
|
||||
for (int i = 0; (ActionText[i] = Xbox_VehicleLookBehind[i]) != '\0' && i < iLimitCopy; i++);
|
||||
break;
|
||||
case NETWORK_TALK: // Not Used on Dreamcast
|
||||
for (int i = 0; (ActionText[i] = Dreamcast_NotAssigned[i]) != '\0' && i < iLimitCopy; i++);
|
||||
break;
|
||||
case _CONTROLLERACTION_36: // What is that???
|
||||
for (int i = 0; (ActionText[i] = Dreamcast_NotAssigned[i]) != '\0' && i < iLimitCopy; i++);
|
||||
break;
|
||||
case TOGGLE_DPAD: // Not Used on Dreamcast
|
||||
for (int i = 0; (ActionText[i] = Dreamcast_NotAssigned[i]) != '\0' && i < iLimitCopy; i++);
|
||||
break;
|
||||
case SWITCH_DEBUG_CAM_ON: // Not Used on Dreamcast
|
||||
for (int i = 0; (ActionText[i] = Dreamcast_NotAssigned[i]) != '\0' && i < iLimitCopy; i++);
|
||||
break;
|
||||
case TAKE_SCREEN_SHOT: // Not Used on Dreamcast
|
||||
for (int i = 0; (ActionText[i] = Dreamcast_NotAssigned[i]) != '\0' && i < iLimitCopy; i++);
|
||||
break;
|
||||
case SHOW_MOUSE_POINTER_TOGGLE: // Not Used on Dreamcast
|
||||
for (int i = 0; (ActionText[i] = Dreamcast_NotAssigned[i]) != '\0' && i < iLimitCopy; i++);
|
||||
break;
|
||||
case MAX_CONTROLLERACTIONS: // Not Used on Dreamcast
|
||||
for (int i = 0; (ActionText[i] = Dreamcast_NotAssigned[i]) != '\0' && i < iLimitCopy; i++);
|
||||
break;
|
||||
default:
|
||||
for (int i = 0; (ActionText[i] = Dreamcast_NotAssigned[i]) != '\0' && i < iLimitCopy; i++);
|
||||
break;
|
||||
}
|
||||
}
|
||||
if ((CPad::GetPad(0)->Mode == 1) && (CPad::GetPad(0)->IsDualAnalog == 0)) // Standard DC controller, PS2 like bindings
|
||||
{
|
||||
switch (action)
|
||||
{
|
||||
case VEHICLE_LOOKLEFT:
|
||||
for (int i = 0; (ActionText[i] = Dreamcast_PS2_VehicleLookLeft[i]) != '\0' && i < iLimitCopy; i++);
|
||||
break;
|
||||
case VEHICLE_LOOKRIGHT:
|
||||
for (int i = 0; (ActionText[i] = Dreamcast_PS2_VehicleLookRight[i]) != '\0' && i < iLimitCopy; i++);
|
||||
break;
|
||||
case VEHICLE_HORN:
|
||||
for (int i = 0; (ActionText[i] = Dreamcast_DPad_Down[i]) != '\0' && i < iLimitCopy; i++);
|
||||
break;
|
||||
case VEHICLE_HANDBRAKE:
|
||||
for (int i = 0; (ActionText[i] = Dreamcast_RightTrigger[i]) != '\0' && i < iLimitCopy; i++);
|
||||
break;
|
||||
case VEHICLE_ENTER_EXIT:
|
||||
for (int i = 0; (ActionText[i] = Dreamcast_Y[i]) != '\0' && i < iLimitCopy; i++);
|
||||
break;
|
||||
case VEHICLE_ACCELERATE:
|
||||
for (int i = 0; (ActionText[i] = Dreamcast_A[i]) != '\0' && i < iLimitCopy; i++);
|
||||
break;
|
||||
case VEHICLE_CHANGE_RADIO_STATION:
|
||||
for (int i = 0; (ActionText[i] = Dreamcast_DPad_Left[i]) != '\0' && i < iLimitCopy; i++);
|
||||
break;
|
||||
case VEHICLE_BRAKE:
|
||||
for (int i = 0; (ActionText[i] = Dreamcast_X[i]) != '\0' && i < iLimitCopy; i++);
|
||||
break;
|
||||
case TOGGLE_SUBMISSIONS:
|
||||
for (int i = 0; (ActionText[i] = Dreamcast_DPad_Right[i]) != '\0' && i < iLimitCopy; i++);
|
||||
break;
|
||||
case GO_LEFT:
|
||||
for (int i = 0; (ActionText[i] = Dreamcast_Stick_Left[i]) != '\0' && i < iLimitCopy; i++);
|
||||
break;
|
||||
case GO_RIGHT:
|
||||
for (int i = 0; (ActionText[i] = Dreamcast_Stick_Right[i]) != '\0' && i < iLimitCopy; i++);
|
||||
break;
|
||||
case GO_FORWARD:
|
||||
for (int i = 0; (ActionText[i] = Dreamcast_Stick_Up[i]) != '\0' && i < iLimitCopy; i++);
|
||||
break;
|
||||
case GO_BACK:
|
||||
for (int i = 0; (ActionText[i] = Dreamcast_Stick_Down[i]) != '\0' && i < iLimitCopy; i++);
|
||||
break;
|
||||
case PED_LOOKBEHIND:
|
||||
for (int i = 0; (ActionText[i] = Dreamcast_DPad_Down[i]) != '\0' && i < iLimitCopy; i++);
|
||||
break;
|
||||
case PED_FIREWEAPON:
|
||||
for (int i = 0; (ActionText[i] = Dreamcast_B[i]) != '\0' && i < iLimitCopy; i++);
|
||||
break;
|
||||
case VEHICLE_FIREWEAPON:
|
||||
for (int i = 0; (ActionText[i] = Dreamcast_B[i]) != '\0' && i < iLimitCopy; i++);
|
||||
break;
|
||||
case PED_CYCLE_WEAPON_LEFT:
|
||||
for (int i = 0; (ActionText[i] = Dreamcast_DPad_Left[i]) != '\0' && i < iLimitCopy; i++);
|
||||
break;
|
||||
case PED_CYCLE_WEAPON_RIGHT:
|
||||
for (int i = 0; (ActionText[i] = Dreamcast_DPad_Right[i]) != '\0' && i < iLimitCopy; i++);
|
||||
break;
|
||||
case PED_LOCK_TARGET:
|
||||
for (int i = 0; (ActionText[i] = Dreamcast_RightTrigger[i]) != '\0' && i < iLimitCopy; i++);
|
||||
break;
|
||||
case PED_JUMPING:
|
||||
for (int i = 0; (ActionText[i] = Dreamcast_X[i]) != '\0' && i < iLimitCopy; i++);
|
||||
break;
|
||||
case PED_SPRINT:
|
||||
for (int i = 0; (ActionText[i] = Dreamcast_A[i]) != '\0' && i < iLimitCopy; i++);
|
||||
break;
|
||||
case PED_CYCLE_TARGET_LEFT:
|
||||
for (int i = 0; (ActionText[i] = Dreamcast_DPad_Left[i]) != '\0' && i < iLimitCopy; i++);
|
||||
break;
|
||||
case PED_CYCLE_TARGET_RIGHT:
|
||||
for (int i = 0; (ActionText[i] = Dreamcast_DPad_Right[i]) != '\0' && i < iLimitCopy; i++);
|
||||
break;
|
||||
case PED_CENTER_CAMERA_BEHIND_PLAYER:
|
||||
for (int i = 0; (ActionText[i] = Dreamcast_CenterCamera[i]) != '\0' && i < iLimitCopy; i++);
|
||||
break;
|
||||
case PED_SNIPER_ZOOM_IN:
|
||||
for (int i = 0; (ActionText[i] = Dreamcast_X[i]) != '\0' && i < iLimitCopy; i++);
|
||||
break;
|
||||
case PED_SNIPER_ZOOM_OUT:
|
||||
for (int i = 0; (ActionText[i] = Dreamcast_A[i]) != '\0' && i < iLimitCopy; i++);
|
||||
break;
|
||||
@@ -2308,8 +2485,147 @@ wchar *CControllerConfigManager::GetControllerSettingTextWithOrderNumber(e_Contr
|
||||
for (int i = 0; (ActionText[i] = Dreamcast_DPad_Up[i]) != '\0' && i < iLimitCopy; i++);
|
||||
break;
|
||||
case VEHICLE_LOOKBEHIND:
|
||||
for (int i = 0; (ActionText[i] = Dreamcast_LookBehind[i]) != '\0' && i < iLimitCopy; i++);
|
||||
break;
|
||||
case NETWORK_TALK: // Not Used on Dreamcast
|
||||
for (int i = 0; (ActionText[i] = Dreamcast_NotAssigned[i]) != '\0' && i < iLimitCopy; i++);
|
||||
break;
|
||||
case _CONTROLLERACTION_36: // What is that???
|
||||
for (int i = 0; (ActionText[i] = Dreamcast_NotAssigned[i]) != '\0' && i < iLimitCopy; i++);
|
||||
break;
|
||||
case TOGGLE_DPAD: // Not Used on Dreamcast
|
||||
for (int i = 0; (ActionText[i] = Dreamcast_NotAssigned[i]) != '\0' && i < iLimitCopy; i++);
|
||||
break;
|
||||
case SWITCH_DEBUG_CAM_ON: // Not Used on Dreamcast
|
||||
for (int i = 0; (ActionText[i] = Dreamcast_NotAssigned[i]) != '\0' && i < iLimitCopy; i++);
|
||||
break;
|
||||
case TAKE_SCREEN_SHOT: // Not Used on Dreamcast
|
||||
for (int i = 0; (ActionText[i] = Dreamcast_NotAssigned[i]) != '\0' && i < iLimitCopy; i++);
|
||||
break;
|
||||
case SHOW_MOUSE_POINTER_TOGGLE: // Not Used on Dreamcast
|
||||
for (int i = 0; (ActionText[i] = Dreamcast_NotAssigned[i]) != '\0' && i < iLimitCopy; i++);
|
||||
break;
|
||||
case MAX_CONTROLLERACTIONS: // Not Used on Dreamcast
|
||||
for (int i = 0; (ActionText[i] = Dreamcast_NotAssigned[i]) != '\0' && i < iLimitCopy; i++);
|
||||
break;
|
||||
default:
|
||||
for (int i = 0; (ActionText[i] = Dreamcast_NotAssigned[i]) != '\0' && i < iLimitCopy; i++);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if ((CPad::GetPad(0)->Mode == 1) && (CPad::GetPad(0)->IsDualAnalog == 1)) // Dual Stick, PS2 like bindings
|
||||
{
|
||||
switch (action)
|
||||
{
|
||||
case VEHICLE_LOOKLEFT:
|
||||
for (int i = 0; (ActionText[i] = PS2_L2[i]) != '\0' && i < iLimitCopy; i++);
|
||||
break;
|
||||
case VEHICLE_LOOKRIGHT:
|
||||
for (int i = 0; (ActionText[i] = PS2_R2[i]) != '\0' && i < iLimitCopy; i++);
|
||||
break;
|
||||
case VEHICLE_HORN:
|
||||
for (int i = 0; (ActionText[i] = Dreamcast_DPad_Down[i]) != '\0' && i < iLimitCopy; i++);
|
||||
break;
|
||||
case VEHICLE_HANDBRAKE:
|
||||
for (int i = 0; (ActionText[i] = PS2_R1[i]) != '\0' && i < iLimitCopy; i++);
|
||||
break;
|
||||
case VEHICLE_ENTER_EXIT:
|
||||
for (int i = 0; (ActionText[i] = PS2_Triangle[i]) != '\0' && i < iLimitCopy; i++);
|
||||
break;
|
||||
case VEHICLE_ACCELERATE:
|
||||
for (int i = 0; (ActionText[i] = PS2_Cross[i]) != '\0' && i < iLimitCopy; i++);
|
||||
break;
|
||||
case VEHICLE_CHANGE_RADIO_STATION:
|
||||
for (int i = 0; (ActionText[i] = PS2_L1[i]) != '\0' && i < iLimitCopy; i++);
|
||||
break;
|
||||
case VEHICLE_BRAKE:
|
||||
for (int i = 0; (ActionText[i] = PS2_Square[i]) != '\0' && i < iLimitCopy; i++);
|
||||
break;
|
||||
case TOGGLE_SUBMISSIONS:
|
||||
for (int i = 0; (ActionText[i] = Dreamcast_DPad_Right[i]) != '\0' && i < iLimitCopy; i++);
|
||||
break;
|
||||
case GO_LEFT:
|
||||
for (int i = 0; (ActionText[i] = LefAnalog_Left[i]) != '\0' && i < iLimitCopy; i++);
|
||||
break;
|
||||
case GO_RIGHT:
|
||||
for (int i = 0; (ActionText[i] = LefAnalog_Right[i]) != '\0' && i < iLimitCopy; i++);
|
||||
break;
|
||||
case GO_FORWARD:
|
||||
for (int i = 0; (ActionText[i] = LefAnalog_Up[i]) != '\0' && i < iLimitCopy; i++);
|
||||
break;
|
||||
case GO_BACK:
|
||||
for (int i = 0; (ActionText[i] = LefAnalog_Down[i]) != '\0' && i < iLimitCopy; i++);
|
||||
break;
|
||||
case PED_LOOKBEHIND:
|
||||
for (int i = 0; (ActionText[i] = Dreamcast_DPad_Down[i]) != '\0' && i < iLimitCopy; i++);
|
||||
break;
|
||||
case PED_FIREWEAPON:
|
||||
for (int i = 0; (ActionText[i] = PS2_Circle[i]) != '\0' && i < iLimitCopy; i++);
|
||||
break;
|
||||
case VEHICLE_FIREWEAPON:
|
||||
for (int i = 0; (ActionText[i] = PS2_Circle[i]) != '\0' && i < iLimitCopy; i++);
|
||||
break;
|
||||
case PED_CYCLE_WEAPON_LEFT:
|
||||
for (int i = 0; (ActionText[i] = Dreamcast_DPad_Left[i]) != '\0' && i < iLimitCopy; i++);
|
||||
break;
|
||||
case PED_CYCLE_WEAPON_RIGHT:
|
||||
for (int i = 0; (ActionText[i] = Dreamcast_DPad_Right[i]) != '\0' && i < iLimitCopy; i++);
|
||||
break;
|
||||
case PED_LOCK_TARGET:
|
||||
for (int i = 0; (ActionText[i] = PS2_R1[i]) != '\0' && i < iLimitCopy; i++);
|
||||
break;
|
||||
case PED_JUMPING:
|
||||
for (int i = 0; (ActionText[i] = PS2_Square[i]) != '\0' && i < iLimitCopy; i++);
|
||||
break;
|
||||
case PED_SPRINT:
|
||||
for (int i = 0; (ActionText[i] = PS2_Circle[i]) != '\0' && i < iLimitCopy; i++);
|
||||
break;
|
||||
case PED_CYCLE_TARGET_LEFT:
|
||||
for (int i = 0; (ActionText[i] = PS2_L2[i]) != '\0' && i < iLimitCopy; i++);
|
||||
break;
|
||||
case PED_CYCLE_TARGET_RIGHT:
|
||||
for (int i = 0; (ActionText[i] = PS2_R2[i]) != '\0' && i < iLimitCopy; i++);
|
||||
break;
|
||||
case PED_CENTER_CAMERA_BEHIND_PLAYER:
|
||||
for (int i = 0; (ActionText[i] = Dreamcast_CenterCamera[i]) != '\0' && i < iLimitCopy; i++);
|
||||
break;
|
||||
case PED_SNIPER_ZOOM_IN:
|
||||
for (int i = 0; (ActionText[i] = PS2_Square[i]) != '\0' && i < iLimitCopy; i++);
|
||||
break;
|
||||
case PED_SNIPER_ZOOM_OUT:
|
||||
for (int i = 0; (ActionText[i] = PS2_Cross[i]) != '\0' && i < iLimitCopy; i++);
|
||||
break;
|
||||
case PED_1RST_PERSON_LOOK_LEFT:
|
||||
for (int i = 0; (ActionText[i] = Dreamcast_A[i]) != '\0' && i < iLimitCopy; i++);
|
||||
break;
|
||||
case PED_1RST_PERSON_LOOK_RIGHT:
|
||||
for (int i = 0; (ActionText[i] = Dreamcast_A[i]) != '\0' && i < iLimitCopy; i++);
|
||||
break;
|
||||
case PED_1RST_PERSON_LOOK_UP:
|
||||
for (int i = 0; (ActionText[i] = Dreamcast_A[i]) != '\0' && i < iLimitCopy; i++);
|
||||
break;
|
||||
case PED_1RST_PERSON_LOOK_DOWN:
|
||||
for (int i = 0; (ActionText[i] = Dreamcast_A[i]) != '\0' && i < iLimitCopy; i++);
|
||||
break;
|
||||
case VEHICLE_TURRETLEFT:
|
||||
for (int i = 0; (ActionText[i] = Dreamcast_A[i]) != '\0' && i < iLimitCopy; i++);
|
||||
break;
|
||||
case VEHICLE_TURRETRIGHT:
|
||||
for (int i = 0; (ActionText[i] = Dreamcast_A[i]) != '\0' && i < iLimitCopy; i++);
|
||||
break;
|
||||
case VEHICLE_TURRETUP:
|
||||
for (int i = 0; (ActionText[i] = Dreamcast_A[i]) != '\0' && i < iLimitCopy; i++);
|
||||
break;
|
||||
case VEHICLE_TURRETDOWN:
|
||||
for (int i = 0; (ActionText[i] = Dreamcast_A[i]) != '\0' && i < iLimitCopy; i++);
|
||||
break;
|
||||
case CAMERA_CHANGE_VIEW_ALL_SITUATIONS:
|
||||
for (int i = 0; (ActionText[i] = Dreamcast_DPad_Up[i]) != '\0' && i < iLimitCopy; i++);
|
||||
break;
|
||||
case VEHICLE_LOOKBEHIND:
|
||||
for (int i = 0; (ActionText[i] = Dreamcast_LookBehind[i]) != '\0' && i < iLimitCopy; i++);
|
||||
break;
|
||||
case NETWORK_TALK: // Not Used on Dreamcast
|
||||
for (int i = 0; (ActionText[i] = Dreamcast_NotAssigned[i]) != '\0' && i < iLimitCopy; i++);
|
||||
break;
|
||||
|
||||
@@ -35,6 +35,7 @@
|
||||
#include "FileLoader.h"
|
||||
#include "frontendoption.h"
|
||||
#include "IniFile.h"
|
||||
#include "../skel/dc/dc.h"
|
||||
|
||||
// Game has colors inlined in code.
|
||||
// For easier modification we collect them here:
|
||||
@@ -234,12 +235,26 @@ const char* FrontendFilenames[][2] = {
|
||||
{"fe_iconaudio", "" },
|
||||
{"fe_icondisplay", "" },
|
||||
{"fe_iconlanguage", "" },
|
||||
|
||||
#ifdef RW_DC
|
||||
{"dc_xboxf",""},
|
||||
{"dc_xboxd",""},
|
||||
{"dc_ps2f",""},
|
||||
{"dc_ps2d",""},
|
||||
{"xbox_f",""},
|
||||
{"xbox_d",""},
|
||||
{"ps2_f",""},
|
||||
{"ps2_d",""},
|
||||
|
||||
#else
|
||||
{"fe_controller", "" },
|
||||
{"fe_controllersh", "" },
|
||||
{"fe_arrows1", "" },
|
||||
{"fe_arrows2", "" },
|
||||
{"fe_arrows3", "" },
|
||||
{"fe_arrows4", "" },
|
||||
|
||||
#endif
|
||||
{"fe_radio1", "" },
|
||||
{"fe_radio2", "" },
|
||||
{"fe_radio3", "" },
|
||||
@@ -1117,6 +1132,46 @@ CMenuManager::Draw()
|
||||
#ifdef PS2_SAVE_DIALOG
|
||||
if(!m_bRenderGameInMenu)
|
||||
#endif
|
||||
|
||||
#ifdef RW_DC
|
||||
if (aScreens[m_nCurrScreen].m_ScreenName[0] != '\0') {
|
||||
|
||||
SET_FONT_FOR_MENU_HEADER
|
||||
|
||||
if (strcmp("FET_AGS", aScreens[m_nCurrScreen].m_ScreenName) == 0)
|
||||
{
|
||||
wchar *PageName = nil;
|
||||
char asciiTemp[32];
|
||||
wchar unicodeTemp[64];
|
||||
|
||||
sprintf(asciiTemp, "CONTROLLER SETUP");
|
||||
AsciiToUnicode(asciiTemp, unicodeTemp);
|
||||
PageName = unicodeTemp;
|
||||
|
||||
CFont::PrintString(PAGE_NAME_X(MENUHEADER_POS_X), SCREEN_SCALE_FROM_BOTTOM(MENUHEADER_POS_Y), PageName);
|
||||
}
|
||||
else if (strcmp("FET_CTL", aScreens[m_nCurrScreen].m_ScreenName) == 0)
|
||||
{
|
||||
wchar *PageName = nil;
|
||||
char asciiTemp[32];
|
||||
wchar unicodeTemp[64];
|
||||
|
||||
sprintf(asciiTemp, "KEYBOARD MOUSE SETUP");
|
||||
AsciiToUnicode(asciiTemp, unicodeTemp);
|
||||
PageName = unicodeTemp;
|
||||
|
||||
CFont::PrintString(PAGE_NAME_X(MENUHEADER_POS_X), SCREEN_SCALE_FROM_BOTTOM(MENUHEADER_POS_Y), PageName);
|
||||
}
|
||||
else
|
||||
{
|
||||
CFont::PrintString(PAGE_NAME_X(MENUHEADER_POS_X), SCREEN_SCALE_FROM_BOTTOM(MENUHEADER_POS_Y), TheText.Get(aScreens[m_nCurrScreen].m_ScreenName));
|
||||
}
|
||||
|
||||
// Weird place to put that.
|
||||
nextYToUse += 24.0f + 10.0f;
|
||||
}
|
||||
|
||||
#else
|
||||
if (aScreens[m_nCurrScreen].m_ScreenName[0] != '\0') {
|
||||
|
||||
SET_FONT_FOR_MENU_HEADER
|
||||
@@ -1125,6 +1180,7 @@ CMenuManager::Draw()
|
||||
// Weird place to put that.
|
||||
nextYToUse += 24.0f + 10.0f;
|
||||
}
|
||||
#endif
|
||||
|
||||
CFont::SetFontStyle(FONT_LOCALE(FONT_BANK));
|
||||
CFont::SetScale(MENU_X(MENUACTION_SCALE_MULT * MENU_TEXT_SIZE_X), MENU_Y(MENUACTION_SCALE_MULT * MENU_TEXT_SIZE_Y));
|
||||
@@ -1379,7 +1435,29 @@ CMenuManager::Draw()
|
||||
sprintf(gString, "FEM_SL%d", i);
|
||||
leftText = TheText.Get(gString);
|
||||
}
|
||||
} else {
|
||||
}
|
||||
else if ((strcmp(aScreens[m_nCurrScreen].m_aEntries[i].m_EntryName, "FET_AGS")) == 0)
|
||||
{
|
||||
//wchar *rightText = nil;
|
||||
char asciiTemp[32];
|
||||
wchar unicodeTemp[64];
|
||||
|
||||
sprintf(asciiTemp, "CONTROLLER SETUP");
|
||||
AsciiToUnicode(asciiTemp, unicodeTemp);
|
||||
leftText = unicodeTemp;
|
||||
}
|
||||
else if ((strcmp(aScreens[m_nCurrScreen].m_aEntries[i].m_EntryName, "FET_CTL")) == 0)
|
||||
{
|
||||
//wchar *rightText = nil;
|
||||
char asciiTemp[32];
|
||||
wchar unicodeTemp[64];
|
||||
|
||||
sprintf(asciiTemp, "KEYBOARD MOUSE SETUP");
|
||||
AsciiToUnicode(asciiTemp, unicodeTemp);
|
||||
leftText = unicodeTemp;
|
||||
}
|
||||
|
||||
else {
|
||||
leftText = TheText.Get(aScreens[m_nCurrScreen].m_aEntries[i].m_EntryName);
|
||||
}
|
||||
|
||||
@@ -1460,10 +1538,16 @@ CMenuManager::Draw()
|
||||
case MENUACTION_CTRLCONFIG:
|
||||
switch (CPad::GetPad(0)->Mode) {
|
||||
case 0:
|
||||
rightText = TheText.Get("FEC_CF1");
|
||||
//rightText = TheText.Get("FEC_CF1");
|
||||
sprintf(asciiTemp, "XBOX LIKE");
|
||||
AsciiToUnicode(asciiTemp, unicodeTemp);
|
||||
rightText = unicodeTemp;
|
||||
break;
|
||||
case 1:
|
||||
rightText = TheText.Get("FEC_CF2");
|
||||
//rightText = TheText.Get("FEC_CF2");
|
||||
sprintf(asciiTemp, "PS2 LIKE");
|
||||
AsciiToUnicode(asciiTemp, unicodeTemp);
|
||||
rightText = unicodeTemp;
|
||||
break;
|
||||
case 2:
|
||||
rightText = TheText.Get("FEC_CF3");
|
||||
@@ -1930,6 +2014,15 @@ CMenuManager::Draw()
|
||||
CSprite2d::DrawRect(CRect(MENU_X_LEFT_ALIGNED(181), MENU_Y(99), MENU_X_LEFT_ALIGNED(229), MENU_Y(122)), CRGBA(m_PrefsPlayerRed, m_PrefsPlayerGreen, m_PrefsPlayerBlue, FadeIn(255)));
|
||||
}
|
||||
|
||||
char strver[200];
|
||||
wchar ustr[200];
|
||||
snprintf(strver, sizeof(strver), "DCA3: %s", getExecutableTag());
|
||||
AsciiToUnicode(strver, ustr);
|
||||
|
||||
CFont::SetScale(MENU_X(MENU_TEXT_SIZE_X*3/4), MENU_Y(MENU_TEXT_SIZE_Y*3/4));
|
||||
CFont::SetColor(CRGBA(MENUOPTION_COLOR.r, MENUOPTION_COLOR.g, MENUOPTION_COLOR.b, FadeIn(255)));
|
||||
CFont::PrintString(MENU_X_LEFT_ALIGNED(BUILDID_TEXT_LEFT_MARGIN), SCREEN_SCALE_FROM_BOTTOM(BUILDID_TEXT_BOTTOM_MARGIN), ustr);
|
||||
|
||||
}
|
||||
|
||||
int
|
||||
@@ -3715,7 +3808,11 @@ CMenuManager::LoadController(int8 type)
|
||||
}
|
||||
|
||||
// Unload current textures
|
||||
#ifdef RW_DC
|
||||
for (int i = DC_XBOXF; i <= PS2_D; i++)
|
||||
#else
|
||||
for (int i = FE_CONTROLLER; i <= FE_ARROWS4; i++)
|
||||
#endif
|
||||
m_aFrontEndSprites[i].Delete();
|
||||
|
||||
// Unload txd
|
||||
@@ -3748,7 +3845,11 @@ CMenuManager::LoadController(int8 type)
|
||||
assert(txdSlot != -1);
|
||||
// Load new textures
|
||||
CTxdStore::SetCurrentTxd(txdSlot);
|
||||
#ifdef RW_DC
|
||||
for (int i = DC_XBOXF; i <= PS2_D; i++) {
|
||||
#else
|
||||
for (int i = FE_CONTROLLER; i <= FE_ARROWS4; i++) {
|
||||
#endif
|
||||
m_aFrontEndSprites[i].SetTexture(FrontendFilenames[i][0], FrontendFilenames[i][1]);
|
||||
m_aFrontEndSprites[i].SetAddressing(rwTEXTUREADDRESSBORDER);
|
||||
}
|
||||
@@ -5378,10 +5479,12 @@ CMenuManager::ProcessButtonPresses(void)
|
||||
#ifdef FIX_BUGS
|
||||
case MENUACTION_CTRLCONFIG:
|
||||
CPad::GetPad(0)->Mode += changeValueBy;
|
||||
if (CPad::GetPad(0)->Mode > 3)
|
||||
//if (CPad::GetPad(0)->Mode > 3)
|
||||
if (CPad::GetPad(0)->Mode > 1)
|
||||
CPad::GetPad(0)->Mode = 0;
|
||||
else if (CPad::GetPad(0)->Mode < 0)
|
||||
CPad::GetPad(0)->Mode = 3;
|
||||
//CPad::GetPad(0)->Mode = 3;
|
||||
CPad::GetPad(0)->Mode = 1;
|
||||
SaveSettings();
|
||||
DMAudio.PlayFrontEndSound(SOUND_FRONTEND_MENU_SETTING_CHANGE, 0);
|
||||
break;
|
||||
@@ -5531,7 +5634,8 @@ CMenuManager::ProcessOnOffMenuOptions()
|
||||
#ifndef FIX_BUGS
|
||||
case MENUACTION_CTRLCONFIG:
|
||||
CPad::GetPad(0)->Mode++;
|
||||
if (CPad::GetPad(0)->Mode > 3)
|
||||
//if (CPad::GetPad(0)->Mode > 3)
|
||||
if (CPad::GetPad(0)->Mode > 1)
|
||||
CPad::GetPad(0)->Mode = 0;
|
||||
DMAudio.PlayFrontEndSound(SOUND_FRONTEND_MENU_SETTING_CHANGE, 0);
|
||||
break;
|
||||
@@ -5873,7 +5977,6 @@ CMenuManager::PrintController(void)
|
||||
|
||||
#define X(f) ((f)*scale + centerX)
|
||||
#define Y(f) ((f)*scale + centerY)
|
||||
|
||||
m_aFrontEndSprites[FE_CONTROLLERSH].Draw(MENU_X_LEFT_ALIGNED(X(-CONTROLLER_SIZE_X / 2)), MENU_Y(Y(-CONTROLLER_SIZE_Y / 2)), MENU_X((CONTROLLER_SIZE_X + 4.8f) * scale), MENU_Y((CONTROLLER_SIZE_Y + 4.8f) * scale), CRGBA(0, 0, 0, 255));
|
||||
m_aFrontEndSprites[FE_CONTROLLER].Draw(MENU_X_LEFT_ALIGNED(X(-CONTROLLER_SIZE_X / 2)), MENU_Y(Y(-CONTROLLER_SIZE_Y / 2)), MENU_X(CONTROLLER_SIZE_X * scale), MENU_Y(CONTROLLER_SIZE_Y * scale), CRGBA(255, 255, 255, 255));
|
||||
if (m_DisplayControllerOnFoot) {
|
||||
@@ -6164,7 +6267,373 @@ CMenuManager::PrintController(void)
|
||||
#undef X
|
||||
#undef Y
|
||||
}
|
||||
|
||||
#elif RW_DC
|
||||
void
|
||||
CMenuManager::PrintController(void)
|
||||
{
|
||||
// FIX: Originally this function doesn't have StretchX/Y, everything had constant pixel size (due to screen was abandoned early?)
|
||||
// Also texts and their alignment were very bad, so I tried to make them readable (commented out the original code, and marked the ones I added with X)
|
||||
|
||||
switch (CPad::GetPad(0)->Mode)
|
||||
{
|
||||
case 0: //Xbox Mode
|
||||
if (CPad::GetPad(0)->IsDualAnalog)
|
||||
{
|
||||
if (m_DisplayControllerOnFoot)
|
||||
m_aFrontEndSprites[XBOX_F].Draw(MENU_X_LEFT_ALIGNED(65.0f), MENU_Y(75.0f), MENU_X(512.0f), MENU_Y(256.0f), CRGBA(255, 255, 255, 255));
|
||||
else
|
||||
m_aFrontEndSprites[XBOX_D].Draw(MENU_X_LEFT_ALIGNED(65.0f), MENU_Y(75.0f), MENU_X(512.0f), MENU_Y(256.0f), CRGBA(255, 255, 255, 255));
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
if (m_DisplayControllerOnFoot)
|
||||
m_aFrontEndSprites[DC_XBOXF].Draw(MENU_X_LEFT_ALIGNED(65.0f), MENU_Y(75.0f), MENU_X(512.0f), MENU_Y(256.0f), CRGBA(255, 255, 255, 255));
|
||||
else
|
||||
m_aFrontEndSprites[DC_XBOXD].Draw(MENU_X_LEFT_ALIGNED(65.0f), MENU_Y(75.0f), MENU_X(512.0f), MENU_Y(256.0f), CRGBA(255, 255, 255, 255));
|
||||
}
|
||||
break;
|
||||
case 1: //PS2 Mode
|
||||
if (CPad::GetPad(0)->IsDualAnalog)
|
||||
{
|
||||
if (m_DisplayControllerOnFoot)
|
||||
m_aFrontEndSprites[PS2_F].Draw(MENU_X_LEFT_ALIGNED(65.0f), MENU_Y(75.0f), MENU_X(512.0f), MENU_Y(256.0f), CRGBA(255, 255, 255, 255));
|
||||
else
|
||||
m_aFrontEndSprites[PS2_D].Draw(MENU_X_LEFT_ALIGNED(65.0f), MENU_Y(75.0f), MENU_X(512.0f), MENU_Y(256.0f), CRGBA(255, 255, 255, 255));
|
||||
}
|
||||
else
|
||||
{
|
||||
if (m_DisplayControllerOnFoot)
|
||||
m_aFrontEndSprites[DC_PS2F].Draw(MENU_X_LEFT_ALIGNED(65.0f), MENU_Y(75.0f), MENU_X(512.0f), MENU_Y(256.0f), CRGBA(255, 255, 255, 255));
|
||||
else
|
||||
m_aFrontEndSprites[DC_PS2D].Draw(MENU_X_LEFT_ALIGNED(65.0f), MENU_Y(75.0f), MENU_X(512.0f), MENU_Y(256.0f), CRGBA(255, 255, 255, 255));
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
// CFont::SetFontStyle(FONT_LOCALE(FONT_BANK)); // X
|
||||
|
||||
// // CFont::SetScale(0.4f, 0.4f);
|
||||
// CFont::SetScale(MENU_X(SMALLESTTEXT_X_SCALE), MENU_Y(SMALLESTTEXT_Y_SCALE)); // X
|
||||
|
||||
// // CFont::SetColor(CRGBA(128, 128, 128, FadeIn(255)));
|
||||
// CFont::SetDropColor(CRGBA(0, 0, 0, FadeIn(255))); // X
|
||||
// CFont::SetDropShadowPosition(1); // X
|
||||
// CFont::SetColor(CRGBA(255, 255, 255, FadeIn(255))); // X
|
||||
|
||||
// if (m_DisplayControllerOnFoot) {
|
||||
// switch (CPad::GetPad(0)->Mode) {
|
||||
// case 0:
|
||||
// if (CPad::GetPad(0)->IsDualAnalog)
|
||||
// {
|
||||
// CFont::SetRightJustifyOn(); // X
|
||||
// CFont::PrintString(MENU_X_LEFT_ALIGNED(210.0f), MENU_Y(146.0f), TheText.Get("FEC_CWL"));
|
||||
// CFont::PrintString(MENU_X_LEFT_ALIGNED(156.0f), MENU_Y(185.0f), TheText.Get("FEC_LOF"));
|
||||
// CFont::PrintString(MENU_X_LEFT_ALIGNED(156.0f), MENU_Y(225.0f), TheText.Get("FEC_MOV"));
|
||||
// CFont::PrintString(MENU_X_LEFT_ALIGNED(156.0f), MENU_Y(257.0f), TheText.Get("FEC_MOV"));
|
||||
// CFont::SetJustifyOn(); // X
|
||||
// CFont::PrintString(MENU_X_LEFT_ALIGNED(263.0f), MENU_Y(301.0f), TheText.Get("FEC_CAM"));
|
||||
// CFont::PrintString(MENU_X_LEFT_ALIGNED(290.0f), MENU_Y(288.0f), TheText.Get("FEC_PAU"));
|
||||
// CFont::PrintString(MENU_X_LEFT_ALIGNED(344.0f), MENU_Y(146.0f), TheText.Get("FEC_CWR"));
|
||||
// CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(185.0f), TheText.Get("FEC_TAR"));
|
||||
// CFont::SetRightJustifyOn(); // X
|
||||
// CFont::PrintString(MENU_X_LEFT_ALIGNED(304.0f), MENU_Y(178.0f), TheText.Get("FEC_JUM"));
|
||||
// CFont::SetJustifyOn(); // X
|
||||
// CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(212.0f), TheText.Get("FEC_ENV"));
|
||||
// CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(225.0f), TheText.Get("FEC_ATT"));
|
||||
// CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(238.0f), TheText.Get("FEC_RUN"));
|
||||
// CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(254.0f), TheText.Get("FEC_FPC"));
|
||||
// CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(269.0f), TheText.Get("FEC_LB3"));
|
||||
// CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(282.0f), TheText.Get("FEC_R3"));
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// // CFont::SetRightJustifyOn(); // X
|
||||
// // CFont::PrintString(MENU_X_LEFT_ALIGNED(202.0f), MENU_Y(220.0f), TheText.Get("FEC_CWL"));
|
||||
// // CFont::PrintString(MENU_X_LEFT_ALIGNED(202.0f), MENU_Y(232.0f), TheText.Get("FEC_LB"));
|
||||
// // CFont::PrintString(MENU_X_LEFT_ALIGNED(202.0f), MENU_Y(206.0f), TheText.Get("FEC_CAM"));
|
||||
// // CFont::PrintString(MENU_X_LEFT_ALIGNED(202.0f), MENU_Y(176.0f), TheText.Get("FEC_MOV"));
|
||||
// // CFont::PrintString(MENU_X_LEFT_ALIGNED(247.0f), MENU_Y(101.0f), TheText.Get("FEC_TAR"));
|
||||
// // CFont::PrintString(MENU_X_LEFT_ALIGNED(297.0f), MENU_Y(89.0f), TheText.Get("FEC_CWR"));
|
||||
// // CFont::SetJustifyOn(); // X
|
||||
// // CFont::PrintString(MENU_X_LEFT_ALIGNED(438.45f), MENU_Y(257.0f), TheText.Get("FEC_PAU"));
|
||||
// // CFont::PrintString(MENU_X_LEFT_ALIGNED(344.0f), MENU_Y(89.0f), TheText.Get("FEC_CMR"));
|
||||
// // CFont::SetJustifyOn(); // X
|
||||
// // CFont::PrintString(MENU_X_LEFT_ALIGNED(438.45f), MENU_Y(195.0f), TheText.Get("FEC_JUM"));
|
||||
// // CFont::SetJustifyOn(); // X
|
||||
// // CFont::PrintString(MENU_X_LEFT_ALIGNED(438.45f), MENU_Y(178.0f), TheText.Get("FEC_ENV"));
|
||||
// // CFont::PrintString(MENU_X_LEFT_ALIGNED(438.45f), MENU_Y(212.0f), TheText.Get("FEC_RUN"));
|
||||
// // CFont::PrintString(MENU_X_LEFT_ALIGNED(394.0f), MENU_Y(101.0f), TheText.Get("FEC_ATT"));
|
||||
|
||||
// //CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(254.0f), TheText.Get("FEC_FPC"));
|
||||
// //CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(269.0f), TheText.Get("FEC_LB3"));
|
||||
// //CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(282.0f), TheText.Get("FEC_R3"));
|
||||
// }
|
||||
// break;
|
||||
// case 1:
|
||||
// if (CPad::GetPad(0)->IsDualAnalog)
|
||||
// {
|
||||
// CFont::SetRightJustifyOn(); // X
|
||||
// CFont::PrintString(MENU_X_LEFT_ALIGNED(210.0f), MENU_Y(146.0f), TheText.Get("FEC_CWL"));
|
||||
// CFont::PrintString(MENU_X_LEFT_ALIGNED(156.0f), MENU_Y(185.0f), TheText.Get("FEC_LOF"));
|
||||
// CFont::PrintString(MENU_X_LEFT_ALIGNED(156.0f), MENU_Y(225.0f), TheText.Get("FEC_MOV"));
|
||||
// CFont::PrintString(MENU_X_LEFT_ALIGNED(156.0f), MENU_Y(257.0f), TheText.Get("FEC_MOV"));
|
||||
// CFont::SetJustifyOn(); // X
|
||||
// CFont::PrintString(MENU_X_LEFT_ALIGNED(263.0f), MENU_Y(301.0f), TheText.Get("FEC_CAM"));
|
||||
// CFont::PrintString(MENU_X_LEFT_ALIGNED(290.0f), MENU_Y(288.0f), TheText.Get("FEC_PAU"));
|
||||
// CFont::PrintString(MENU_X_LEFT_ALIGNED(344.0f), MENU_Y(146.0f), TheText.Get("FEC_CWR"));
|
||||
// CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(185.0f), TheText.Get("FEC_TAR"));
|
||||
// CFont::SetRightJustifyOn(); // X
|
||||
// CFont::PrintString(MENU_X_LEFT_ALIGNED(304.0f), MENU_Y(178.0f), TheText.Get("FEC_JUM"));
|
||||
// CFont::SetJustifyOn(); // X
|
||||
// CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(212.0f), TheText.Get("FEC_ENV"));
|
||||
// CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(225.0f), TheText.Get("FEC_ATT"));
|
||||
// CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(238.0f), TheText.Get("FEC_RUN"));
|
||||
// CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(254.0f), TheText.Get("FEC_FPC"));
|
||||
// CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(269.0f), TheText.Get("FEC_LB3"));
|
||||
// CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(282.0f), TheText.Get("FEC_R3"));
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// CFont::SetRightJustifyOn(); // X
|
||||
// CFont::PrintString(MENU_X_LEFT_ALIGNED(202.0f), MENU_Y(220.0f), TheText.Get("FEC_CWL"));
|
||||
// CFont::PrintString(MENU_X_LEFT_ALIGNED(202.0f), MENU_Y(232.0f), TheText.Get("FEC_LB"));
|
||||
// CFont::PrintString(MENU_X_LEFT_ALIGNED(202.0f), MENU_Y(206.0f), TheText.Get("FEC_CAM"));
|
||||
// CFont::PrintString(MENU_X_LEFT_ALIGNED(202.0f), MENU_Y(176.0f), TheText.Get("FEC_MOV"));
|
||||
// CFont::PrintString(MENU_X_LEFT_ALIGNED(247.0f), MENU_Y(101.0f), TheText.Get("FEC_CMR"));
|
||||
// CFont::PrintString(MENU_X_LEFT_ALIGNED(297.0f), MENU_Y(89.0f), TheText.Get("FEC_CWR"));
|
||||
// CFont::SetJustifyOn(); // X
|
||||
// CFont::PrintString(MENU_X_LEFT_ALIGNED(438.45f), MENU_Y(257.0f), TheText.Get("FEC_PAU"));
|
||||
// CFont::PrintString(MENU_X_LEFT_ALIGNED(344.0f), MENU_Y(89.0f), TheText.Get("FEC_JUM"));
|
||||
// CFont::PrintString(MENU_X_LEFT_ALIGNED(438.45f), MENU_Y(178.0f), TheText.Get("FEC_ENV"));
|
||||
// CFont::PrintString(MENU_X_LEFT_ALIGNED(438.45f), MENU_Y(212.0f), TheText.Get("FEC_RUN"));
|
||||
// CFont::PrintString(MENU_X_LEFT_ALIGNED(394.0f), MENU_Y(101.0f), TheText.Get("FEC_TAR"));
|
||||
// CFont::PrintString(MENU_X_LEFT_ALIGNED(438.45f), MENU_Y(195.0f), TheText.Get("FEC_ATT"));
|
||||
|
||||
// //CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(254.0f), TheText.Get("FEC_FPC"));
|
||||
// //CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(269.0f), TheText.Get("FEC_LB3"));
|
||||
// //CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(282.0f), TheText.Get("FEC_R3"));
|
||||
// }
|
||||
// break;
|
||||
|
||||
// // CFont::SetRightJustifyOn(); // X
|
||||
// // CFont::PrintString(MENU_X_LEFT_ALIGNED(210.0f), MENU_Y(146.0f), TheText.Get("FEC_CWL"));
|
||||
// // CFont::PrintString(MENU_X_LEFT_ALIGNED(156.0f), MENU_Y(185.0f), TheText.Get("FEC_LOF"));
|
||||
// // CFont::PrintString(MENU_X_LEFT_ALIGNED(156.0f), MENU_Y(225.0f), TheText.Get("FEC_CAM"));
|
||||
// // CFont::PrintString(MENU_X_LEFT_ALIGNED(156.0f), MENU_Y(257.0f), TheText.Get("FEC_MOV"));
|
||||
// // CFont::SetJustifyOn(); // X
|
||||
// // CFont::PrintString(MENU_X_LEFT_ALIGNED(263.0f), MENU_Y(301.0f), TheText.Get("FEC_NA"));
|
||||
// // CFont::PrintString(MENU_X_LEFT_ALIGNED(290.0f), MENU_Y(288.0f), TheText.Get("FEC_PAU"));
|
||||
// // CFont::PrintString(MENU_X_LEFT_ALIGNED(344.0f), MENU_Y(146.0f), TheText.Get("FEC_CWR"));
|
||||
// // CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(185.0f), TheText.Get("FEC_TAR"));
|
||||
// // CFont::SetRightJustifyOn(); // X
|
||||
// // CFont::PrintString(MENU_X_LEFT_ALIGNED(304.0f), MENU_Y(178.0f), TheText.Get("FEC_JUM"));
|
||||
// // CFont::SetJustifyOn(); // X
|
||||
// // CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(212.0f), TheText.Get("FEC_ENV"));
|
||||
// // CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(225.0f), TheText.Get("FEC_ATT"));
|
||||
// // CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(238.0f), TheText.Get("FEC_RUN"));
|
||||
// // CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(254.0f), TheText.Get("FEC_FPC"));
|
||||
// // CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(269.0f), TheText.Get("FEC_LB3"));
|
||||
// // CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(282.0f), TheText.Get("FEC_R3"));
|
||||
// // break;
|
||||
// // case 2:
|
||||
// // CFont::SetRightJustifyOn(); // X
|
||||
// // CFont::PrintString(MENU_X_LEFT_ALIGNED(210.0f), MENU_Y(146.0f), TheText.Get("FEC_CWL"));
|
||||
// // CFont::PrintString(MENU_X_LEFT_ALIGNED(156.0f), MENU_Y(185.0f), TheText.Get("FEC_ENV"));
|
||||
// // CFont::PrintString(MENU_X_LEFT_ALIGNED(156.0f), MENU_Y(225.0f), TheText.Get("FEC_MOV"));
|
||||
// // CFont::PrintString(MENU_X_LEFT_ALIGNED(156.0f), MENU_Y(257.0f), TheText.Get("FEC_MOV"));
|
||||
// // CFont::SetJustifyOn(); // X
|
||||
// // CFont::PrintString(MENU_X_LEFT_ALIGNED(263.0f), MENU_Y(301.0f), TheText.Get("FEC_CAM"));
|
||||
// // CFont::PrintString(MENU_X_LEFT_ALIGNED(290.0f), MENU_Y(288.0f), TheText.Get("FEC_PAU"));
|
||||
// // CFont::PrintString(MENU_X_LEFT_ALIGNED(344.0f), MENU_Y(146.0f), TheText.Get("FEC_CWR"));
|
||||
// // CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(185.0f), TheText.Get("FEC_TAR"));
|
||||
// // CFont::SetRightJustifyOn(); // X
|
||||
// // CFont::PrintString(MENU_X_LEFT_ALIGNED(304.0f), MENU_Y(178.0f), TheText.Get("FEC_JUM"));
|
||||
// // CFont::SetJustifyOn(); // X
|
||||
// // CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(212.0f), TheText.Get("FEC_LOF"));
|
||||
// // CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(225.0f), TheText.Get("FEC_RUN"));
|
||||
// // CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(238.0f), TheText.Get("FEC_ATT"));
|
||||
// // CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(254.0f), TheText.Get("FEC_FPC"));
|
||||
// // CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(269.0f), TheText.Get("FEC_LB3"));
|
||||
// // CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(282.0f), TheText.Get("FEC_R3"));
|
||||
// // break;
|
||||
// // case 3:
|
||||
// // CFont::SetRightJustifyOn(); // X
|
||||
// // CFont::PrintString(MENU_X_LEFT_ALIGNED(210.0f), MENU_Y(146.0f), TheText.Get("FEC_CWL"));
|
||||
// // CFont::PrintString(MENU_X_LEFT_ALIGNED(156.0f), MENU_Y(185.0f), TheText.Get("FEC_TAR"));
|
||||
// // CFont::PrintString(MENU_X_LEFT_ALIGNED(156.0f), MENU_Y(225.0f), TheText.Get("FEC_NA"));
|
||||
// // CFont::PrintString(MENU_X_LEFT_ALIGNED(156.0f), MENU_Y(257.0f), TheText.Get("FEC_MOV"));
|
||||
// // CFont::SetJustifyOn(); // X
|
||||
// // CFont::PrintString(MENU_X_LEFT_ALIGNED(263.0f), MENU_Y(301.0f), TheText.Get("FEC_CAM"));
|
||||
// // CFont::PrintString(MENU_X_LEFT_ALIGNED(290.0f), MENU_Y(288.0f), TheText.Get("FEC_PAU"));
|
||||
// // CFont::PrintString(MENU_X_LEFT_ALIGNED(344.0f), MENU_Y(146.0f), TheText.Get("FEC_CWR"));
|
||||
// // CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(185.0f), TheText.Get("FEC_TAR"));
|
||||
// // CFont::SetRightJustifyOn(); // X
|
||||
// // CFont::PrintString(MENU_X_LEFT_ALIGNED(304.0f), MENU_Y(178.0f), TheText.Get("FEC_JUM"));
|
||||
// // CFont::SetJustifyOn(); // X
|
||||
// // CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(212.0f), TheText.Get("FEC_LOF"));
|
||||
// // CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(225.0f), TheText.Get("FEC_RUN"));
|
||||
// // CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(238.0f), TheText.Get("FEC_ATT"));
|
||||
// // CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(254.0f), TheText.Get("FEC_FPC"));
|
||||
// // CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(269.0f), TheText.Get("FEC_LB3"));
|
||||
// // CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(282.0f), TheText.Get("FEC_R3"));
|
||||
// // break;
|
||||
// default:
|
||||
// return;
|
||||
// }
|
||||
// } else {
|
||||
// switch (CPad::GetPad(0)->Mode) {
|
||||
// case 0:
|
||||
// // CFont::SetRightJustifyOn(); // X
|
||||
// // CFont::PrintString(MENU_X_LEFT_ALIGNED(210.0f), MENU_Y(146.0f), TheText.Get("FEC_LL"));
|
||||
// // CFont::PrintString(MENU_X_LEFT_ALIGNED(156.0f), MENU_Y(185.0f), TheText.Get("FEC_RSC"));
|
||||
// // CFont::PrintString(MENU_X_LEFT_ALIGNED(156.0f), MENU_Y(225.0f), TheText.Get("FEC_VES"));
|
||||
// // CFont::PrintString(MENU_X_LEFT_ALIGNED(156.0f), MENU_Y(257.0f), TheText.Get("FEC_VES"));
|
||||
// // CFont::SetJustifyOn(); // X
|
||||
// // CFont::PrintString(MENU_X_LEFT_ALIGNED(263.0f), MENU_Y(301.0f), TheText.Get("FEC_HO3"));
|
||||
// // CFont::PrintString(MENU_X_LEFT_ALIGNED(290.0f), MENU_Y(288.0f), TheText.Get("FEC_CAM"));
|
||||
// // CFont::PrintString(MENU_X_LEFT_ALIGNED(344.0f), MENU_Y(146.0f), TheText.Get("FEC_PAU"));
|
||||
// // CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(185.0f), TheText.Get("FEC_LB"));
|
||||
// // CFont::SetRightJustifyOn(); // X
|
||||
// // CFont::PrintString(MENU_X_LEFT_ALIGNED(304.0f), MENU_Y(178.0f), TheText.Get("FEC_LR"));
|
||||
// // CFont::SetJustifyOn(); // X
|
||||
// // CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(212.0f), TheText.Get("FEC_HAB"));
|
||||
// // CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(225.0f), TheText.Get("FEC_BRA"));
|
||||
// // CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(238.0f), TheText.Get("FEC_EXV"));
|
||||
// // CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(254.0f), TheText.Get("FEC_CAW"));
|
||||
// // CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(269.0f), TheText.Get("FEC_ACC"));
|
||||
// // CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(282.0f), TheText.Get("FEC_TUC"));
|
||||
// // // FIX: Coordinates of this line is undefined in PC...
|
||||
// // CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(304.0f), TheText.Get("FEC_SM3"));
|
||||
// // break;
|
||||
|
||||
// if (CPad::GetPad(0)->IsDualAnalog)
|
||||
// {
|
||||
// CFont::SetRightJustifyOn(); // X
|
||||
// CFont::PrintString(MENU_X_LEFT_ALIGNED(210.0f), MENU_Y(146.0f), TheText.Get("FEC_CWL"));
|
||||
// CFont::PrintString(MENU_X_LEFT_ALIGNED(156.0f), MENU_Y(185.0f), TheText.Get("FEC_LOF"));
|
||||
// CFont::PrintString(MENU_X_LEFT_ALIGNED(156.0f), MENU_Y(225.0f), TheText.Get("FEC_MOV"));
|
||||
// CFont::PrintString(MENU_X_LEFT_ALIGNED(156.0f), MENU_Y(257.0f), TheText.Get("FEC_MOV"));
|
||||
// CFont::SetJustifyOn(); // X
|
||||
// CFont::PrintString(MENU_X_LEFT_ALIGNED(263.0f), MENU_Y(301.0f), TheText.Get("FEC_CAM"));
|
||||
// CFont::PrintString(MENU_X_LEFT_ALIGNED(290.0f), MENU_Y(288.0f), TheText.Get("FEC_PAU"));
|
||||
// CFont::PrintString(MENU_X_LEFT_ALIGNED(344.0f), MENU_Y(146.0f), TheText.Get("FEC_CWR"));
|
||||
// CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(185.0f), TheText.Get("FEC_TAR"));
|
||||
// CFont::SetRightJustifyOn(); // X
|
||||
// CFont::PrintString(MENU_X_LEFT_ALIGNED(304.0f), MENU_Y(178.0f), TheText.Get("FEC_JUM"));
|
||||
// CFont::SetJustifyOn(); // X
|
||||
// CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(212.0f), TheText.Get("FEC_ENV"));
|
||||
// CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(225.0f), TheText.Get("FEC_ATT"));
|
||||
// CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(238.0f), TheText.Get("FEC_RUN"));
|
||||
// CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(254.0f), TheText.Get("FEC_FPC"));
|
||||
// CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(269.0f), TheText.Get("FEC_LB3"));
|
||||
// CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(282.0f), TheText.Get("FEC_R3"));
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// CFont::SetRightJustifyOn(); // X
|
||||
// CFont::PrintString(MENU_X_LEFT_ALIGNED(202.0f), MENU_Y(220.0f), TheText.Get("FEC_SUB"));
|
||||
// CFont::PrintString(MENU_X_LEFT_ALIGNED(202.0f), MENU_Y(232.0f), TheText.Get("FEC_HRN"));
|
||||
// CFont::PrintString(MENU_X_LEFT_ALIGNED(202.0f), MENU_Y(206.0f), TheText.Get("FEC_CAM"));
|
||||
// CFont::PrintString(MENU_X_LEFT_ALIGNED(202.0f), MENU_Y(176.0f), TheText.Get("FEC_VES"));
|
||||
// CFont::PrintString(MENU_X_LEFT_ALIGNED(247.0f), MENU_Y(101.0f), TheText.Get("FEC_BRA"));
|
||||
// CFont::PrintString(MENU_X_LEFT_ALIGNED(297.0f), MENU_Y(89.0f), TheText.Get("FEC_RSC"));
|
||||
// CFont::SetJustifyOn(); // X
|
||||
// CFont::PrintString(MENU_X_LEFT_ALIGNED(438.45f), MENU_Y(257.0f), TheText.Get("FEC_PAU"));
|
||||
// CFont::PrintString(MENU_X_LEFT_ALIGNED(344.0f), MENU_Y(89.0f), TheText.Get("FEC_CMR"));
|
||||
// CFont::SetJustifyOn(); // X
|
||||
// CFont::PrintString(MENU_X_LEFT_ALIGNED(438.45f), MENU_Y(195.0f), TheText.Get("FEC_HAB"));
|
||||
// CFont::SetJustifyOn(); // X
|
||||
|
||||
// CFont::PrintString(MENU_X_LEFT_ALIGNED(438.45f), MENU_Y(212.0f), TheText.Get("FEC_PFR"));
|
||||
// CFont::PrintString(MENU_X_LEFT_ALIGNED(394.0f), MENU_Y(101.0f), TheText.Get("FEC_ACC"));
|
||||
// CFont::PrintString(MENU_X_LEFT_ALIGNED(438.45f), MENU_Y(178.0f), TheText.Get("FEC_EXV"));
|
||||
|
||||
// //CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(254.0f), TheText.Get("FEC_FPC"));
|
||||
// //CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(269.0f), TheText.Get("FEC_LB3"));
|
||||
// //CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(282.0f), TheText.Get("FEC_R3"));
|
||||
// }
|
||||
|
||||
|
||||
// case 1:
|
||||
// CFont::SetRightJustifyOn(); // X
|
||||
// CFont::PrintString(MENU_X_LEFT_ALIGNED(210.0f), MENU_Y(146.0f), TheText.Get("FEC_LL"));
|
||||
// CFont::PrintString(MENU_X_LEFT_ALIGNED(156.0f), MENU_Y(185.0f), TheText.Get("FEC_HOR"));
|
||||
// CFont::PrintString(MENU_X_LEFT_ALIGNED(156.0f), MENU_Y(225.0f), TheText.Get("FEC_CAM"));
|
||||
// CFont::PrintString(MENU_X_LEFT_ALIGNED(156.0f), MENU_Y(257.0f), TheText.Get("FEC_VES"));
|
||||
// CFont::SetJustifyOn(); // X
|
||||
// CFont::PrintString(MENU_X_LEFT_ALIGNED(263.0f), MENU_Y(301.0f), TheText.Get("FEC_NA"));
|
||||
// CFont::PrintString(MENU_X_LEFT_ALIGNED(290.0f), MENU_Y(288.0f), TheText.Get("FEC_RSC"));
|
||||
// CFont::PrintString(MENU_X_LEFT_ALIGNED(344.0f), MENU_Y(146.0f), TheText.Get("FEC_PAU"));
|
||||
// CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(185.0f), TheText.Get("FEC_LB"));
|
||||
// CFont::SetRightJustifyOn(); // X
|
||||
// CFont::PrintString(MENU_X_LEFT_ALIGNED(304.0f), MENU_Y(178.0f), TheText.Get("FEC_LR"));
|
||||
// CFont::SetJustifyOn(); // X
|
||||
// CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(212.0f), TheText.Get("FEC_HAB"));
|
||||
// CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(225.0f), TheText.Get("FEC_BRA"));
|
||||
// CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(238.0f), TheText.Get("FEC_EXV"));
|
||||
// CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(254.0f), TheText.Get("FEC_CAW"));
|
||||
// CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(269.0f), TheText.Get("FEC_ACC"));
|
||||
// CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(282.0f), TheText.Get("FEC_TUC"));
|
||||
// // FIX: Coordinates of this line is undefined in PC...
|
||||
// CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(304.0f), TheText.Get("FEC_SM3"));
|
||||
// break;
|
||||
// // case 2:
|
||||
// // CFont::SetRightJustifyOn(); // X
|
||||
// // CFont::PrintString(MENU_X_LEFT_ALIGNED(210.0f), MENU_Y(146.0f), TheText.Get("FEC_LL"));
|
||||
// // CFont::PrintString(MENU_X_LEFT_ALIGNED(156.0f), MENU_Y(185.0f), TheText.Get("FEC_EXV"));
|
||||
// // CFont::PrintString(MENU_X_LEFT_ALIGNED(156.0f), MENU_Y(225.0f), TheText.Get("FEC_VES"));
|
||||
// // CFont::PrintString(MENU_X_LEFT_ALIGNED(156.0f), MENU_Y(257.0f), TheText.Get("FEC_VES"));
|
||||
// // CFont::SetJustifyOn(); // X
|
||||
// // CFont::PrintString(MENU_X_LEFT_ALIGNED(263.0f), MENU_Y(301.0f), TheText.Get("FEC_RS3"));
|
||||
// // CFont::PrintString(MENU_X_LEFT_ALIGNED(290.0f), MENU_Y(288.0f), TheText.Get("FEC_CAM"));
|
||||
// // CFont::PrintString(MENU_X_LEFT_ALIGNED(344.0f), MENU_Y(146.0f), TheText.Get("FEC_PAU"));
|
||||
// // CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(185.0f), TheText.Get("FEC_LB"));
|
||||
// // CFont::SetRightJustifyOn(); // X
|
||||
// // CFont::PrintString(MENU_X_LEFT_ALIGNED(304.0f), MENU_Y(178.0f), TheText.Get("FEC_LR"));
|
||||
// // CFont::SetJustifyOn(); // X
|
||||
// // CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(212.0f), TheText.Get("FEC_HOR"));
|
||||
// // CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(225.0f), TheText.Get("FEC_BRA"));
|
||||
// // CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(238.0f), TheText.Get("FEC_HAB"));
|
||||
// // CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(254.0f), TheText.Get("FEC_CAW"));
|
||||
// // CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(269.0f), TheText.Get("FEC_ACC"));
|
||||
// // CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(282.0f), TheText.Get("FEC_TUC"));
|
||||
// // // FIX: Coordinates of this line is undefined in PC...
|
||||
// // CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(304.0f), TheText.Get("FEC_SM3"));
|
||||
// // break;
|
||||
// // case 3:
|
||||
// // CFont::SetRightJustifyOn(); // X
|
||||
// // CFont::PrintString(MENU_X_LEFT_ALIGNED(210.0f), MENU_Y(146.0f), TheText.Get("FEC_LL"));
|
||||
// // CFont::PrintString(MENU_X_LEFT_ALIGNED(156.0f), MENU_Y(185.0f), TheText.Get("FEC_HAB"));
|
||||
// // CFont::PrintString(MENU_X_LEFT_ALIGNED(156.0f), MENU_Y(225.0f), TheText.Get("FEC_TUC"));
|
||||
// // CFont::PrintString(MENU_X_LEFT_ALIGNED(156.0f), MENU_Y(257.0f), TheText.Get("FEC_VES"));
|
||||
// // CFont::SetJustifyOn(); // X
|
||||
// // CFont::PrintString(MENU_X_LEFT_ALIGNED(263.0f), MENU_Y(301.0f), TheText.Get("FEC_HO3"));
|
||||
// // CFont::PrintString(MENU_X_LEFT_ALIGNED(290.0f), MENU_Y(288.0f), TheText.Get("FEC_CAM"));
|
||||
// // CFont::PrintString(MENU_X_LEFT_ALIGNED(344.0f), MENU_Y(146.0f), TheText.Get("FEC_PAU"));
|
||||
// // CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(185.0f), TheText.Get("FEC_LB"));
|
||||
// // CFont::SetRightJustifyOn(); // X
|
||||
// // CFont::PrintString(MENU_X_LEFT_ALIGNED(304.0f), MENU_Y(178.0f), TheText.Get("FEC_LR"));
|
||||
// // CFont::SetJustifyOn(); // X
|
||||
// // CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(212.0f), TheText.Get("FEC_CAW"));
|
||||
// // CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(225.0f), TheText.Get("FEC_SMT"));
|
||||
// // CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(238.0f), TheText.Get("FEC_EXV"));
|
||||
// // CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(254.0f), TheText.Get("FEC_RSC"));
|
||||
// // CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(269.0f), TheText.Get("FEC_NA"));
|
||||
// // CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(282.0f), TheText.Get("FEC_ACC"));
|
||||
// // // FIX: Coordinates of this line is undefined in PC...
|
||||
// // CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(304.0f), TheText.Get("FEC_BRA"));
|
||||
// // break;
|
||||
// default:
|
||||
// return;
|
||||
// }
|
||||
// }
|
||||
|
||||
// CFont::SetDropShadowPosition(0); // X
|
||||
}
|
||||
#else
|
||||
|
||||
void
|
||||
CMenuManager::PrintController(void)
|
||||
{
|
||||
@@ -6385,6 +6854,7 @@ CMenuManager::PrintController(void)
|
||||
|
||||
CFont::SetDropShadowPosition(0); // X
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef MENU_MAP
|
||||
|
||||
@@ -40,6 +40,9 @@
|
||||
#define HELPER_TEXT_LEFT_MARGIN 320.0f
|
||||
#define HELPER_TEXT_BOTTOM_MARGIN 120.0f
|
||||
|
||||
#define BUILDID_TEXT_LEFT_MARGIN 320.0f
|
||||
#define BUILDID_TEXT_BOTTOM_MARGIN 20.0f
|
||||
|
||||
#define PLAYERSETUP_LIST_TOP 28.0f
|
||||
#define PLAYERSETUP_LIST_BOTTOM 125.0f
|
||||
#define PLAYERSETUP_LIST_LEFT 200.0f
|
||||
@@ -102,12 +105,23 @@ enum eFrontendSprites
|
||||
FE_ICONAUDIO,
|
||||
FE_ICONDISPLAY,
|
||||
FE_ICONLANGUAGE,
|
||||
#ifdef RW_DC
|
||||
DC_XBOXF,
|
||||
DC_XBOXD,
|
||||
DC_PS2F,
|
||||
DC_PS2D,
|
||||
XBOX_F,
|
||||
XBOX_D,
|
||||
PS2_F,
|
||||
PS2_D,
|
||||
#else
|
||||
FE_CONTROLLER,
|
||||
FE_CONTROLLERSH,
|
||||
FE_ARROWS1,
|
||||
FE_ARROWS2,
|
||||
FE_ARROWS3,
|
||||
FE_ARROWS4,
|
||||
#endif
|
||||
FE_RADIO1,
|
||||
FE_RADIO2,
|
||||
FE_RADIO3,
|
||||
|
||||
@@ -662,6 +662,9 @@ bool CGame::Initialise(const char* datFile)
|
||||
CCollision::ms_collisionInMemory = currLevel;
|
||||
for (int i = 0; i < MAX_PADS; i++)
|
||||
CPad::GetPad(i)->Clear(true);
|
||||
#ifdef RW_DC
|
||||
//CPad::GetPad(0)->IsDualAnalog = false;
|
||||
#endif
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -764,11 +764,8 @@ CMenuScreenCustom aScreens[MENUPAGES] = {
|
||||
|
||||
// MENUPAGE_OPTIONS = 41
|
||||
{ "FET_OPT", MENUPAGE_NONE, MENUPAGE_NONE, nil, nil,
|
||||
#ifdef GTA_HANDHELD
|
||||
MENUACTION_CHANGEMENU, "FET_CTL", { nil, SAVESLOT_NONE, MENUPAGE_CONTROLLER_SETTINGS },
|
||||
#else
|
||||
MENUACTION_CHANGEMENU, "FET_AGS", { nil, SAVESLOT_NONE, MENUPAGE_CONTROLLER_SETTINGS },
|
||||
MENUACTION_CHANGEMENU, "FET_CTL", { nil, SAVESLOT_NONE, MENUPAGE_CONTROLLER_PC },
|
||||
#endif
|
||||
MENUACTION_LOADRADIO, "FET_AUD", { nil, SAVESLOT_NONE, MENUPAGE_SOUND_SETTINGS },
|
||||
MENUACTION_CHANGEMENU, "FET_DIS", { nil, SAVESLOT_NONE, MENUPAGE_DISPLAY_SETTINGS },
|
||||
#ifdef GRAPHICS_MENU_OPTIONS
|
||||
|
||||
1324
src/core/Pad.cpp
Normal file → Executable file
1324
src/core/Pad.cpp
Normal file → Executable file
File diff suppressed because it is too large
Load Diff
@@ -23,7 +23,7 @@ public:
|
||||
int16 DPadUp, DPadDown, DPadLeft, DPadRight;
|
||||
int16 Start, Select;
|
||||
int16 Square, Triangle, Cross, Circle;
|
||||
uint32_t A, B, C, X, Y, Z;
|
||||
uint32_t A, B, C, D, X, Y, Z;
|
||||
int16 LeftShock, RightShock;
|
||||
int16 NetworkTalk;
|
||||
float GetLeftStickX(void) { return LeftStickX/32767.0f; };
|
||||
@@ -161,6 +161,13 @@ public:
|
||||
int32 LastTimeTouched;
|
||||
int32 AverageWeapon;
|
||||
int32 AverageEntries;
|
||||
bool IsKeyboardMouse;
|
||||
bool IsDualAnalog;
|
||||
bool CameraJustDown;
|
||||
bool CameraJustUp;
|
||||
uint32 CameraJustUpTime;
|
||||
uint32 CameraLastPressed;
|
||||
bool CameraIsDoublePressed;
|
||||
|
||||
#ifdef DETECT_PAD_INPUT_SWITCH
|
||||
static bool IsAffectedByController;
|
||||
@@ -211,7 +218,11 @@ public:
|
||||
void StopShaking(int16 pad);
|
||||
|
||||
static CPad *GetPad(int32 pad);
|
||||
|
||||
|
||||
#ifdef RW_DC
|
||||
bool CameraSinglePress(void); //Checks if camera modifier was double clicked
|
||||
bool CameraDoublePress(void);
|
||||
#endif
|
||||
int16 GetSteeringLeftRight(void);
|
||||
int16 GetSteeringUpDown(void);
|
||||
int16 GetCarGunUpDown(void);
|
||||
|
||||
@@ -187,8 +187,8 @@ __always_inline uint32 ldb(uint32 p, uint32 s, uint32 w)
|
||||
#define SCREEN_HEIGHT ((float)448)
|
||||
#endif
|
||||
#else
|
||||
#define SCREEN_WIDTH ((float)640)
|
||||
#define SCREEN_HEIGHT ((float)480)
|
||||
extern float SCREEN_WIDTH;
|
||||
extern float SCREEN_HEIGHT;
|
||||
#endif
|
||||
|
||||
#define SCREEN_HEIGHT_PAL ((float)512)
|
||||
|
||||
@@ -311,7 +311,7 @@ enum Config {
|
||||
#define DEFAULT_NATIVE_RESOLUTION // Set default video mode to your native resolution (fixes Windows 10 launch)
|
||||
// #define USE_TXD_CDIMAGE // generate and load textures from txd.img
|
||||
// #define PS2_ALPHA_TEST // emulate ps2 alpha test
|
||||
#define IMPROVED_VIDEOMODE // save and load videomode parameters instead of a magic number
|
||||
//#define IMPROVED_VIDEOMODE // save and load videomode parameters instead of a magic number
|
||||
// #define DISABLE_LOADING_SCREEN // disable the loading screen which vastly improves the loading time
|
||||
#ifdef DISABLE_LOADING_SCREEN
|
||||
// enable the PC splash
|
||||
@@ -327,7 +327,7 @@ enum Config {
|
||||
//#define NEW_RENDERER // leeds-like world rendering, needs librw
|
||||
#endif
|
||||
|
||||
#define FIX_SPRITES // fix sprites aspect ratio(moon, coronas, particle etc)
|
||||
// #define FIX_SPRITES // fix sprites aspect ratio(moon, coronas, particle etc) // JP - Disabled this as it produces incorrect aspect ratio with custom screen resolutions and is not needed otherwise
|
||||
|
||||
#ifndef EXTENDED_COLOURFILTER
|
||||
#undef SCREEN_DROPLETS // we need the backbuffer for this effect
|
||||
|
||||
@@ -1196,8 +1196,8 @@ void re3_assert(const char *expr, const char *filename, unsigned int lineno, con
|
||||
stacktrace();
|
||||
dbgio_dev_select("fb");
|
||||
sleep(1);
|
||||
dbgio_printf("RE3 ASSERT FAILED\n\tFile: %s\n\tLine: %d\n\tFunction: %s\n\tExpression: %s\n",filename,lineno,func,expr);
|
||||
dbgio_printf("POSIX error (may not be relevant): %s\n", strerror(errno));
|
||||
dbglog(DBG_CRITICAL, "RE3 ASSERT FAILED\n\tFile: %s\n\tLine: %d\n\tFunction: %s\n\tExpression: %s\n",filename,lineno,func,expr);
|
||||
dbglog(DBG_CRITICAL, "POSIX error (may not be relevant): %s\n", strerror(errno));
|
||||
stacktrace();
|
||||
dbgio_flush();
|
||||
abort();
|
||||
|
||||
@@ -282,7 +282,7 @@ CMatrix::SetRotate(float xAngle, float yAngle, float zAngle)
|
||||
void
|
||||
CMatrix::RotateX(float x)
|
||||
{
|
||||
#ifdef DC_SH4
|
||||
#if 0 && defined(DC_SH4) // this is bugged and does not yield correct results
|
||||
mat_load(reinterpret_cast<matrix_t *>(this));
|
||||
mat_rotate_x(x);
|
||||
mat_store(reinterpret_cast<matrix_t *>(this));
|
||||
@@ -312,7 +312,7 @@ CMatrix::RotateX(float x)
|
||||
void
|
||||
CMatrix::RotateY(float y)
|
||||
{
|
||||
#ifdef DC_SH4
|
||||
#if 0 && defined(DC_SH4) // this is bugged and does not yield correct results
|
||||
mat_load(reinterpret_cast<matrix_t *>(this));
|
||||
mat_rotate_y(y);
|
||||
mat_store(reinterpret_cast<matrix_t *>(this));
|
||||
@@ -342,7 +342,7 @@ CMatrix::RotateY(float y)
|
||||
void
|
||||
CMatrix::RotateZ(float z)
|
||||
{
|
||||
#ifdef DC_SH4
|
||||
#if 0 && defined(DC_SH4) // this is bugged and does not yield correct results
|
||||
mat_load(reinterpret_cast<matrix_t *>(this));
|
||||
mat_rotate_z(z);
|
||||
mat_store(reinterpret_cast<matrix_t *>(this));
|
||||
@@ -372,7 +372,7 @@ CMatrix::RotateZ(float z)
|
||||
void
|
||||
CMatrix::Rotate(float x, float y, float z)
|
||||
{
|
||||
#ifdef DC_SH4
|
||||
#if 0 && defined(DC_SH4) // this is bugged and does not yield correct results
|
||||
mat_load(reinterpret_cast<matrix_t *>(this));
|
||||
mat_rotate(x, y, z);
|
||||
mat_store(reinterpret_cast<matrix_t *>(this));
|
||||
@@ -404,6 +404,20 @@ CMatrix::Rotate(float x, float y, float z)
|
||||
float z2 = sZ * sY - (cZ * sX) * cY;
|
||||
float z3 = cX * cY;
|
||||
|
||||
#if !defined(DC_TEXCONV) && !defined(DC_SIM)
|
||||
this->rx = fipr(x1, y1, z1, 0, rx, ry, rz, 0);
|
||||
this->ry = fipr(x2, y2, z2, 0, rx, ry, rz, 0);
|
||||
this->rz = fipr(x3, y3, z3, 0, rx, ry, rz, 0);
|
||||
this->fx = fipr(x1, y1, z1, 0, ux, uy, uz, 0);
|
||||
this->fy = fipr(x2, y2, z2, 0, ux, uy, uz, 0);
|
||||
this->fz = fipr(x3, y3, z3, 0, ux, uy, uz, 0);
|
||||
this->ux = fipr(x1, y1, z1, 0, ax, ay, az, 0);
|
||||
this->uy = fipr(x2, y2, z2, 0, ax, ay, az, 0);
|
||||
this->uz = fipr(x3, y3, z3, 0, ax, ay, az, 0);
|
||||
this->px = fipr(x1, y1, z1, 0, px, py, pz, 0);
|
||||
this->py = fipr(x2, y2, z2, 0, px, py, pz, 0);
|
||||
this->pz = fipr(x3, y3, z3, 0, px, py, pz, 0);
|
||||
#else
|
||||
this->rx = x1 * rx + y1 * ry + z1 * rz;
|
||||
this->ry = x2 * rx + y2 * ry + z2 * rz;
|
||||
this->rz = x3 * rx + y3 * ry + z3 * rz;
|
||||
@@ -416,6 +430,7 @@ CMatrix::Rotate(float x, float y, float z)
|
||||
this->px = x1 * px + y1 * py + z1 * pz;
|
||||
this->py = x2 * px + y2 * py + z2 * pz;
|
||||
this->pz = x3 * px + y3 * py + z3 * pz;
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -41,7 +41,11 @@ CDraw::FindAspectRatio(void)
|
||||
#else
|
||||
switch (FrontEndMenuManager.m_PrefsUseWideScreen) {
|
||||
case AR_AUTO:
|
||||
#ifdef DC_SH4
|
||||
return 4.0f / 3.0f;
|
||||
#else
|
||||
return SCREEN_WIDTH / SCREEN_HEIGHT;
|
||||
#endif
|
||||
default:
|
||||
case AR_4_3:
|
||||
return 4.0f / 3.0f;
|
||||
|
||||
@@ -134,7 +134,7 @@ CMBlur::MotionBlurOpen(RwCamera *cam)
|
||||
|
||||
return TRUE;
|
||||
#else
|
||||
RwRect rect = { 0, 0, 640, 480 };
|
||||
RwRect rect = { 0, 0, (rw::int32)SCREEN_WIDTH, (rw::int32)SCREEN_HEIGHT };
|
||||
CreateImmediateModeData(cam, &rect);
|
||||
return TRUE;
|
||||
#endif
|
||||
|
||||
@@ -1479,7 +1479,8 @@ CWaterLevel::AllocateBoatWakeArray()
|
||||
apGeomArray[geom] = RpGeometryCreate(9*9, 8*8*2, rpGEOMETRYTRISTRIP
|
||||
| rpGEOMETRYPRELIT
|
||||
| rpGEOMETRYMODULATEMATERIALCOLOR
|
||||
| rpGEOMETRYTEXTURED);
|
||||
| rpGEOMETRYTEXTURED
|
||||
| rw::Geometry::HAS_TRIANGLES/* RW_DC specific */);
|
||||
ASSERT(apGeomArray[geom] != nil);
|
||||
|
||||
RpTriangle *geomTriangles = RpGeometryGetTriangles(apGeomArray[geom]);
|
||||
|
||||
@@ -62,6 +62,10 @@ long _dwOperatingSystemVersion;
|
||||
#include "AnimViewer.h"
|
||||
#include "Font.h"
|
||||
#include "MemoryMgr.h"
|
||||
#include "../../dreamcast/git-version.h"
|
||||
#include "dc.h"
|
||||
|
||||
#include <kos/dbglog.h>
|
||||
|
||||
// This is defined on project-level, via premake5 or cmake
|
||||
#ifdef GET_KEYBOARD_INPUT_FROM_X11
|
||||
@@ -873,10 +877,6 @@ psSelectDevice()
|
||||
|
||||
/* Get the default selection */
|
||||
GcurSel = RwEngineGetCurrentSubSystem();
|
||||
#ifdef IMPROVED_VIDEOMODE
|
||||
if(FrontEndMenuManager.m_nPrefsSubsystem < GnumSubSystems)
|
||||
GcurSel = FrontEndMenuManager.m_nPrefsSubsystem;
|
||||
#endif
|
||||
}
|
||||
|
||||
/* Set the driver to use the correct sub system */
|
||||
@@ -885,11 +885,6 @@ psSelectDevice()
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
#ifdef IMPROVED_VIDEOMODE
|
||||
FrontEndMenuManager.m_nPrefsSubsystem = GcurSel;
|
||||
#endif
|
||||
|
||||
#ifndef IMPROVED_VIDEOMODE
|
||||
if ( !useDefault )
|
||||
{
|
||||
if ( _psGetVideoModeList()[FrontEndMenuManager.m_nDisplayVideoMode] && FrontEndMenuManager.m_nDisplayVideoMode )
|
||||
@@ -899,97 +894,11 @@ psSelectDevice()
|
||||
}
|
||||
else
|
||||
{
|
||||
#ifdef DEFAULT_NATIVE_RESOLUTION
|
||||
// get the native video mode
|
||||
HDC hDevice = GetDC(NULL);
|
||||
int w = GetDeviceCaps(hDevice, HORZRES);
|
||||
int h = GetDeviceCaps(hDevice, VERTRES);
|
||||
int d = GetDeviceCaps(hDevice, BITSPIXEL);
|
||||
#else
|
||||
const int w = 640;
|
||||
const int h = 480;
|
||||
const int d = 16;
|
||||
#endif
|
||||
while ( !modeFound && GcurSelVM < RwEngineGetNumVideoModes() )
|
||||
{
|
||||
RwEngineGetVideoModeInfo(&vm, GcurSelVM);
|
||||
if ( defaultFullscreenRes && vm.width != w
|
||||
|| vm.height != h
|
||||
|| vm.depth != d
|
||||
|| !(vm.flags & rwVIDEOMODEEXCLUSIVE) )
|
||||
++GcurSelVM;
|
||||
else
|
||||
modeFound = TRUE;
|
||||
}
|
||||
|
||||
if ( !modeFound )
|
||||
{
|
||||
#ifdef DEFAULT_NATIVE_RESOLUTION
|
||||
GcurSelVM = 1;
|
||||
#else
|
||||
printf("WARNING: Cannot find 640x480 video mode, selecting device cancelled\n");
|
||||
return FALSE;
|
||||
#endif
|
||||
}
|
||||
GcurSelVM = 0;
|
||||
}
|
||||
}
|
||||
#else
|
||||
if ( !useDefault )
|
||||
{
|
||||
if(FrontEndMenuManager.m_nPrefsWidth == 0 ||
|
||||
FrontEndMenuManager.m_nPrefsHeight == 0 ||
|
||||
FrontEndMenuManager.m_nPrefsDepth == 0){
|
||||
// Defaults if nothing specified
|
||||
//const GLFWvidmode *mode = glfwGetVideoMode(glfwGetPrimaryMonitor());
|
||||
FrontEndMenuManager.m_nPrefsWidth = 640; //mode->width;
|
||||
FrontEndMenuManager.m_nPrefsHeight = 480; //mode->height;
|
||||
FrontEndMenuManager.m_nPrefsDepth = 16;
|
||||
FrontEndMenuManager.m_nPrefsWindowed = 0;
|
||||
}
|
||||
|
||||
// Find the videomode that best fits what we got from the settings file
|
||||
RwInt32 bestFsMode = -1;
|
||||
RwInt32 bestWidth = -1;
|
||||
RwInt32 bestHeight = -1;
|
||||
RwInt32 bestDepth = -1;
|
||||
for(GcurSelVM = 0; GcurSelVM < RwEngineGetNumVideoModes(); GcurSelVM++){
|
||||
RwEngineGetVideoModeInfo(&vm, GcurSelVM);
|
||||
bestWndMode = GcurSelVM;
|
||||
bestWidth = vm.width;
|
||||
bestHeight = vm.height;
|
||||
bestDepth = vm.depth;
|
||||
bestFsMode = GcurSelVM;
|
||||
break;
|
||||
}
|
||||
|
||||
if(bestFsMode < 0){
|
||||
printf("WARNING: Cannot find desired video mode, selecting device cancelled\n");
|
||||
return FALSE;
|
||||
}
|
||||
GcurSelVM = bestFsMode;
|
||||
|
||||
FrontEndMenuManager.m_nDisplayVideoMode = GcurSelVM;
|
||||
FrontEndMenuManager.m_nPrefsVideoMode = FrontEndMenuManager.m_nDisplayVideoMode;
|
||||
|
||||
FrontEndMenuManager.m_nSelectedScreenMode = FrontEndMenuManager.m_nPrefsWindowed;
|
||||
}
|
||||
#endif
|
||||
|
||||
RwEngineGetVideoModeInfo(&vm, GcurSelVM);
|
||||
|
||||
#ifdef IMPROVED_VIDEOMODE
|
||||
if (FrontEndMenuManager.m_nPrefsWindowed)
|
||||
GcurSelVM = bestWndMode;
|
||||
|
||||
// Now GcurSelVM is 0 but vm has sizes(and fullscreen flag) of the video mode we want, that's why we changed the rwVIDEOMODEEXCLUSIVE conditions below
|
||||
FrontEndMenuManager.m_nPrefsWidth = vm.width;
|
||||
FrontEndMenuManager.m_nPrefsHeight = vm.height;
|
||||
FrontEndMenuManager.m_nPrefsDepth = vm.depth;
|
||||
#endif
|
||||
|
||||
#ifndef PS2_MENU
|
||||
FrontEndMenuManager.m_nCurrOption = 0;
|
||||
#endif
|
||||
|
||||
/* Set up the video mode and set the apps window
|
||||
* dimensions to match */
|
||||
@@ -1012,25 +921,6 @@ psSelectDevice()
|
||||
}
|
||||
}
|
||||
*/
|
||||
#ifndef IMPROVED_VIDEOMODE
|
||||
if (vm.flags & rwVIDEOMODEEXCLUSIVE)
|
||||
{
|
||||
RsGlobal.maximumWidth = vm.width;
|
||||
RsGlobal.maximumHeight = vm.height;
|
||||
RsGlobal.width = vm.width;
|
||||
RsGlobal.height = vm.height;
|
||||
|
||||
PSGLOBAL(fullScreen) = TRUE;
|
||||
}
|
||||
#else
|
||||
RsGlobal.maximumWidth = FrontEndMenuManager.m_nPrefsWidth;
|
||||
RsGlobal.maximumHeight = FrontEndMenuManager.m_nPrefsHeight;
|
||||
RsGlobal.width = FrontEndMenuManager.m_nPrefsWidth;
|
||||
RsGlobal.height = FrontEndMenuManager.m_nPrefsHeight;
|
||||
|
||||
PSGLOBAL(fullScreen) = !FrontEndMenuManager.m_nPrefsWindowed;
|
||||
#endif
|
||||
|
||||
#ifdef MULTISAMPLING
|
||||
RwD3D8EngineSetMultiSamplingLevels(1 << FrontEndMenuManager.m_nPrefsMSAALevel);
|
||||
#endif
|
||||
@@ -1977,13 +1867,14 @@ __attribute__((noinline)) void stacktrace() {
|
||||
: "+r" (sp), "+r" (pr)
|
||||
:
|
||||
: );
|
||||
dbgio_printf("Stack trace: %p ", (void*)pr);
|
||||
dbglog(DBG_CRITICAL, "DCA3: %s\n", getExecutableTag());
|
||||
dbglog(DBG_CRITICAL, "Stack trace: %p ", (void*)pr);
|
||||
int found = 0;
|
||||
if(!(sp & 3) && sp > 0x8c000000 && sp < _arch_mem_top) {
|
||||
char** sp_ptr = (char**)sp;
|
||||
for (int so = 0; so < 16384; so++) {
|
||||
if (uintptr_t(&sp_ptr[so]) >= _arch_mem_top) {
|
||||
dbgio_printf("(@@%p) ", &sp_ptr[so]);
|
||||
dbglog(DBG_CRITICAL, "(@@%p) ", &sp_ptr[so]);
|
||||
break;
|
||||
}
|
||||
if (sp_ptr[so] > (char*)0x8c000000 && sp_ptr[so] < etext) {
|
||||
@@ -1999,9 +1890,9 @@ __attribute__((noinline)) void stacktrace() {
|
||||
uint16_t instr = instrp[-2];
|
||||
// BSR or BSRF or JSR @Rn ?
|
||||
if (((instr & 0xf000) == 0xB000) || ((instr & 0xf0ff) == 0x0003) || ((instr & 0xf0ff) == 0x400B)) {
|
||||
dbgio_printf("%p ", instrp);
|
||||
dbglog(DBG_CRITICAL, "%p ", instrp);
|
||||
if (found++ > 24) {
|
||||
dbgio_printf("(@%p) ", &sp_ptr[so]);
|
||||
dbglog(DBG_CRITICAL, "(@%p) ", &sp_ptr[so]);
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
@@ -2011,15 +1902,83 @@ __attribute__((noinline)) void stacktrace() {
|
||||
// dbglog(DBG_CRITICAL, "Stack trace: %p (@%p): out of range\n", (void*)sp_ptr[so], &sp_ptr[so]);
|
||||
}
|
||||
}
|
||||
dbgio_printf("end\n");
|
||||
dbglog(DBG_CRITICAL, "end\n");
|
||||
} else {
|
||||
dbgio_printf("(@%p)\n", (void*)sp);
|
||||
dbglog(DBG_CRITICAL, "(@%p)\n", (void*)sp);
|
||||
}
|
||||
}
|
||||
|
||||
#include <cstdint>
|
||||
#include <cstdio>
|
||||
#include <string>
|
||||
#include <iomanip>
|
||||
#include <sstream>
|
||||
|
||||
extern "C" {
|
||||
extern const unsigned char _build_id_start[];
|
||||
extern const unsigned char _build_id_end[];
|
||||
}
|
||||
|
||||
std::string getBuildId()
|
||||
{
|
||||
// Pointer to the start of the .note.gnu.build-id section
|
||||
const unsigned char *p = _build_id_start;
|
||||
|
||||
// Parse the ELF note header
|
||||
struct NoteHeader {
|
||||
uint32_t n_namesz;
|
||||
uint32_t n_descsz;
|
||||
uint32_t n_type;
|
||||
};
|
||||
|
||||
// Read header fields (be careful with endianness if needed)
|
||||
const auto* note = reinterpret_cast<const NoteHeader*>(p);
|
||||
|
||||
// Move p beyond the note header
|
||||
p += sizeof(NoteHeader);
|
||||
|
||||
// Skip the "name" field + alignment (e.g. "GNU\0")
|
||||
// name is note->n_namesz bytes, then align up to 4 bytes
|
||||
auto nameBytes = (note->n_namesz + 3u) & ~3u;
|
||||
p += nameBytes;
|
||||
|
||||
// Now p should point to the actual build-id bytes, which are note->n_descsz in length.
|
||||
const unsigned char* buildId = p;
|
||||
auto buildIdSize = note->n_descsz;
|
||||
|
||||
// Convert it to a hex string
|
||||
std::ostringstream oss;
|
||||
oss << std::hex << std::setfill('0');
|
||||
for (uint32_t i = 0; i < buildIdSize; i++) {
|
||||
oss << std::setw(2) << static_cast<unsigned>(buildId[i]);
|
||||
}
|
||||
|
||||
return oss.str();
|
||||
}
|
||||
#else
|
||||
std::string getBuildId() {
|
||||
return "non-dreamcast-build";
|
||||
}
|
||||
#endif
|
||||
|
||||
const char* getSourceId() {
|
||||
return GIT_VERSION;
|
||||
}
|
||||
|
||||
const char* getCIJobId() {
|
||||
return CI_JOB_ID;
|
||||
}
|
||||
|
||||
static std::string executableTag = getBuildId().substr(0, 10) + ":" + getSourceId() + ":" + getCIJobId();
|
||||
|
||||
const char* getExecutableTag() {
|
||||
return executableTag.c_str();
|
||||
}
|
||||
|
||||
int
|
||||
main(int argc, char *argv[])
|
||||
{
|
||||
dbglog(DBG_CRITICAL, "DCA3: %s\n", getExecutableTag());
|
||||
#if !defined(DC_SIM)
|
||||
std::set_terminate([]() {
|
||||
fflush(stdout);
|
||||
@@ -2029,8 +1988,8 @@ main(int argc, char *argv[])
|
||||
stacktrace();
|
||||
dbgio_dev_select("fb");
|
||||
sleep(1);
|
||||
dbgio_printf("std::terminate() called\n");
|
||||
dbgio_printf("POSIX error (may not be relevant): %s\n", strerror(errno));
|
||||
dbglog(DBG_CRITICAL, "std::terminate() called\n");
|
||||
dbglog(DBG_CRITICAL, "POSIX error (may not be relevant): %s\n", strerror(errno));
|
||||
stacktrace();
|
||||
dbgio_flush();
|
||||
|
||||
|
||||
7
src/skel/dc/dc.h
Normal file
7
src/skel/dc/dc.h
Normal file
@@ -0,0 +1,7 @@
|
||||
#pragma once
|
||||
#include <string>
|
||||
|
||||
std::string getBuildId();
|
||||
const char* getSourceId();
|
||||
const char* getCIJobId();
|
||||
const char* getExecutableTag();
|
||||
2
vendor/dca3-kos
vendored
2
vendor/dca3-kos
vendored
Submodule vendor/dca3-kos updated: 0b2de9228b...6e9ab783f3
9
vendor/librw/src/d3d-x/d3d.cpp
vendored
9
vendor/librw/src/d3d-x/d3d.cpp
vendored
@@ -902,10 +902,15 @@ rasterToImage(Raster *raster)
|
||||
depth = 16;
|
||||
conv = conv_ARGB1555_from_RGB555;
|
||||
break;
|
||||
|
||||
default:
|
||||
case Raster::C565:
|
||||
depth = 24;
|
||||
conv = conv_RGB888_from_BGR565;
|
||||
break;
|
||||
case Raster::C4444:
|
||||
depth = 32;
|
||||
conv = conv_RGBA8888_from_BGRA4444;
|
||||
break;
|
||||
default:
|
||||
case Raster::LUM8:
|
||||
RWERROR((ERR_INVRASTER));
|
||||
return nil;
|
||||
|
||||
148
vendor/librw/src/dc/rwdc.cpp
vendored
148
vendor/librw/src/dc/rwdc.cpp
vendored
@@ -29,6 +29,7 @@ extern const char* currentFile;
|
||||
#include "rwdc.h"
|
||||
#include "vq.h"
|
||||
#include "tex-util.h"
|
||||
#include "common.h"
|
||||
|
||||
#include <vector>
|
||||
#include <set>
|
||||
@@ -56,6 +57,12 @@ bool doEnvironmentMaps = true;
|
||||
#define fclamp0_1(n) ((n) > 1.0f ? 1.0f : n < 0.0f ? 0.0f : n)
|
||||
#define fclamp1(n) ((n) > 1.0f ? 1.0f : n)
|
||||
|
||||
const unsigned short VIDEO_MODES = 2;
|
||||
unsigned short VIDEO_MODE = 0;
|
||||
rw::VideoMode videoModes[VIDEO_MODES];
|
||||
float SCREEN_WIDTH = 640;
|
||||
float SCREEN_HEIGHT = 480;
|
||||
|
||||
struct alignas(32) pvr_vertex16_t {
|
||||
uint32_t flags; /**< \brief TA command (vertex flags) */
|
||||
float x; /**< \brief X coordinate */
|
||||
@@ -176,8 +183,6 @@ static pvr_dr_state_t drState;
|
||||
#if !defined(DC_TEXCONV) && !defined(DC_SIM)
|
||||
#include <kos.h>
|
||||
|
||||
#define VIDEO_MODE_WIDTH vid_mode->width
|
||||
#define VIDEO_MODE_HEIGHT vid_mode->height
|
||||
|
||||
#define mat_trans_nodiv_nomod(x, y, z, x2, y2, z2, w2) do { \
|
||||
register float __x __asm__("fr12") = (x); \
|
||||
@@ -288,8 +293,6 @@ void rw_mat_load_4x4(rw::Matrix* mtx) {
|
||||
}
|
||||
|
||||
#include <dc/matrix.h>
|
||||
#define VIDEO_MODE_WIDTH 640
|
||||
#define VIDEO_MODE_HEIGHT 480
|
||||
#define frsqrt(a) (1.0f/sqrt(a))
|
||||
#define dcache_pref_block(a) __builtin_prefetch(a)
|
||||
|
||||
@@ -483,7 +486,7 @@ void DCE_MatrixViewport(float x, float y, float width, float height) {
|
||||
DCE_MAT_SCREENVIEW[1][1] = height * 0.5f;
|
||||
DCE_MAT_SCREENVIEW[2][2] = 1;
|
||||
DCE_MAT_SCREENVIEW[3][0] = -DCE_MAT_SCREENVIEW[0][0] + x;
|
||||
DCE_MAT_SCREENVIEW[3][1] = VIDEO_MODE_HEIGHT - (DCE_MAT_SCREENVIEW[1][1] + y);
|
||||
DCE_MAT_SCREENVIEW[3][1] = height - (DCE_MAT_SCREENVIEW[1][1] + y);
|
||||
}
|
||||
|
||||
void DCE_InitMatrices() {
|
||||
@@ -492,7 +495,7 @@ void DCE_InitMatrices() {
|
||||
|
||||
mat_store(&DCE_MAT_SCREENVIEW);
|
||||
|
||||
DCE_MatrixViewport(0, 0, VIDEO_MODE_WIDTH, VIDEO_MODE_HEIGHT);
|
||||
DCE_MatrixViewport(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -739,8 +742,9 @@ std::vector<std::function<void()>> blendCallbacks;
|
||||
std::vector<std::function<void()>> ptCallbacks;
|
||||
|
||||
void dcMotionBlur_v1(uint8_t a, uint8_t r, uint8_t g, uint8_t b) {
|
||||
|
||||
uint32_t col = (a << 24) | (r << 16) | (g << 8) | b;
|
||||
int strip_width = SCREEN_WIDTH / 320;
|
||||
int strip_mult = SCREEN_WIDTH / 640;
|
||||
|
||||
blendCallbacks.emplace_back([=]() {
|
||||
pvr_poly_cxt_t cxt;
|
||||
@@ -756,8 +760,6 @@ void dcMotionBlur_v1(uint8_t a, uint8_t r, uint8_t g, uint8_t b) {
|
||||
auto addr2 = (pvr_ptr_t)&emu_vram[addr64b + 640 * 2];
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
PVR_SET(PVR_TEXTURE_MODULO, 640/32);
|
||||
|
||||
auto doquad = [=](float x, float y, float w, float h, float tx, float ty, float tw, float th) {
|
||||
@@ -782,23 +784,23 @@ void dcMotionBlur_v1(uint8_t a, uint8_t r, uint8_t g, uint8_t b) {
|
||||
pvr_dr_commit(vtx);
|
||||
|
||||
vtx = reinterpret_cast<pvr_vertex_t *>(pvr_dr_target(drState));
|
||||
vtx->flags = PVR_CMD_VERTEX;
|
||||
//vtx->flags = PVR_CMD_VERTEX;
|
||||
vtx->x = x;
|
||||
vtx->y = y+h;
|
||||
vtx->z = 1000000.0f;
|
||||
//vtx->z = 1000000.0f;
|
||||
vtx->u = tx/1024.f;
|
||||
vtx->v = (ty+th)/512.0f;
|
||||
vtx->argb = col;
|
||||
//vtx->argb = col;
|
||||
pvr_dr_commit(vtx);
|
||||
|
||||
vtx = reinterpret_cast<pvr_vertex_t *>(pvr_dr_target(drState));
|
||||
vtx->flags = PVR_CMD_VERTEX_EOL;
|
||||
vtx->x = x+w;
|
||||
vtx->y = y+h;
|
||||
vtx->z = 1000000.0f;
|
||||
//vtx->z = 1000000.0f;
|
||||
vtx->u = (tx+tw)/1024.f;
|
||||
vtx->v = (ty+th)/512.0f;
|
||||
vtx->argb = col;
|
||||
//vtx->argb = col;
|
||||
pvr_dr_commit(vtx);
|
||||
};
|
||||
{
|
||||
@@ -821,7 +823,7 @@ void dcMotionBlur_v1(uint8_t a, uint8_t r, uint8_t g, uint8_t b) {
|
||||
pvr_dr_commit(hdr);
|
||||
}
|
||||
for (int x = 0; x < 320; x+=2) {
|
||||
doquad(x, 0, 2, 480, x*2 + (is_bank1 ? 2 : 0), 0, 2, 480);
|
||||
doquad(x*strip_mult, 0, strip_width, 480, x*2 + (is_bank1 ? 2 : 0), 0, 2, 480);
|
||||
}
|
||||
{
|
||||
pvr_poly_cxt_txr(&cxt,
|
||||
@@ -843,7 +845,7 @@ void dcMotionBlur_v1(uint8_t a, uint8_t r, uint8_t g, uint8_t b) {
|
||||
pvr_dr_commit(hdr);
|
||||
}
|
||||
for (int x = 0; x < 320; x+=2) {
|
||||
doquad(320+x, 0, 2, 480, x*2 + (is_bank1 ? 2 : 0), 0, 2, 480);
|
||||
doquad(SCREEN_WIDTH/2 + x*strip_mult, 0, strip_width, 480, x*2 + (is_bank1 ? 2 : 0), 0, 2, 480);
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -886,23 +888,23 @@ void dcMotionBlur_v3(uint8_t a, uint8_t r, uint8_t g, uint8_t b) {
|
||||
pvr_dr_commit(vtx);
|
||||
|
||||
vtx = reinterpret_cast<pvr_vertex_t *>(pvr_dr_target(drState));
|
||||
vtx->flags = PVR_CMD_VERTEX;
|
||||
//vtx->flags = PVR_CMD_VERTEX;
|
||||
vtx->x = x;
|
||||
vtx->y = y+h;
|
||||
vtx->z = z;
|
||||
//vtx->z = z;
|
||||
vtx->u = umin;
|
||||
vtx->v = vmax;
|
||||
vtx->argb = col;
|
||||
//vtx->argb = col;
|
||||
pvr_dr_commit(vtx);
|
||||
|
||||
vtx = reinterpret_cast<pvr_vertex_t *>(pvr_dr_target(drState));
|
||||
vtx->flags = PVR_CMD_VERTEX_EOL;
|
||||
vtx->x = x+w;
|
||||
vtx->y = y+h;
|
||||
vtx->z = z;
|
||||
//vtx->z = z;
|
||||
vtx->u = umax;
|
||||
vtx->v = vmax;
|
||||
vtx->argb = col;
|
||||
//vtx->argb = col;
|
||||
pvr_dr_commit(vtx);
|
||||
};
|
||||
|
||||
@@ -921,7 +923,7 @@ void dcMotionBlur_v3(uint8_t a, uint8_t r, uint8_t g, uint8_t b) {
|
||||
pvr_poly_compile(hdr, &cxt);
|
||||
pvr_dr_commit(hdr);
|
||||
|
||||
doquad(0.0f, 0.0f, 1e6f, 640.0f, 480.0f,
|
||||
doquad(0.0f, 0.0f, 1e6f, SCREEN_WIDTH, 480.0f,
|
||||
0.0f, 640.0f / 8.0f, 0.0f, 480.0f / 8.0f, mask_col);
|
||||
|
||||
pvr_poly_cxt_txr(&cxt, PVR_LIST_TR_POLY,
|
||||
@@ -940,10 +942,10 @@ void dcMotionBlur_v3(uint8_t a, uint8_t r, uint8_t g, uint8_t b) {
|
||||
pvr_poly_compile(hdr, &cxt);
|
||||
pvr_dr_commit(hdr);
|
||||
|
||||
doquad(0.0f, 0.0f, 2e6f, 320.0f, 480.0f,
|
||||
doquad(0.0f, 0.0f, 2e6f, SCREEN_WIDTH / 2.0f, 480.0f,
|
||||
0.0f, 640.0f / 1024.0f,
|
||||
0.0f, 960.0f / 1024.0f, col);
|
||||
doquad(320.0f, 0.0f, 2e6f, 320.0f, 480.0f,
|
||||
doquad(SCREEN_WIDTH / 2.0f, 0.0f, 2e6f, SCREEN_WIDTH / 2.0f, 480.0f,
|
||||
0.0f, 640.0f / 1024.0f,
|
||||
1.0f / 1024.0f, 961.0f / 1024.0f, col);
|
||||
|
||||
@@ -954,10 +956,10 @@ void dcMotionBlur_v3(uint8_t a, uint8_t r, uint8_t g, uint8_t b) {
|
||||
pvr_poly_compile(hdr, &cxt);
|
||||
pvr_dr_commit(hdr);
|
||||
|
||||
doquad(0.0f, 0.0f, 3e6f, 320.0f, 480.0f,
|
||||
doquad(0.0f, 0.0f, 3e6f, SCREEN_WIDTH / 2.0f, 480.0f,
|
||||
-1.0f / 1024.0f, 639.0f / 1024.0f,
|
||||
0.0f, 960.0f / 1024.0f, col);
|
||||
doquad(320.0f, 0.0f, 3e6f, 320.0f, 480.0f,
|
||||
doquad(SCREEN_WIDTH / 2.0f, 0.0f, 3e6f, SCREEN_WIDTH / 2.0f, 480.0f,
|
||||
-1.0f / 1024.0f, 639.0f / 1024.0f,
|
||||
1.0f / 1024.0f, 961.0f / 1024.0f, col);
|
||||
|
||||
@@ -973,7 +975,7 @@ void dcMotionBlur_v3(uint8_t a, uint8_t r, uint8_t g, uint8_t b) {
|
||||
pvr_poly_compile(hdr, &cxt);
|
||||
pvr_dr_commit(hdr);
|
||||
|
||||
doquad(0.0f, 0.0f, 4e6f, 640.0f, 480.0f,
|
||||
doquad(0.0f, 0.0f, 4e6f, SCREEN_WIDTH, 480.0f,
|
||||
0.0f, 640.0f / 8.0f, 0.0f, 480.0f / 8.0f, 0xffffffff);
|
||||
|
||||
cxt.blend.src = PVR_BLEND_ONE;
|
||||
@@ -983,7 +985,7 @@ void dcMotionBlur_v3(uint8_t a, uint8_t r, uint8_t g, uint8_t b) {
|
||||
pvr_poly_compile(hdr, &cxt);
|
||||
pvr_dr_commit(hdr);
|
||||
|
||||
doquad(0.0f, 0.0f, 4e6f, 640.0f, 480.0f,
|
||||
doquad(0.0f, 0.0f, 4e6f, SCREEN_WIDTH, 480.0f,
|
||||
0.0f, 640.0f / 8.0f, 0.0f, 480.0f / 8.0f, 0x000f0f0f);
|
||||
|
||||
cxt.blend.src = PVR_BLEND_INVDESTCOLOR;
|
||||
@@ -993,7 +995,7 @@ void dcMotionBlur_v3(uint8_t a, uint8_t r, uint8_t g, uint8_t b) {
|
||||
pvr_poly_compile(hdr, &cxt);
|
||||
pvr_dr_commit(hdr);
|
||||
|
||||
doquad(0.0f, 0.0f, 4e6f, 640.0f, 480.0f,
|
||||
doquad(0.0f, 0.0f, 4e6f, SCREEN_WIDTH, 480.0f,
|
||||
0.0f, 640.0f / 8.0f, 0.0f, 480.0f / 8.0f, 0xffffffff);
|
||||
|
||||
cxt.blend.dst_enable = PVR_BLEND_DISABLE;
|
||||
@@ -1005,7 +1007,7 @@ void dcMotionBlur_v3(uint8_t a, uint8_t r, uint8_t g, uint8_t b) {
|
||||
pvr_poly_compile(hdr, &cxt);
|
||||
pvr_dr_commit(hdr);
|
||||
|
||||
doquad(0.0f, 0.0f, 4e6f, 640.0f, 480.0f,
|
||||
doquad(0.0f, 0.0f, 4e6f, SCREEN_WIDTH, 480.0f,
|
||||
0.0f, 640.0f / 8.0f, 0.0f, 480.0f / 8.0f, 0xffffffff);
|
||||
});
|
||||
}
|
||||
@@ -3219,6 +3221,15 @@ void pvr_poly_cxt_txr_fast(pvr_poly_hdr_t *hdr, pvr_list_t list,
|
||||
|
||||
|
||||
|
||||
size_t vertexBufferFree() {
|
||||
size_t end = PVR_GET(PVR_TA_VERTBUF_END);
|
||||
size_t pos = PVR_GET(PVR_TA_VERTBUF_POS);
|
||||
|
||||
size_t free = end - pos;
|
||||
|
||||
return free;
|
||||
}
|
||||
|
||||
|
||||
void defaultRenderCB(ObjPipeline *pipe, Atomic *atomic) {
|
||||
rw::Camera *cam = engine->currentCamera;
|
||||
@@ -3285,6 +3296,8 @@ void defaultRenderCB(ObjPipeline *pipe, Atomic *atomic) {
|
||||
|
||||
for (int16_t n = 0; n < numMeshes; n++) {
|
||||
bool doBlend = meshes[n].material->color.alpha != 255; // TODO: check all vertexes for alpha?
|
||||
bool doBlendMaterial = doBlend;
|
||||
|
||||
bool textured = geo->numTexCoordSets && meshes[n].material->texture;
|
||||
if (textured) {
|
||||
doBlend |= Raster::formatHasAlpha(meshes[n].material->texture->raster->format);
|
||||
@@ -3334,7 +3347,7 @@ void defaultRenderCB(ObjPipeline *pipe, Atomic *atomic) {
|
||||
pvr_poly_cxt_t cxt;
|
||||
int pvrList;
|
||||
if (doBlend || isMatFX) {
|
||||
if (doAlphaTest) {
|
||||
if (doAlphaTest && !doBlendMaterial) {
|
||||
pvrList = PVR_LIST_PT_POLY;
|
||||
} else {
|
||||
pvrList = PVR_LIST_TR_POLY;
|
||||
@@ -3400,6 +3413,9 @@ void defaultRenderCB(ObjPipeline *pipe, Atomic *atomic) {
|
||||
|
||||
// clipping performed per meshlet
|
||||
auto renderCB = [contextId, n] {
|
||||
if (vertexBufferFree() < (128 * 1024)) {
|
||||
return;
|
||||
}
|
||||
const atomic_context_t* acp = &atomicContexts[contextId];
|
||||
auto geo = acp->geo;
|
||||
auto mesh = geo->meshHeader->getMeshes() + n;
|
||||
@@ -3697,7 +3713,7 @@ void defaultRenderCB(ObjPipeline *pipe, Atomic *atomic) {
|
||||
};
|
||||
|
||||
if (doBlend || isMatFX) {
|
||||
if (doAlphaTest) {
|
||||
if (doAlphaTest && !doBlendMaterial) {
|
||||
ptCallbacks.emplace_back(std::move(renderCB));
|
||||
} else {
|
||||
blendCallbacks.emplace_back(std::move(renderCB));
|
||||
@@ -4234,6 +4250,32 @@ rasterToImage(Raster*)
|
||||
return nil;
|
||||
}
|
||||
|
||||
static pvr_init_params_t pvr_params = {
|
||||
.opb_sizes = {
|
||||
PVR_BINSIZE_16, PVR_BINSIZE_0, PVR_BINSIZE_8, PVR_BINSIZE_0,
|
||||
PVR_BINSIZE_8
|
||||
},
|
||||
.vertex_buf_size = (1024 + 1024) * 1024,
|
||||
.dma_enabled = 0,
|
||||
.fsaa_enabled = 0,
|
||||
.autosort_disabled = true,
|
||||
.opb_overflow_count = 7 // 268800 bytes
|
||||
};
|
||||
|
||||
static void makeVideoModeList() {
|
||||
videoModes[0].width = 640;
|
||||
videoModes[0].height = 480;
|
||||
videoModes[0].depth = 16;
|
||||
videoModes[0].flags = VIDEOMODEEXCLUSIVE;
|
||||
|
||||
videoModes[1].width = 1280;
|
||||
videoModes[1].height = 480;
|
||||
videoModes[1].depth = 16;
|
||||
videoModes[1].flags = VIDEOMODEEXCLUSIVE;
|
||||
|
||||
|
||||
}
|
||||
|
||||
int
|
||||
deviceSystem(DeviceReq req, void *arg0, int32 n)
|
||||
{
|
||||
@@ -4262,14 +4304,14 @@ deviceSystem(DeviceReq req, void *arg0, int32 n)
|
||||
// TODO: implement subsystems
|
||||
|
||||
case DEVICEGETVIDEOMODEINFO:{
|
||||
makeVideoModeList(); // On startup this is not yet called
|
||||
auto rwmode = (VideoMode*)arg0;
|
||||
rwmode->width = 640;
|
||||
rwmode->height = 480;
|
||||
rwmode->depth = 16;
|
||||
rwmode->flags = VIDEOMODEEXCLUSIVE;
|
||||
rwmode->width = videoModes[n].width;
|
||||
rwmode->height = videoModes[n].height;
|
||||
rwmode->depth = videoModes[n].depth;
|
||||
rwmode->flags = videoModes[n].flags;
|
||||
return 1;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
case DEVICEGETMAXMULTISAMPLINGLEVELS:
|
||||
{
|
||||
@@ -4282,11 +4324,21 @@ deviceSystem(DeviceReq req, void *arg0, int32 n)
|
||||
case DEVICESETSUBSYSTEM:
|
||||
return 1;
|
||||
case DEVICEGETNUMVIDEOMODES:
|
||||
return 1;
|
||||
return VIDEO_MODES;
|
||||
case DEVICEGETCURRENTVIDEOMODE:
|
||||
return 0;
|
||||
return VIDEO_MODE;
|
||||
case DEVICESETVIDEOMODE:
|
||||
return 1;
|
||||
{
|
||||
makeVideoModeList(); // On startup this is called before driverOpen
|
||||
|
||||
VIDEO_MODE = n;
|
||||
SCREEN_WIDTH = videoModes[VIDEO_MODE].width;
|
||||
SCREEN_HEIGHT = videoModes[VIDEO_MODE].height;
|
||||
pvr_params.fsaa_enabled = n;
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
default:
|
||||
assert(0 && "not implemented");
|
||||
return 0;
|
||||
@@ -4314,15 +4366,7 @@ Device renderdevice = {
|
||||
deviceSystem
|
||||
};
|
||||
|
||||
static pvr_init_params_t pvr_params = {
|
||||
.opb_sizes = {
|
||||
PVR_BINSIZE_16, PVR_BINSIZE_0, PVR_BINSIZE_8, PVR_BINSIZE_0,
|
||||
PVR_BINSIZE_8
|
||||
},
|
||||
.vertex_buf_size = (1024 + 1024) * 1024,
|
||||
.autosort_disabled = true,
|
||||
.opb_overflow_count = 7 // 268800 bytes
|
||||
};
|
||||
|
||||
|
||||
void defaultInstance(ObjPipeline *pipe, Atomic *atomic) {
|
||||
#if defined(DC_TEXCONV)
|
||||
@@ -4348,6 +4392,8 @@ ObjPipeline* makeDefaultPipeline(void)
|
||||
static void*
|
||||
driverOpen(void *o, int32, int32)
|
||||
{
|
||||
makeVideoModeList();
|
||||
|
||||
pvr_init(&pvr_params);
|
||||
|
||||
fake_tex = pvr_mem_malloc(sizeof(fake_tex_data));
|
||||
@@ -4383,6 +4429,8 @@ driverClose(void *o, int32, int32)
|
||||
{
|
||||
pvr_mem_free(fake_tex);
|
||||
|
||||
pvr_shutdown();
|
||||
|
||||
return o;
|
||||
}
|
||||
|
||||
|
||||
28
vendor/librw/src/raster.cpp
vendored
28
vendor/librw/src/raster.cpp
vendored
@@ -313,6 +313,34 @@ conv_ARGB1555_from_RGBA5551(uint8 *out, uint8 *in)
|
||||
out[1] = g>>3 | r<<2 | a<<7;
|
||||
}
|
||||
|
||||
void conv_RGB888_from_BGR565(uint8 *out, uint8 *in)
|
||||
{
|
||||
uint16_t col = in[0] | in[1]<<8;
|
||||
|
||||
uint32 r, g, b;
|
||||
r = (col>>11) & 0x1F;
|
||||
g = (col>>5) & 0x3F;
|
||||
b = (col>>0) & 0x1F;
|
||||
out[0] = r*0xFF/0x1f;
|
||||
out[1] = g*0xFF/0x3f;
|
||||
out[2] = b*0xFF/0x1f;
|
||||
}
|
||||
|
||||
void conv_RGBA8888_from_BGRA4444(uint8 *out, uint8 *in)
|
||||
{
|
||||
uint16_t col = in[0] | in[1]<<8;
|
||||
|
||||
uint32 r, g, b, a;
|
||||
a = (col>>12) & 0xF;
|
||||
r = (col>>8) & 0xF;
|
||||
g = (col>>4) & 0xF;
|
||||
b = (col>>0) & 0xF;
|
||||
out[0] = r*0xFF/0xf;
|
||||
out[1] = g*0xFF/0xf;
|
||||
out[2] = b*0xFF/0xf;
|
||||
out[3] = a*0xFF/0xf;
|
||||
}
|
||||
|
||||
void
|
||||
conv_RGBA8888_from_ARGB1555(uint8 *out, uint8 *in)
|
||||
{
|
||||
|
||||
2
vendor/librw/src/rwobjects.h
vendored
2
vendor/librw/src/rwobjects.h
vendored
@@ -328,6 +328,8 @@ void conv_ARGB1555_from_ARGB1555(uint8 *out, uint8 *in);
|
||||
void conv_ARGB1555_from_RGB555(uint8 *out, uint8 *in);
|
||||
void conv_RGBA5551_from_ARGB1555(uint8 *out, uint8 *in);
|
||||
void conv_ARGB1555_from_RGBA5551(uint8 *out, uint8 *in);
|
||||
void conv_RGB888_from_BGR565(uint8 *out, uint8 *in);
|
||||
void conv_RGBA8888_from_BGRA4444(uint8 *out, uint8 *in);
|
||||
void conv_RGBA8888_from_ARGB1555(uint8 *out, uint8 *in);
|
||||
void conv_ABGR1555_from_ARGB1555(uint8 *out, uint8 *in);
|
||||
inline void conv_8_from_8(uint8 *out, uint8 *in) { *out = *in; }
|
||||
|
||||
Reference in New Issue
Block a user