Merge branch 'master' of https://github.com/86Box/86Box into feature/savquest

This commit is contained in:
RichardG867
2021-07-29 20:00:30 -03:00
34 changed files with 2047 additions and 144 deletions

View File

@@ -0,0 +1,40 @@
/*
* 86Box A hypervisor and IBM PC system emulator that specializes in
* running old operating systems and software designed for IBM
* PC systems and compatibles from 1981 through fairly recent
* system designs based on the PCI bus.
*
* This file is part of the 86Box distribution.
*
* Definitions for the PCjr cartridge emulation.
*
*
*
* Authors: Miran Grca, <mgrca8@gmail.com>
*
* Copyright 2021 Miran Grca.
*/
#ifndef EMU_CARTRIDGE_H
# define EMU_CARTRIDGE_H
#ifdef __cplusplus
extern "C" {
#endif
extern char cart_fns[2][512];
extern void cart_load(int drive, char *fn);
extern void cart_close(int drive);
extern void cart_reset(void);
#ifdef __cplusplus
}
#endif
#endif /*EMU_CARTRIDGE_H*/

View File

@@ -0,0 +1,173 @@
/*****************************************************************************
* pce *
*****************************************************************************/
/*****************************************************************************
* File name: src/ibmpc/cassette.h *
* Created: 2008-11-25 by Hampa Hug <hampa@hampa.ch> *
* Copyright: (C) 2008-2019 Hampa Hug <hampa@hampa.ch> *
*****************************************************************************/
/*****************************************************************************
* This program is free software. You can redistribute it and / or modify it *
* under the terms of the GNU General Public License version 2 as published *
* by the Free Software Foundation. *
* *
* 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. *
*****************************************************************************/
#ifndef PCE_IBMPC_CASSETTE_H
#define PCE_IBMPC_CASSETTE_H 1
#include <stdio.h>
typedef struct {
char save;
char pcm;
unsigned char motor;
unsigned long position;
unsigned long position_save;
unsigned long position_load;
unsigned char data_out;
unsigned char data_inp;
int pcm_out_vol;
int pcm_out_val;
unsigned cas_out_cnt;
unsigned char cas_out_buf;
unsigned cas_inp_cnt;
unsigned char cas_inp_buf;
unsigned char cas_inp_bit;
int pcm_inp_fir[3];
unsigned long clk;
unsigned long clk_pcm;
unsigned long clk_out;
unsigned long clk_inp;
unsigned long srate;
char close;
char *fname;
FILE *fp;
pc_timer_t timer;
} pc_cassette_t;
void pc_cas_init (pc_cassette_t *cas);
void pc_cas_free (pc_cassette_t *cas);
pc_cassette_t *pc_cas_new (void);
void pc_cas_del (pc_cassette_t *cas);
/*!***************************************************************************
* @short Set the cassette file
* @return True on error, false otherwise
*****************************************************************************/
int pc_cas_set_fname (pc_cassette_t *cas, const char *fname);
/*!***************************************************************************
* @short Get the cassette mode
* @return True if in save mode, false if in load mode
*****************************************************************************/
int pc_cas_get_mode (const pc_cassette_t *cas);
/*!***************************************************************************
* @short Set the cassette mode
* @param save If true set save mode, otherwise set load mode
*****************************************************************************/
void pc_cas_set_mode (pc_cassette_t *cas, int save);
/*!***************************************************************************
* @short Get the cassette pcm mode
* @return True if in pcm mode, false if in binary mode
*****************************************************************************/
int pc_cas_get_pcm (const pc_cassette_t *cas);
/*!***************************************************************************
* @short Set the cassette pcm mode
* @param pcm If true set pcm mode, otherwise set binary mode
*****************************************************************************/
void pc_cas_set_pcm (pc_cassette_t *cas, int pcm);
/*!***************************************************************************
* @short Get the pcm sample rate
* @return The sample rate in Hz
*****************************************************************************/
unsigned long pc_cas_get_srate (const pc_cassette_t *cas);
/*!***************************************************************************
* @short Set the pcm sample rate
* @param pcm The sample rate in Hz
*****************************************************************************/
void pc_cas_set_srate (pc_cassette_t *cas, unsigned long srate);
/*!***************************************************************************
* @short Rewind the cassette
*****************************************************************************/
void pc_cas_rewind (pc_cassette_t *cas);
/*!***************************************************************************
* @short Fast forward to the end of the cassette
*****************************************************************************/
void pc_cas_append (pc_cassette_t *cas);
/*!***************************************************************************
* @short Get the current load/save position
*****************************************************************************/
unsigned long pc_cas_get_position (const pc_cassette_t *cas);
/*!***************************************************************************
* @short Set the current load/save position
*****************************************************************************/
int pc_cas_set_position (pc_cassette_t *cas, unsigned long pos);
/*!***************************************************************************
* @short Set the cassette motor status
*****************************************************************************/
void pc_cas_set_motor (pc_cassette_t *cas, unsigned char val);
/*!***************************************************************************
* @short Get the current input from the cassette
*****************************************************************************/
unsigned char pc_cas_get_inp (const pc_cassette_t *cas);
/*!***************************************************************************
* @short Set the current output to the cassette
*****************************************************************************/
void pc_cas_set_out (pc_cassette_t *cas, unsigned char val);
void pc_cas_print_state (const pc_cassette_t *cas);
void pc_cas_clock (pc_cassette_t *cas, unsigned long cnt);
void pc_cas_advance (pc_cassette_t *cas);
extern pc_cassette_t * cassette;
extern char cassette_fname[512];
extern char cassette_mode[512];
extern unsigned long cassette_pos, cassette_srate;
extern int cassette_enable;
extern int cassette_append, cassette_pcm;
extern int cassette_ui_writeprot;
extern const device_t cassette_device;
#endif

