aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTakamichi Horikawa <takamichiho@gmail.com>2018-04-14 23:54:44 +0900
committerTakamichi Horikawa <takamichiho@gmail.com>2018-04-14 23:54:44 +0900
commita771a6f083d450c9cbba7367a08602c0a4bd6abc (patch)
treee540f5edf4b1fe7c271d55ab542ab72d42c521ae
parent61c98716a1fe1269d481d1be20e2d71a52f9a0b2 (diff)
win32: fixed several UI issues and updated manifest
-rw-r--r--common/fmplayer_fontrom.h6
-rw-r--r--common/fmplayer_fontrom_unix.c5
-rw-r--r--common/fmplayer_fontrom_win.c5
-rw-r--r--win32/amd64/Makefile5
-rw-r--r--win32/configdialog.c2
-rw-r--r--win32/fmplayer.mak1
-rw-r--r--win32/lnf.manifest.in (renamed from win32/lnf.manifest)5
-rw-r--r--win32/main.c2
-rw-r--r--win32/x86/Makefile5
9 files changed, 24 insertions, 12 deletions
diff --git a/common/fmplayer_fontrom.h b/common/fmplayer_fontrom.h
index 7a67133..601cecc 100644
--- a/common/fmplayer_fontrom.h
+++ b/common/fmplayer_fontrom.h
@@ -1,9 +1,11 @@
#ifndef MYON_FMPLAYER_FONTROM_H_INCLUDED
#define MYON_FMPLAYER_FONTROM_H_INCLUDED
+#include <stdbool.h>
+
struct fmdsp_font;
-// always succeeds
-void fmplayer_font_rom_load(struct fmdsp_font *font);
+// true if font rom available, false if using alternatives
+bool fmplayer_font_rom_load(struct fmdsp_font *font);
#endif // MYON_FMPLAYER_FONTROM_H_INCLUDED
diff --git a/common/fmplayer_fontrom_unix.c b/common/fmplayer_fontrom_unix.c
index bb8f12e..238be9c 100644
--- a/common/fmplayer_fontrom_unix.c
+++ b/common/fmplayer_fontrom_unix.c
@@ -13,7 +13,7 @@ static struct {
uint8_t fontrombuf[FONT_ROM_FILESIZE];
} g;
-void fmplayer_font_rom_load(struct fmdsp_font *font) {
+bool fmplayer_font_rom_load(struct fmdsp_font *font) {
const char *path = "font.rom";
const char *home = getenv("HOME");
char *dpath = 0;
@@ -40,9 +40,10 @@ void fmplayer_font_rom_load(struct fmdsp_font *font) {
goto err;
}
fclose(f);
- return;
+ return true;
err:
if (f) fclose(f);
fmdsp_font_from_font_rom(font, fmdsp_shinonome_font_rom);
+ return false;
}
diff --git a/common/fmplayer_fontrom_win.c b/common/fmplayer_fontrom_win.c
index 8ba8300..4f9ed12 100644
--- a/common/fmplayer_fontrom_win.c
+++ b/common/fmplayer_fontrom_win.c
@@ -13,7 +13,7 @@ static struct {
bool font_rom_loaded;
} g;
-void fmplayer_font_rom_load(struct fmdsp_font *font) {
+bool fmplayer_font_rom_load(struct fmdsp_font *font) {
const wchar_t *path = L"font.rom";
wchar_t exepath[MAX_PATH];
if (GetModuleFileNameW(0, exepath, MAX_PATH)) {
@@ -33,8 +33,9 @@ void fmplayer_font_rom_load(struct fmdsp_font *font) {
CloseHandle(file);
fmdsp_font_from_font_rom(font, g.fontrombuf);
g.font_rom_loaded = true;
- return;
+ return true;
err:
if (file != INVALID_HANDLE_VALUE) CloseHandle(file);
fmdsp_font_win(font);
+ return false;
}
diff --git a/win32/amd64/Makefile b/win32/amd64/Makefile
index c1d7426..90e56d3 100644
--- a/win32/amd64/Makefile
+++ b/win32/amd64/Makefile
@@ -36,10 +36,13 @@ $(TARGET): $(OBJS)
@echo " CC $@"
@$(CC) $(CFLAGS) $(SSECFLAGS) -c $< -o $@
-%.o: %.rc $(ICON)
+%.o: %.rc $(ICON) $(MANIFEST)
@echo " WINDRES $@"
@$(WINDRES) -o $@ -i $<
+$(MANIFEST): $(MANIFEST).in ../../version.h
+ sed -e "s/@VER@/$(shell ../../versionprint.c)/g" $< > $@
+
$(ICON): $(ICONFILES)
icotool -o $@ -c $^
diff --git a/win32/configdialog.c b/win32/configdialog.c
index 3d15220..21c9c62 100644
--- a/win32/configdialog.c
+++ b/win32/configdialog.c
@@ -45,7 +45,7 @@ enum {
GROUP_FM_H = 75,
BOX_X = 15,
CHECK_FM_HIRES_SIN_Y = GROUP_FM_Y + 20,
- BOX_W = 380,
+ BOX_W = 450,
CHECK_H = 25,
CHECK_FM_HIRES_ENV_Y = CHECK_FM_HIRES_SIN_Y + CHECK_H,
GROUP_SSG_Y = GROUP_FM_Y+GROUP_FM_H+5,
diff --git a/win32/fmplayer.mak b/win32/fmplayer.mak
index 8bbf8ae..5c27df8 100644
--- a/win32/fmplayer.mak
+++ b/win32/fmplayer.mak
@@ -2,6 +2,7 @@ TARGET=98fmplayer.exe
ICON=../fmplayer.ico
ICONFILES=../fmplayer.png ../fmplayer32.png
+MANIFEST=../lnf.manifest
DEFINES=UNICODE _UNICODE \
WINVER=0x0500 _WIN32_WINNT=0x0500 \
diff --git a/win32/lnf.manifest b/win32/lnf.manifest.in
index ef951b7..680b7d5 100644
--- a/win32/lnf.manifest
+++ b/win32/lnf.manifest.in
@@ -1,10 +1,11 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
- <assemblyIdentity version="1.0.0.0" processorArchitecture="*" name="CompanyName.ProductName.YourApplication" type="win32" />
- <description>Your application description here.</description>
+ <assemblyIdentity version="@VER@" processorArchitecture="*" name="myon.98fmplayer" type="win32" />
+ <description>PC-98 sound emulator</description>
<dependency>
<dependentAssembly>
<assemblyIdentity type="win32" name="Microsoft.Windows.Common-Controls" version="6.0.0.0" processorArchitecture="*" publicKeyToken="6595b64144ccf1df" language="*" />
</dependentAssembly>
</dependency>
</assembly>
+
diff --git a/win32/main.c b/win32/main.c
index 946c7db..f113d06 100644
--- a/win32/main.c
+++ b/win32/main.c
@@ -774,7 +774,7 @@ int CALLBACK wWinMain(HINSTANCE hinst, HINSTANCE hpinst,
if (__builtin_cpu_supports("sse2")) opna_ssg_sinc_calc_func = opna_ssg_sinc_calc_sse2;
fft_init_table();
- fmplayer_font_rom_load(&g.font);
+ about_set_fontrom_loaded(fmplayer_font_rom_load(&g.font));
const wchar_t *argfile = 0;
{
diff --git a/win32/x86/Makefile b/win32/x86/Makefile
index 184d3a4..44d11f6 100644
--- a/win32/x86/Makefile
+++ b/win32/x86/Makefile
@@ -37,10 +37,13 @@ $(TARGET): $(OBJS)
@echo " CC $@"
@$(CC) $(CFLAGS) $(SSECFLAGS) -c $< -o $@
-%.o: %.rc $(ICON)
+%.o: %.rc $(ICON) $(MANIFEST)
@echo " WINDRES $@"
@$(WINDRES) -o $@ -i $<
+$(MANIFEST): $(MANIFEST).in ../../version.h
+ sed -e "s/@VER@/$(shell ../../versionprint.c)/g" $< > $@
+
$(ICON): $(ICONFILES)
icotool -o $@ -c $^