-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
48 changed files
with
1,532 additions
and
652 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
## Collection of emulators of some 8 bits machines using SDL2 library, | ||
## including the MEGA65, Commodore LCD and Commodore 65. | ||
## | ||
## Copyright (C)2016-2022 LGB (Gábor Lénárt) <[email protected]> | ||
## Copyright (C)2016-2023 LGB (Gábor Lénárt) <[email protected]> | ||
# | ||
# This program is free software; you can redistribute it and/or modify | ||
# it under the terms of the GNU General Public License as published by | ||
|
@@ -64,6 +64,7 @@ DEBUG = no | |
RELEASE = no | ||
OFFICIALBUILD = no | ||
SUPERPICKY = no | ||
MACMINVER = no | ||
|
||
CFLAGS_TARGET = $(CFLAGS_TARGET_$(PRG_TARGET)) | ||
LDFLAGS_TARGET = $(LDFLAGS_TARGET_$(PRG_TARGET)) | ||
|
@@ -96,6 +97,10 @@ ifeq ($(STACKPROTECTOR), yes) | |
CONFIG_CFLAGS += -fstack-protector-strong | ||
CONFIG_CFLAGS_LINK += -fstack-protector-strong | ||
endif | ||
ifneq ($(MACMINVER), no) | ||
CONFIG_CFLAGS += -mmacosx-version-min=$(MACMINVER) | ||
CONFIG_CFLAGS_LINK += -mmacosx-version-min=$(MACMINVER) | ||
endif | ||
|
||
CFLAGS = $(CONFIG_CFLAGS) $(CFLAGS_OPT) $(CFLAGS_TARGET) -I. -I$(TOPDIR) -include build/configure/config-$(ARCH).h | ||
LDFLAGS = $(CONFIG_CFLAGS_LINK) $(LDFLAGS_TARGET) $(DLSYM_LIBS) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
## This file is part of the Xemu project: https://github.com/lgblgblgb/xemu | ||
## Collection of various emulators of some 8 bits machines using SDL2 library. | ||
## | ||
## Copyright (C)2016-2022 LGB (Gábor Lénárt) <[email protected]> | ||
## Copyright (C)2016-2023 LGB (Gábor Lénárt) <[email protected]> | ||
# | ||
# This program is free software; you can redistribute it and/or modify | ||
# it under the terms of the GNU General Public License as published by | ||
|
@@ -20,8 +20,6 @@ | |
|
||
echo "*** Running xemu-configure ***" | ||
|
||
MACOS_VERSION_MIN=10.6 | ||
|
||
########################################################### | ||
# Check some basic common UNIX utilities if work, we need # | ||
########################################################### | ||
|
@@ -65,7 +63,7 @@ CC="" | |
WINDRES="" | ||
SDL2_CONFIG="" | ||
PKG_CONFIG="" | ||
CFLAGS_USER="$val" | ||
CFLAGS_USER="" | ||
while [ "$1" != "" ] ; do | ||
var="`echo $1 | cut -f1 -d=`" | ||
val="`echo $1 | cut -f2- -d=`" | ||
|
@@ -344,8 +342,7 @@ for a in \ | |
PIPE_SUPPORTED_BY_CC:-pipe: \ | ||
O0_SUPPORTED_BY_CC:-O0: \ | ||
G_SUPPORTED_BY_CC:-g: \ | ||
FLTO_SUPPORTED_BY_CC:-flto \ | ||
MACOSVERMIN_SUPPORTED_BY_CC:-mmacosx-version-min=$MACOS_VERSION_MIN | ||
FLTO_SUPPORTED_BY_CC:-flto | ||
do | ||
b="`echo $a | cut -f1 -d:`" | ||
c="`echo $a | cut -f2 -d:`" | ||
|
@@ -801,18 +798,11 @@ echo "XEMUGUI_CFLAGS=$XEMUGUI_CFLAGS" >> $OUTPUT_MAKEFILE | |
echo "XEMUGUI_LIBS=$XEMUGUI_LIBS" >> $OUTPUT_MAKEFILE | ||
|
||
|
||
################ | ||
# MACOS target # | ||
################ | ||
|
||
if [ $TARGET_IS_OSX = Y -a $MACOSVERMIN_SUPPORTED_BY_CC = Y ]; then | ||
CFLAGS="$CFLAGS-mmacosx-version-min=$MACOS_VERSION_MIN " | ||
fi | ||
|
||
######################################### | ||
# Windows target: check windres utility # | ||
######################################### | ||
|
||
|
||
if [ $TARGET_IS_WIN = Y -a "$WINDRES" != "" ]; then | ||
cat > $SRC <<EOF | ||
#include <winver.h> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,6 @@ | ||
/* Test-case for simple, work-in-progress Commodore 65 emulator. | ||
Part of the Xemu project, please visit: https://github.com/lgblgblgb/xemu | ||
Copyright (C)2016-2021 LGB (Gábor Lénárt) <[email protected]> | ||
Copyright (C)2016-2023 LGB (Gábor Lénárt) <[email protected]> | ||
This program is free software; you can redistribute it and/or modify | ||
it under the terms of the GNU General Public License as published by | ||
|
@@ -67,4 +66,6 @@ void configdb_define_emulator_options ( void ) | |
{ "dmarev", 2, "Revision of the DMAgic chip (0/1=F018A/B, 2=rom_auto, +512=modulo))", &configdb.dmarev, 0, 1000 }, | ||
{ "prgmode", 0, "Override auto-detect option for -prg (64 or 65 for C64/C65 modes, 0 = default, auto detect)", &configdb.prgmode, 0, 65 } | ||
); | ||
static const void *do_not_save_opts[] = { &configdb.prg, &configdb.go64, &configdb.autoload, NULL }; | ||
xemucfg_add_flags_to_options(do_not_save_opts, XEMUCFG_FLAG_NO_SAVE); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
/* Test-case for simple, work-in-progress Commodore 65 emulator. | ||
Part of the Xemu project, please visit: https://github.com/lgblgblgb/xemu | ||
Copyright (C)2016-2021 LGB (Gábor Lénárt) <[email protected]> | ||
Copyright (C)2016-2023 LGB (Gábor Lénárt) <[email protected]> | ||
This program is free software; you can redistribute it and/or modify | ||
it under the terms of the GNU General Public License as published by | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
## A work-in-progess MEGA65 (Commodore-65 clone origins) emulator | ||
## Part of the Xemu project, please visit: https://github.com/lgblgblgb/xemu | ||
## Copyright (C)2016-2022 LGB (Gábor Lénárt) <[email protected]> | ||
## Copyright (C)2016-2023 LGB (Gábor Lénárt) <[email protected]> | ||
# | ||
# This program is free software; you can redistribute it and/or modify | ||
# it under the terms of the GNU General Public License as published by | ||
|
@@ -20,7 +20,7 @@ TARGET = mega65 | |
PRG_TARGET = xmega65 | ||
EMU_DESCRIPTION = MEGA65 | ||
|
||
SRCS_TARGET_xmega65 = configdb.c mega65.c sdcard.c uart_monitor.c hypervisor.c m65_snapshot.c memory_mapper.c io_mapper.c vic4.c vic4_palette.c ethernet65.c input_devices.c memcontent.c ui.c fat32.c sdcontent.c audio65.c inject.c dma65.c rom.c hdos.c matrix_mode.c | ||
SRCS_TARGET_xmega65 = configdb.c mega65.c sdcard.c uart_monitor.c hypervisor.c m65_snapshot.c memory_mapper.c io_mapper.c vic4.c vic4_palette.c ethernet65.c input_devices.c memcontent.c ui.c fat32.c sdcontent.c audio65.c inject.c dma65.c rom.c hdos.c matrix_mode.c cart.c | ||
SRCS_COMMON_xmega65 = emutools.c cpu65.c cia6526.c emutools_hid.c sid.c f011_core.c c64_kbd_mapping.c emutools_config.c emutools_snapshot.c emutools_files.c emutools_umon.c emutools_socketapi.c ethertap.c d81access.c emutools_gui.c basic_text.c opl3.c lodepng.c | ||
CFLAGS_TARGET_xmega65 = $(SDL2_CFLAGS) $(MATH_CFLAGS) $(SOCKET_CFLAGS) $(XEMUGUI_CFLAGS) | ||
LDFLAGS_TARGET_xmega65 = $(SDL2_LIBS) $(MATH_LIBS) $(SOCKET_LIBS) $(XEMUGUI_LIBS) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
/* A work-in-progess MEGA65 (Commodore 65 clone origins) emulator | ||
Part of the Xemu project, please visit: https://github.com/lgblgblgb/xemu | ||
Copyright (C)2016-2023 LGB (Gábor Lénárt) <[email protected]> | ||
This program is free software; you can redistribute it and/or modify | ||
it under the terms of the GNU General Public License as published by | ||
the Free Software Foundation; either version 2 of the License, or | ||
(at your option) any later version. | ||
This program is distributed in the hope that it will be useful, | ||
but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
GNU General Public License for more details. | ||
You should have received a copy of the GNU General Public License | ||
along with this program; if not, write to the Free Software | ||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ | ||
|
||
#include "xemu/emutools.h" | ||
#include "cart.h" | ||
#include "xemu/emutools_files.h" | ||
|
||
static Uint8 cart_mem[0x10000]; | ||
static int loaded = 0; | ||
|
||
|
||
void cart_init ( void ) | ||
{ | ||
memset(cart_mem, 0xFF, sizeof cart_mem); | ||
} | ||
|
||
|
||
Uint8 cart_read_byte ( unsigned int addr ) | ||
{ | ||
Uint8 data = 0xFF; | ||
if (addr < sizeof(cart_mem)) | ||
data = cart_mem[addr]; | ||
DEBUGPRINT("CART: reading byte ($%02X) at $%X" NL, data, addr + 0x4000000); | ||
return data; | ||
} | ||
|
||
|
||
void cart_write_byte ( unsigned int addr, Uint8 data ) | ||
{ | ||
DEBUGPRINT("CART: writing byte ($%02X) at $%X" NL, data, addr + 0x4000000); | ||
} | ||
|
||
|
||
int cart_load_bin ( const char *fn, const unsigned int addr, const char *cry ) | ||
{ | ||
if (!fn || !*fn) | ||
return 0; | ||
loaded = 0; | ||
if (addr >= sizeof(cart_mem)) { | ||
if (cry) | ||
ERROR_WINDOW("%s\nOutside of 64K range\n%s", cry, fn); | ||
return -1; | ||
} | ||
const int ret = xemu_load_file(fn, cart_mem + addr, 1, sizeof(cart_mem) - addr, cry); | ||
if (ret <= 0) | ||
return -1; | ||
DEBUGPRINT("CART: %d byte(s) loaded at offset $%04X from file %s" NL, ret, addr, fn); | ||
loaded = 1; | ||
return 0; | ||
} | ||
|
||
|
||
int cart_detect_id ( void ) | ||
{ | ||
static const Uint8 cart_id[] = {'M', '6', '5'}; | ||
return memcmp(cart_mem + 0x8007, cart_id, sizeof cart_id); | ||
} | ||
|
||
|
||
int cart_is_loaded ( void ) | ||
{ | ||
return loaded; | ||
} | ||
|
||
|
||
void cart_copy_from ( const Uint16 cart_addr, Uint8 *target, const Uint16 size ) | ||
{ | ||
memcpy(target, cart_mem + cart_addr, size); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
/* A work-in-progess MEGA65 (Commodore 65 clone origins) emulator | ||
Part of the Xemu project, please visit: https://github.com/lgblgblgb/xemu | ||
Copyright (C)2016-2023 LGB (Gábor Lénárt) <[email protected]> | ||
This program is free software; you can redistribute it and/or modify | ||
it under the terms of the GNU General Public License as published by | ||
the Free Software Foundation; either version 2 of the License, or | ||
(at your option) any later version. | ||
This program is distributed in the hope that it will be useful, | ||
but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
GNU General Public License for more details. | ||
You should have received a copy of the GNU General Public License | ||
along with this program; if not, write to the Free Software | ||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ | ||
|
||
#ifndef XEMU_MEGA65_CART_H_INCLUDED | ||
#define XEMU_MEGA65_CART_H_INCLUDED | ||
|
||
extern void cart_init ( void ); | ||
extern Uint8 cart_read_byte ( unsigned int addr ); | ||
extern void cart_write_byte ( unsigned int addr, Uint8 data ); | ||
extern int cart_load_bin ( const char *fn, const unsigned int addr, const char *cry ); | ||
extern void cart_copy_from ( const Uint16 cart_addr, Uint8 *target, const Uint16 size ); | ||
extern int cart_detect_id ( void ); | ||
extern int cart_is_loaded ( void ); | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
/* A work-in-progess MEGA65 (Commodore 65 clone origins) emulator | ||
Part of the Xemu project, please visit: https://github.com/lgblgblgb/xemu | ||
Copyright (C)2016-2022 LGB (Gábor Lénárt) <[email protected]> | ||
Copyright (C)2016-2023 LGB (Gábor Lénárt) <[email protected]> | ||
This program is free software; you can redistribute it and/or modify | ||
it under the terms of the GNU General Public License as published by | ||
|
@@ -50,6 +50,7 @@ static const struct xemutools_configdef_str_st str_options[] = { | |
{ "extfreezer", NULL, "Use external initial memory content for the Freezer", &configdb.extfreezer }, | ||
{ "hdosdir", NULL, "Set directory with HyppoDOS redirections", &configdb.hdosdir }, | ||
{ "defaultdir", NULL, "Set initial default directory for most file selector UIs", &configdb.defaultdir }, | ||
{ "hyperserialfile", NULL, "Use a file to write serial output into (no ASCII conversion, not even with -hyperserialascii)", &configdb.hyperserialfile }, | ||
{ "rom", NULL, "Override Hyppo's loaded ROM during booting.", &configdb.rom }, | ||
{ "prg", NULL, "Load a PRG file directly into the memory (/w C64/65 auto-detection on load address)", &configdb.prg }, | ||
{ "sdimg", SDCARD_NAME, "Override path of SD-image to be used (also see the -virtsd option!)", &configdb.sdimg }, | ||
|
@@ -73,6 +74,8 @@ static const struct xemutools_configdef_str_st str_options[] = { | |
{ "keymap", KEYMAP_USER_FILENAME, "Set keymap configuration file to be used", &configdb.keymap }, | ||
#endif | ||
{ "gui", NULL, "Select GUI type for usage. Specify some insane str to get a list", &configdb.selectedgui }, | ||
{ "importbas", NULL, "Import and RUN BASIC65 program from TEXT file", &configdb.importbas }, | ||
{ "cartbin8000",NULL, "Load binary cartridge image from $8000", &configdb.cartbin8000 }, | ||
{ NULL } | ||
}; | ||
|
||
|
@@ -97,22 +100,24 @@ static const struct xemutools_configdef_switch_st switch_options[] = { | |
#ifdef VIRTUAL_DISK_IMAGE_SUPPORT | ||
{ "virtsd", "Interpret -sdimg option as a DIRECTORY to be fed onto the FAT32FS and use virtual-in-memory disk storage.", &configdb.virtsd }, | ||
#endif | ||
#ifdef FAKE_TYPING_SUPPORT | ||
{ "go64", "Go into C64 mode after start (with auto-typing, can be combined with -autoload)", &configdb.go64 }, | ||
{ "autoload", "Load and start the first program from disk (with auto-typing, can be combined with -go64)", &configdb.autoload }, | ||
#endif | ||
{ "syscon", "Keep system console open (Windows-specific effect only)", &configdb.syscon }, | ||
{ "besure", "Skip asking \"are you sure?\" on RESET or EXIT", &i_am_sure_override }, | ||
{ "skipunhandledmem", "Do not even ask on unhandled memory access (hides problems!!)", &configdb.skip_unhandled_mem }, | ||
{ "fullborders", "Show non-clipped display borders", &configdb.fullborders }, | ||
{ "nosound", "Disables audio output generation", &configdb.nosound }, | ||
{ "noopl3", "Disables OPL3 emulation", &configdb.noopl3 }, | ||
{ "lockvideostd", "Lock video standard (programs cannot change it)", &configdb.lock_videostd }, | ||
{ "curskeyjoy", "Cursor keys as joystick [makes your emulator unsable to move cursor in BASIC/etc!]", &hid_joy_on_cursor_keys }, | ||
{ "showscanlines", "Show scanlines in V200 modes", &configdb.show_scanlines }, | ||
{ "allowscanlines", "Allow user programs to control scanline visibility", &configdb.allow_scanlines }, | ||
{ "fastboot", "Try to use sleepless emulation mode during booting", &configdb.fastboot }, | ||
{ NULL } | ||
}; | ||
|
||
static const struct xemutools_configdef_num_st num_options[] = { | ||
{ "model", 0xFF, "Emulated MEGA65 model (255=custom/Xemu)", &configdb.mega65_model, 0, 0xFF }, | ||
{ "model", 3, "Emulated MEGA65 model ID", &configdb.mega65_model, 0, 0xFF }, | ||
{ "hicked", 0x0, "Answer to HICKUP upgrade (128=ask user in a pop-up window)", &configdb.hicked, 0, 0xFF }, | ||
{ "prgmode", 0, "Override auto-detect option for -prg (64 or 65 for C64/C65 modes, 0 = default, auto detect)", &configdb.prgmode, 0, 65 }, | ||
{ "rtchofs", 0, "RTC (and CIA TOD) default hour offset to real-time -24 ... 24 (for testing!)", &configdb.rtc_hour_offset, -24, 24 }, | ||
|
@@ -126,6 +131,7 @@ static const struct xemutools_configdef_num_st num_options[] = { | |
{ "videostd", 0, "Use given video standard at startup/reset (0 = PAL, 1 = NTSC, -1 = Hyppo default)", &configdb.videostd, -1, 1 }, | ||
{ "sidmask", 15, "Enabled SIDs of the four, in form of a bitmask", &configdb.sidmask, 0, 15 }, | ||
{ "audiobuffersize", AUDIO_BUFFER_SAMPLES_DEFAULT, "Audio buffer size in BYTES", &configdb.audiobuffersize, AUDIO_BUFFER_SAMPLES_MIN, AUDIO_BUFFER_SAMPLES_MAX }, | ||
{ "coloureffect", 0, "Colour effect to be applied to the SDL output (0=none, 1=grayscale, 2=green-monitor, ...)", &configdb.colour_effect, 0, 255 }, | ||
{ NULL } | ||
}; | ||
|
||
|
@@ -135,6 +141,21 @@ static const struct xemutools_configdef_float_st float_options[] = { | |
}; | ||
|
||
|
||
// Options (given by the value pointers!) which SHOULD NOT BE saved when user saves their config. | ||
// The list MUST BE closed with a NULL. | ||
// The intent: some options makes sense mostly from using the command line (testing, called from scripts, | ||
// etc), however if the user saves the config in Xemu when started this way, it would also save these | ||
// CLI-given options, which is not the thing he wants, 99.999999% of time, I guess ... | ||
|
||
static const void *do_not_save_opts[] = { | ||
&configdb.prg, &configdb.prgmode, &configdb.autoload, &configdb.go64, &configdb.hyperserialfile, &configdb.importbas, | ||
&emu_is_sleepless, &emu_is_headless, &configdb.testing, | ||
&configdb.dumpmem, &configdb.dumpscreen, &configdb.screenshot_and_exit, | ||
&configdb.testing, &configdb.hyperdebug, &configdb.hyperdebugfreezer, &configdb.usestubrom, &configdb.useinitrom, &configdb.useutilmenu, | ||
&configdb.cartbin8000, | ||
NULL | ||
}; | ||
|
||
|
||
void configdb_define_emulator_options ( size_t size ) | ||
{ | ||
|
@@ -144,4 +165,5 @@ void configdb_define_emulator_options ( size_t size ) | |
xemucfg_define_switch_option_multi(switch_options); | ||
xemucfg_define_num_option_multi(num_options); | ||
xemucfg_define_float_option_multi(float_options); | ||
xemucfg_add_flags_to_options(do_not_save_opts, XEMUCFG_FLAG_NO_SAVE); | ||
} |
Oops, something went wrong.