View File

@@ -121,6 +121,10 @@
#define IDS_2145 2145 // "You are loading an unsupported..."
#define IDS_2146 2146 // "CPU type filtering based on..."
#define IDS_2147 2147 // "Continue"
#define IDS_2148 2148 // "Cassette: %s"
#define IDS_2149 2149 // "Cassette images (*.PCM;*.RAW;*..."
#define IDS_2150 2150 // "Cartridge %i: %ls"
#define IDS_2151 2151 // "Cartridge images (*.JRC)\0*.JRC\0..."
#define IDS_4096 4096 // "Hard disk (%s)"
#define IDS_4097 4097 // "%01i:%01i"
@@ -229,7 +233,7 @@
#define IDS_LANG_ENUS IDS_7168
#define STR_NUM_2048 100
#define STR_NUM_2048 104
#define STR_NUM_3072 11
#define STR_NUM_4096 40
#define STR_NUM_4352 6

View File

@@ -82,6 +82,7 @@
#define MACHINE_IDE_QUAD 0x07800000 /* sys has int quad IDE/ATAPI - mark as dual + both ter and and qua IDE/ATAPI */
#define MACHINE_SCSI 0x08000000 /* sys has int single SCSI - mark as pri SCSI */
#define MACHINE_SCSI_DUAL 0x18000000 /* sys has int dual SCSI - mark as both pri and sec SCSI */
#define MACHINE_CARTRIDGE 0x20000000 /* sys has two cartridge bays */
#define IS_ARCH(m, a) (machines[m].flags & (a)) ? 1 : 0;
#define IS_AT(m) ((machines[m].flags & 0x00000FC8) && !(machines[m].flags & MACHINE_PC98)) ? 1 : 0;

View File

@@ -131,6 +131,10 @@ extern void plat_power_off(void);
/* Platform-specific device support. */
extern void cassette_mount(char *fn, uint8_t wp);
extern void cassette_eject(void);
extern void cartridge_mount(uint8_t id, char *fn, uint8_t wp);
extern void cartridge_eject(uint8_t id);
extern void floppy_mount(uint8_t id, char *fn, uint8_t wp);
extern void floppy_eject(uint8_t id);
extern void cdrom_mount(uint8_t id, char *fn);

View File

@@ -195,6 +195,7 @@
#define IDC_CONFIGURE_SCSI_2 1093
#define IDC_CONFIGURE_SCSI_3 1094
#define IDC_CONFIGURE_SCSI_4 1095
#define IDC_CHECK_CASSETTE 1096
#define IDC_HARD_DISKS 1100 /* hard disks config */
#define IDC_LIST_HARD_DISKS 1101
@@ -379,29 +380,41 @@
* and 5 bits for Removable Disks (5 bits for ID), so we use an
* 8bit (256 entries) space for these devices.
*/
#define IDM_FLOPPY_IMAGE_NEW 0x1200
#define IDM_FLOPPY_IMAGE_EXISTING 0x1300
#define IDM_FLOPPY_IMAGE_EXISTING_WP 0x1400
#define IDM_FLOPPY_EXPORT_TO_86F 0x1500
#define IDM_FLOPPY_EJECT 0x1600
#define IDM_CASSETTE_IMAGE_NEW 0x1200
#define IDM_CASSETTE_IMAGE_EXISTING 0x1300
#define IDM_CASSETTE_IMAGE_EXISTING_WP 0x1400
#define IDM_CASSETTE_RECORD 0x1500
#define IDM_CASSETTE_PLAY 0x1600
#define IDM_CASSETTE_REWIND 0x1700
#define IDM_CASSETTE_FAST_FORWARD 0x1800
#define IDM_CASSETTE_EJECT 0x1900
#define IDM_CDROM_MUTE 0x2200
#define IDM_CDROM_EMPTY 0x2300
#define IDM_CDROM_RELOAD 0x2400
#define IDM_CDROM_IMAGE 0x2500
#define IDM_CDROM_HOST_DRIVE 0x2600
#define IDM_CARTRIDGE_IMAGE 0x2200
#define IDM_CARTRIDGE_EJECT 0x2300
#define IDM_ZIP_IMAGE_NEW 0x3200
#define IDM_ZIP_IMAGE_EXISTING 0x3300
#define IDM_ZIP_IMAGE_EXISTING_WP 0x3400
#define IDM_ZIP_EJECT 0x3500
#define IDM_ZIP_RELOAD 0x3600
#define IDM_FLOPPY_IMAGE_NEW 0x3200
#define IDM_FLOPPY_IMAGE_EXISTING 0x3300
#define IDM_FLOPPY_IMAGE_EXISTING_WP 0x3400
#define IDM_FLOPPY_EXPORT_TO_86F 0x3500
#define IDM_FLOPPY_EJECT 0x3600
#define IDM_MO_IMAGE_NEW 0x4200
#define IDM_MO_IMAGE_EXISTING 0x4300
#define IDM_MO_IMAGE_EXISTING_WP 0x4400
#define IDM_MO_EJECT 0x4500
#define IDM_MO_RELOAD 0x4600
#define IDM_CDROM_MUTE 0x4200
#define IDM_CDROM_EMPTY 0x4300
#define IDM_CDROM_RELOAD 0x4400
#define IDM_CDROM_IMAGE 0x4500
#define IDM_CDROM_HOST_DRIVE 0x4600
#define IDM_ZIP_IMAGE_NEW 0x5200
#define IDM_ZIP_IMAGE_EXISTING 0x5300
#define IDM_ZIP_IMAGE_EXISTING_WP 0x5400
#define IDM_ZIP_EJECT 0x5500
#define IDM_ZIP_RELOAD 0x5600
#define IDM_MO_IMAGE_NEW 0x6200
#define IDM_MO_IMAGE_EXISTING 0x6300
#define IDM_MO_IMAGE_EXISTING_WP 0x6400
#define IDM_MO_EJECT 0x6500
#define IDM_MO_RELOAD 0x6600
/* Next default values for new objects */

