diff --git a/emulators/xnp21kai/Makefile b/emulators/xnp21kai/Makefile index 047244bcd53..ecf61879bb8 100644 --- a/emulators/xnp21kai/Makefile +++ b/emulators/xnp21kai/Makefile @@ -4,6 +4,7 @@ COMMENT = PC-9801 emulator DISTNAME = NP21kai-0.0.20231030 PKGNAME = x${DISTNAME:L} +REVISION = 0 GH_ACCOUNT = AZO234 GH_PROJECT = NP2kai @@ -37,7 +38,11 @@ LIB_DEPENDS = devel/harfbuzz \ RUN_DEPENDS = devel/desktop-file-utils \ x11/gtk+4,-guic -FIX_CRLF_FILES = ${WRKSRC}/network/net.c +FIX_CRLF_FILES = ${WRKSRC}/network/net.c \ + ${WRKSRC}/generic/hostdrvs.c \ + ${WRKSRC}/vram/scrnsave.c \ + ${WRKSRC}/wab/cirrus_vga.h \ + ${WRKSRC}/wab/wab.c CONFIGURE_ARGS = -DCMAKE_DISABLE_FIND_PACKAGE_Git=TRUE diff --git a/emulators/xnp21kai/patches/patch-cbus_boardlol_c b/emulators/xnp21kai/patches/patch-cbus_boardlol_c new file mode 100644 index 00000000000..f538f16368a --- /dev/null +++ b/emulators/xnp21kai/patches/patch-cbus_boardlol_c @@ -0,0 +1,27 @@ +Index: cbus/boardlol.c +--- cbus/boardlol.c.orig ++++ cbus/boardlol.c +@@ -89,7 +89,7 @@ static const IOOUT opn_o[4] = { + static const IOINP opn_i[4] = { + opn_i188, opn_i18a, NULL, NULL}; + +-static void psgpanset(OPNA* psg) { ++static void psgpanset(PSGGEN psg) { + // SSGはR固定 + psggen_setpan(psg, 0, 1); + psggen_setpan(psg, 1, 1); +@@ -108,12 +108,12 @@ void boardlol_reset(const NP2CFG *pConfig) { + } + + void boardlol_bind(void) { +- psgpanset(&g_opna[0]); ++ psgpanset(&g_opna[0].psg); + // fmboard_fmrestore(0, 0); + opngen_setreg(&g_opna[0].opngen, 0, 0xb4, 1 << 7); // OPNはL固定 + opngen_setreg(&g_opna[0].opngen, 0, 0xb5, 1 << 7); + opngen_setreg(&g_opna[0].opngen, 0, 0xb6, 1 << 7); +- psggen_restore(&g_opna[0]); ++ psggen_restore(&g_opna[0].psg); + sound_streamregist(&g_opna[0].opngen, (SOUNDCB)opngen_getpcm); + sound_streamregist(&g_opna[0].opngen, (SOUNDCB)psggen_getpcm); + cbuscore_attachsndex(0x188 - g_opna[0].s.base, opn_o, opn_i); diff --git a/emulators/xnp21kai/patches/patch-cbus_boardmo_c b/emulators/xnp21kai/patches/patch-cbus_boardmo_c new file mode 100644 index 00000000000..c0d988cd119 --- /dev/null +++ b/emulators/xnp21kai/patches/patch-cbus_boardmo_c @@ -0,0 +1,36 @@ +Index: cbus/boardmo.c +--- cbus/boardmo.c.orig ++++ cbus/boardmo.c +@@ -119,7 +119,7 @@ static REG8 IOINPCALL opn_i18a(UINT port) { + return(fmboard_getjoy(&g_opna[0])); + } + else if (addr < 0x10) { +- return(psggen_getreg(&g_opna[0], addr)); ++ return(psggen_getreg(&g_opna[0].psg, addr)); + } + (void)port; + return(g_opna[0].s.data); +@@ -157,7 +157,7 @@ static const IOOUT opl_o[4] = { + static const IOINP opl_i[4] = { + opl_i288, opl_i28a, opl_i28c, opl_i28e}; + +-static void psgpanset(OPNA* psg) { ++static void psgpanset(PSGGEN psg) { + // SSGはL固定 + psggen_setpan(psg, 0, 2); + psggen_setpan(psg, 1, 2); +@@ -193,12 +193,12 @@ void boardmo_reset(const NP2CFG *pConfig) { + } + + void boardmo_bind(void) { +- psgpanset(&g_opna[0]); ++ psgpanset(&g_opna[0].psg); + // fmboard_fmrestore(0, 0); + opngen_setreg(&g_opna[0].opngen, 0, 0xb4, 1 << 6); + opngen_setreg(&g_opna[0].opngen, 0, 0xb5, 1 << 6); + opngen_setreg(&g_opna[0].opngen, 0, 0xb6, 1 << 6); +- psggen_restore(&g_opna[0].opngen); ++ psggen_restore(&g_opna[0].psg); + sound_streamregist(&g_opna[0].opngen, (SOUNDCB)opngen_getpcm); + sound_streamregist(&g_opna[0].opngen, (SOUNDCB)psggen_getpcm); + cbuscore_attachsndex(0x188 - g_opna[0].s.base, opn_o, opn_i); diff --git a/emulators/xnp21kai/patches/patch-generic_hostdrvs_c b/emulators/xnp21kai/patches/patch-generic_hostdrvs_c new file mode 100644 index 00000000000..8c3a094ba3b --- /dev/null +++ b/emulators/xnp21kai/patches/patch-generic_hostdrvs_c @@ -0,0 +1,20 @@ +Index: generic/hostdrvs.c +--- generic/hostdrvs.c.orig ++++ generic/hostdrvs.c +@@ -394,12 +394,15 @@ UINT hostdrvs_getrealdir(HDRVPATH *phdp, char *lpFcbna + { + phdp->file = s_hddroot; + if(PathIsRelative(np2cfg.hdrvroot)){ ++#if defined(_WIN32) + TCHAR pathbuf[MAX_PATH+1]; + TCHAR *pathtmp; + initgetfile(pathbuf, _countof(pathbuf)); +-#if defined(_WIN32) + pathtmp = strrchr(pathbuf, '\\'); + #else /* _WIN32 */ ++ char pathbuf[MAX_PATH+1]; ++ char *pathtmp; ++ initgetfile(pathbuf, _countof(pathbuf)); + pathtmp = strrchr(pathbuf, '/'); + #endif /* _WIN32 */ + if(pathtmp){ diff --git a/emulators/xnp21kai/patches/patch-vram_scrnsave_c b/emulators/xnp21kai/patches/patch-vram_scrnsave_c new file mode 100644 index 00000000000..7426909352c --- /dev/null +++ b/emulators/xnp21kai/patches/patch-vram_scrnsave_c @@ -0,0 +1,12 @@ +Index: vram/scrnsave.c +--- vram/scrnsave.c.orig ++++ vram/scrnsave.c +@@ -178,7 +178,7 @@ SCRNSAVE scrnsave_create(void) + PALNUM col; + BMPPAL curpal; + UINT pos; +- uint8_t* dirty[SURFACE_HEIGHT]; ++ uint8_t dirty[SURFACE_HEIGHT]; + + + width = dsync.scrnxmax; diff --git a/emulators/xnp21kai/patches/patch-wab_cirrus_vga_h b/emulators/xnp21kai/patches/patch-wab_cirrus_vga_h new file mode 100644 index 00000000000..102f445caf4 --- /dev/null +++ b/emulators/xnp21kai/patches/patch-wab_cirrus_vga_h @@ -0,0 +1,12 @@ +Index: wab/cirrus_vga.h +--- wab/cirrus_vga.h.orig ++++ wab/cirrus_vga.h +@@ -91,6 +91,8 @@ typedef struct DisplaySurface { + struct PixelFormat pf; + } DisplaySurface; + ++struct DisplayState; ++ + typedef struct DisplayChangeListener { + int idle; + UINT64 gui_timer_interval; diff --git a/emulators/xnp21kai/patches/patch-wab_wab_c b/emulators/xnp21kai/patches/patch-wab_wab_c new file mode 100644 index 00000000000..7be931ebe1e --- /dev/null +++ b/emulators/xnp21kai/patches/patch-wab_wab_c @@ -0,0 +1,21 @@ +Index: wab/wab.c +--- wab/wab.c.orig ++++ wab/wab.c +@@ -173,14 +173,16 @@ void wabwin_readini() + void wabwin_writeini() + { + if(!np2wabcfg.readonly){ +- TCHAR szPath[MAX_PATH]; + #if defined(NP2_SDL) || defined(__LIBRETRO__) ++ OEMCHAR szPath[MAX_PATH]; + milstr_ncpy(szPath, modulefile, sizeof(szPath)); + ini_write(szPath, g_Name, s_wabwndini, NELEMENTS(s_wabwndini)); + #elif defined(NP2_X) ++ OEMCHAR szPath[MAX_PATH]; + milstr_ncpy(szPath, modulefile, sizeof(szPath)); + ini_write(szPath, g_Name, s_wabwndini, NELEMENTS(s_wabwndini), FALSE); + #else ++ TCHAR szPath[MAX_PATH]; + initgetfile(szPath, NELEMENTS(szPath)); + ini_write(szPath, g_Name, s_wabwndini, NELEMENTS(s_wabwndini)); + #endif diff --git a/emulators/xnp21kai/patches/patch-x_gtk2_dialog_hostdrv_c b/emulators/xnp21kai/patches/patch-x_gtk2_dialog_hostdrv_c new file mode 100644 index 00000000000..29baa7a2335 --- /dev/null +++ b/emulators/xnp21kai/patches/patch-x_gtk2_dialog_hostdrv_c @@ -0,0 +1,12 @@ +Index: x/gtk2/dialog_hostdrv.c +--- x/gtk2/dialog_hostdrv.c.orig ++++ x/gtk2/dialog_hostdrv.c +@@ -46,7 +46,7 @@ static GtkWidget *hostdrv_read_checkbutton; + static GtkWidget *hostdrv_write_checkbutton; + static GtkWidget *hostdrv_delete_checkbutton; + +-static TCHAR s_hostdrvdir[10][MAX_PATH] = {0}; ++static OEMCHAR s_hostdrvdir[10][MAX_PATH] = {0}; + + static void + ok_button_clicked(GtkButton *b, gpointer d) diff --git a/emulators/xnp21kai/patches/patch-x_gtk2_dialog_screen_c b/emulators/xnp21kai/patches/patch-x_gtk2_dialog_screen_c new file mode 100644 index 00000000000..8e1d3eb9ec7 --- /dev/null +++ b/emulators/xnp21kai/patches/patch-x_gtk2_dialog_screen_c @@ -0,0 +1,23 @@ +Index: x/gtk2/dialog_screen.c +--- x/gtk2/dialog_screen.c.orig ++++ x/gtk2/dialog_screen.c +@@ -45,7 +45,7 @@ + static GtkWidget *video_lcd_checkbutton; + static GtkWidget *video_lcd_reverse_checkbutton; + static GtkWidget *video_skipline_checkbutton; +-static GObject *video_skipline_ratio_adj; ++static GtkObject *video_skipline_ratio_adj; + + /* + * Chip +@@ -64,8 +64,8 @@ static const char *timing_waitclock_str[] = { + "T-RAM", "V-RAM", "GRCG" + }; + +-static GObject *timing_waitclock_adj[NELEMENTS(timing_waitclock_str)]; +-static GObject *timing_realpal_adj; ++static GtkObject *timing_waitclock_adj[NELEMENTS(timing_waitclock_str)]; ++static GtkObject *timing_realpal_adj; + + + static void diff --git a/emulators/xnp21kai/patches/patch-x_gtk2_dialog_sound_c b/emulators/xnp21kai/patches/patch-x_gtk2_dialog_sound_c new file mode 100644 index 00000000000..92eef754d43 --- /dev/null +++ b/emulators/xnp21kai/patches/patch-x_gtk2_dialog_sound_c @@ -0,0 +1,30 @@ +Index: x/gtk2/dialog_sound.c +--- x/gtk2/dialog_sound.c.orig ++++ x/gtk2/dialog_sound.c +@@ -62,7 +62,7 @@ static const struct { + { "CD-DA", &np2cfg.davolume, 0.0, 255.0 }, + }; + +-static GObject *mixer_adj[NELEMENTS(mixer_vol_tbl)]; ++static GtkObject *mixer_adj[NELEMENTS(mixer_vol_tbl)]; + + + /* +@@ -73,7 +73,7 @@ static const char *snd14_vol_str[] = { + "left", "right", "f2", "f4", "f8", "f16" + }; + +-static GObject *snd14_adj[NELEMENTS(snd14_vol_str)]; ++static GtkObject *snd14_adj[NELEMENTS(snd14_vol_str)]; + + + /* +@@ -315,7 +315,7 @@ static GtkWidget *spb_int_entry; + static GtkWidget *spb_romaddr_entry; + static GtkWidget *spb_vr_channel_checkbutton[2]; + static GtkWidget *spb_reverse_channel_checkbutton; +-static GObject *spb_vr_level_adj; ++static GtkObject *spb_vr_level_adj; + + + /* diff --git a/emulators/xnp21kai/patches/patch-x_gtk2_gtk_screen_c b/emulators/xnp21kai/patches/patch-x_gtk2_gtk_screen_c new file mode 100644 index 00000000000..e98ba9fa7af --- /dev/null +++ b/emulators/xnp21kai/patches/patch-x_gtk2_gtk_screen_c @@ -0,0 +1,27 @@ +Index: x/gtk2/gtk_screen.c +--- x/gtk2/gtk_screen.c.orig ++++ x/gtk2/gtk_screen.c +@@ -690,7 +690,6 @@ void scrnmng_blthdc(void) { + + void scrnmng_bltwab() { + #if defined(SUPPORT_WAB) +- GdkRectangle *dst; + GdkRectangle src; + GdkRectangle dstmp; + int exmgn = 0; +@@ -698,15 +697,12 @@ void scrnmng_bltwab() { + GdkPixbuf* rotatebuf; + if (np2wabwnd.multiwindow) return; + if (drawmng.backsurf != NULL) { +- dst = &drawmng.rect; + if (!(drawmng.scrnmode & SCRNMODE_FULLSCREEN)) { + exmgn = scrnstat.extend; + } + src.x = src.y = 0; + src.width = scrnstat.width; + src.height = scrnstat.height; +- memcpy(&dstmp, dst, sizeof(GdkRectangle)); +- dstmp.x += exmgn; + dstmp.width = scrnstat.width; + dstmp.height = scrnstat.height; + if (!(drawmng.scrnmode & SCRNMODE_ROTATE)) {