View File

@@ -30,9 +30,8 @@
#define SBPRO 5 /* DSP v3.00 */
#define SBPRO2 6 /* DSP v3.02 + OPL3 */
#define SB16 7 /* DSP v4.05 + OPL3 */
#define SADGOLD 8 /* AdLib Gold */
#define SND_WSS 9 /* Windows Sound System */
#define SND_PAS16 10 /* Pro Audio Spectrum 16 */
#define SBAWE32 8 /* DSP v4.13 + OPL3 */
#define SBAWE64 9 /* DSP v4.16 + OPL3 */
/* SB 2.0 CD version */
typedef struct sb_ct1335_mixer_t

View File

@@ -116,6 +116,7 @@ extern const device_t sb_16_pnp_device;
extern const device_t sb_32_pnp_device;
extern const device_t sb_awe32_device;
extern const device_t sb_awe32_pnp_device;
extern const device_t sb_awe64_gold_device;
/* Innovation SSI-2001 */
extern const device_t ssi2001_device;

View File

@@ -50,14 +50,16 @@ extern void ui_check_menu_item(int id, int checked);
/* Status Bar functions. */
#define SB_ICON_WIDTH 24
#define SB_FLOPPY 0x00
#define SB_CDROM 0x10
#define SB_ZIP 0x20
#define SB_MO 0x30
#define SB_HDD 0x40
#define SB_NETWORK 0x50
#define SB_SOUND 0x60
#define SB_TEXT 0x70
#define SB_CASSETTE 0x00
#define SB_CARTRIDGE 0x10
#define SB_FLOPPY 0x20
#define SB_CDROM 0x30
#define SB_ZIP 0x40
#define SB_MO 0x50
#define SB_HDD 0x60
#define SB_NETWORK 0x70
#define SB_SOUND 0x80
#define SB_TEXT 0x90
extern wchar_t *ui_window_title(wchar_t *s);
extern void ui_status_update(void);

View File

@@ -58,6 +58,8 @@ DECLARE_HANDLE(DPI_AWARENESS_CONTEXT);
#define SDL_CLASS_NAME L"86BoxSDLWnd"
#define SDL_SUB_CLASS_NAME L"86BoxSDLSubWnd"
#define CASSETTE_SUBMENU_NAME L"CassetteSubmenu"
#define CARTRIDGE_SUBMENU_NAME L"CartridgeSubmenu"
#define FLOPPY_SUBMENU_NAME L"FloppySubmenu"
#define CDROM_SUBMENU_NAME L"CdromSubmenu"
#define ZIP_SUBMENU_NAME L"ZIPSubmenu"
@@ -220,10 +222,14 @@ extern wchar_t *BrowseFolder(wchar_t *saved_path, wchar_t *title);
extern void media_menu_init();
extern void media_menu_reset();
extern int media_menu_proc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam);
extern HMENU media_menu_get_cassette(void);
extern HMENU media_menu_get_cartridge(int id);
extern HMENU media_menu_get_floppy(int id);
extern HMENU media_menu_get_cdrom(int id);
extern HMENU media_menu_get_zip(int id);
extern HMENU media_menu_get_mo(int id);
extern void media_menu_update_cassette(void);
extern void media_menu_update_cartridge(int id);
extern void media_menu_update_floppy(int id);
extern void media_menu_update_cdrom(int id);
extern void media_menu_update_zip(int id);