dbalsom / martypc Goto Github PK
View Code? Open in Web Editor NEWAn IBM PC/XT emulator written in Rust.
License: Other
An IBM PC/XT emulator written in Rust.
License: Other
Hey, I'm trying to use the emulator to run Minix 2.0.2, which is the last version supported on 8088 PCs. The disk images are available here:
https://www.minix-vmd.org/pub/minix/2.0.2/
however, they were silently not visible in the emulator menu under "Media" -> "Load floppy in Drive A". Renaming the .MNX files to .IMG worked, but that was just a lucky guess on my part. Thank you
Describe the bug
MINIX 1.1 hangs during boot, with one blinking cursor.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
MINIX should boot.
Build info
MartyPC v0.1.3 from release page of this repo.
Additional context
Normally, when I have a PC with only a serial port and install media, I do a bootstrap from tcom.com or a BASIC Kermit to upload additional files to my machine.
COM2 connects to a real port (which is great!), so you can emulate a file transfer with a null modem cable connected to another serial port on your local machine. However, I'd like a simpler setup.
Would a COM3 port that is attached to a listening TCP port that sends/receives raw bytes be something you'd be interested in? I am willing to prototype this feature myself.
better documentation about rom set
How hard would it be to extend emulator to support 640k+ memory? Which mode would be the easiest to code correctly target?
5150 machines produce a '131' error on POST.
MZD says about error 131:
https://www.minuszerodegrees.net/5150/post/5150%20-%20POST%20-%20Some%20errors.htm
Failure of cassette port wrap-around (loopback) test. Wrap-around diagram at here.
I don't emulate the cassette interface so this is mostly expected; but I should be able to implement something basic enough to make the BIOS happy.
martypc crashes on init on my GNU/Linux system with: thread 'main' panicked at 'Failed to build an output audio stream: BackendSpecific { err: BackendSpecificError { description: "ALSA function 'snd_pcm_sw_params' failed with error 'EINVAL: Invalid argument'" } }', /usr/local/src/martypc/core/src/sound.rs:146:14
I'm running debian GNU/Linux without any audio daemons, just ALSA. The version of martypc I've built is the current git HEAD (f18b73e).
Here's the relevant part of a full backtrace, with all the rust unwind and backtrace display noise removed:
16: 0x5555557b5a2d - core::result::Result<T,E>::expect::h5577ddc278659af8
at /usr/src/rustc-1.70.0/library/core/src/result.rs:1046:23
17: 0x5555557a86dc - marty_core::sound::SoundPlayer::new::h52d87d0165aed411
at /usr/local/src/martypc/core/src/sound.rs:139:29
18: 0x5555557940df - martypc_pixels_desktop::run::h7f3e9de3742bc3cb
at /usr/local/src/martypc/frontends/martypc_pixels_desktop/src/lib.rs:523:36
19: 0x5555557917c7 - martypc::main::h2ad35e0e7d3e7dd8
at /usr/local/src/martypc/frontends/martypc_pixels_desktop/src/main.rs:38:5
Hi! When I ran the emulator, and went to create a new VHD for a hard drive with the "Media" -> "Create new VHD..." menu option, the "create" option was greyed out unless I manually entered a .vhd extension at the end of the filename. Since it was just greyed out and there was no error, I wasn't sure what was wrong for a while. I'd recommend removing this requirement, automatically adding .vhd to the filename if there's no extension, or adding an error message. Thank you :)
All the debugging capabilities are awesome!
But I have some additional suggestions regarding the "step over" button in the "CPU Control" window:
why even need a 64bit release for an 8086 emulator????
aarch64 build extremly slow around 2-3fps but only ~20% host cpu usage
I tested this on an 8core amlogic s912
built with https://aur.archlinux.org/packages/martypc on manjaro for amlogic
at least some halfway usable fps or majbe a better multicore usage
BTW: Running Keen4 in Dosbox runs snoother than smooth with not a single frameskip needs ~8% cpu and doesnt slow down martypc while running in parallel.
I get an error message that entry point _ZN3egl10CreateSyncEPvjPKx in dynamic connection library C:\Program Files\Neovim\bin\libEGL.dll could not be traced.
If I uninstall Neovim, message does not appear but application crashes immediately
only text in hosted MS-DOS 7.22 OS that could be selectable: for example in Turbo Pascal or Norton Commander editor/viewer (c:\nc\nc
, c:\tp\turbo
) could be copied. Probably needs some computer vision model or simple color based heuristics:
fn getSelectedText(&self) -> String {
// get text/colors from video memory
// selected text is in the middle of the screen, not first or last line
// selected text likely to have non primary or secondary background
// selected text likely to have blinking cursor next to it (?)
}
fn getSelectedText(&self) -> String {
// extracts list of colors of the screenshot of the TUI DOS program
// ocr's screenshot of TUI DOS program - gets each letter's bounding boxes
// calculates colors of each letter and its background
// heuristically determines what is the selected text:
// selected text is in the middle of the screen, not first or last line
// selected text likely to have non primary or secondary background
// selected text likely to have blinking cursor next to it (?)
}
How hard would be to extend emulator to support 80286?
Hi, impressive work!
I was doing a test of this little marvel in my old notebook, Thinkpad x220,
I am sure it has a crappy GPU. But maybe it's a better way to indicate the user minimum features needed ;)
I've read in the Wiki that it should have poor performance in old adapters.
so maybe this is an error?
Using ROM: ./roms\BIOS_5160_09MAY86_U18_59X7268_62X0890_27256_F800.BIN
Using ROM: ./roms\BIOS_5160_09MAY86_U19_62X0819_68X4370_27256_F000.BIN
Using ROM: ./roms\ibm_xebec_62x0822_1985.bin
Loaded 3 roms in romset.
Found floppy image: "./floppy\8088MPH (Final Version).img" size: 737280
Found floppy image: "./floppy\Area 5150 (Compo Version).img" size: 737280
Found floppy image: "./floppy\cgacomp.img" size: 737280
Found floppy image: "./floppy\FreeDOS 1.3 Disk 1 (Boot me).img" size: 368640
Found floppy image: "./floppy\FreeDOS 1.3 Disk 2.img" size: 368640
Found floppy image: "./floppy\Marty Utilities.img" size: 368640
Found floppy image: "./floppy\Ratillery (CGA).img" size: 368640
Found floppy image: "./floppy\Stellar Roads (CGA).img" size: 368640
thread 'main' panicked at 'called glObjectLabel but it was not loaded.', C:\Users\Daniel.cargo\registry\src\github.com-1ecc6299db9ec823\glow-0.12.2\src\gl46.rs:4571:5
Running with full Rust trace, I got the stack dump if it helps
stack backtrace:
0: 0x7ff6647cbb27 -
1: 0x7ff66436815b -
2: 0x7ff6647afe51 -
3: 0x7ff6647cdbeb -
4: 0x7ff6647cd7c7 -
5: 0x7ff6647ce633 -
6: 0x7ff6647ce0d5 -
7: 0x7ff6647ce01f -
8: 0x7ff6647cdff4 -
9: 0x7ff664b674b5 -
10: 0x7ff664b6dbd6 -
11: 0x7ff664b0ed74 -
12: 0x7ff6648fbb22 -
13: 0x7ff66497bf7a -
14: 0x7ff6645a4a70 -
15: 0x7ff66451804c -
16: 0x7ff66457b399 -
17: 0x7ff6644c3f99 -
18: 0x7ff6644c3fa6 -
19: 0x7ff6644c3b74 -
20: 0x7ff664b65d0c -
21: 0x7ffffa947614 - BaseThreadInitThunk
22: 0x7ffffc7426f1 - RtlUserThreadStart
Regards!
If left running an extended period of time, or sometimes at random(?) MartyPC may panic with the following error:
[2023-07-18T14:56:37Z WARN wgpu_hal::vulkan] Unrecognized device error ERROR_INITIALIZATION_FAILED
thread 'main' panicked at 'Error in Surface::configure: Validation Error
Caused by:
Parent device is lost
Somehow we appear to have lost the wgpu 'parent device'; I'm not sure if this is a recoverable condition. More research is needed to determine cause or reliably reproduce.
Potentially related upstream issue: gfx-rs/wgpu#2301
Which SVGA card is the best candidate for implementation?
some information:
This page is home to the FreeVGA Project -- dedicated to providing a totally FREE source of information about video hardware Feedback Form to contact the author
Introduction -- An introduction to low-level programming
Standard VGA Chipset Reference -- Documents the common functionality of all VGA and SVGA adapters.
Super VGA Hardware Chipset Reference -- Documents the specifics of VGA and SVGA adapters.
Other Video Hardware Reference -- Documents video related hardware other than VGA and SVGA adapters.
Tricks and Techniques -- Articles detailing the use of low-level programming for optimization or special effects.
Other References -- Gives pointers to other related material.
Warnings and Disclaimer -- Reading this section before utilizing any information contained within is both recommended and required.
Introduction to Low-level Programming -- Answers general questions about the topic. (Released 6/08/1998)
Overview of Video Hardware Functionality -- Describes the job of the video hardware and what components it uses to perform that task. (Released 6/15/1998)
Video Timing Information -- Gives information about video timing that is useful for video programmers. (Released 6/15/98)
Video Programming Glossary -- Defines terms that are related to video programming. (Added 6/15/1998)
VGA Chipset Reference -- Documentation of the "Standard" VGA implementation. (Released 8/01/1998)
SVGA Chipset Reference -- Documentation of specific VGA/SVGA hardware implementations. (WIP)
Tricks and Techniques -- Details on using the hard
On the martypc_pixels_desktop frontend, the minimum screen size is 1280x960, which can be a little large when working on other stuff.
Worse, if scaled, this can be greater than 1080p, making sure the window doesn't fit on the screen!
Hi, do you have a compiled binary for Windows ? I don't use rust and cannot compile the sorce code.
Thanks.
Publishing martypc (and the related crates -- marty_core, marty_render, etc.) to crates.io would make it more straightforward to install for users. It's also helpful for Linux distribution packaging, as they often rely (or even require) published crates (on that note, I'd be happy to take a stab at packaging this for Fedora, but its automation requires published crates). Thanks!
Config: martypc.toml.txt
The FreeDOS boot disk is loaded in A:, and 8088mph in B:. I compiled MartyPC 0.1.3 using the .tar.gz, on Linux, and changed the config to IBM PC rather than IBM XT, but the rest of the config is the same as what was included in the .tar.gz. The bios is glabios, grabbed from the Windows .zip, and I got the floppy images from there too.
Tried to install ELKS v0.7.0 (https://github.com/ghaerr/elks/releases/tag/v0.7.0) using martypc (on the branch version_0_2_0
) to the virtual IBM hard drive, using this installation guide:
https://github.com/ghaerr/elks/wiki#Installation
Here is the link to the relevant floppy disk image:
https://github.com/ghaerr/elks/releases/download/v0.7.0/fd360-fat.img
and here is the Xebec ROM that I used:
https://github.com/86Box/roms/blob/master/hdd/st506/ibm_xebec_62x0822_1985.bin
Booting the floppy, and creating the partition table on the virtual drive, worked OK. However, trying to make an FAT file system on the drive (within the ELKS environment booted from floppy) failed, with this error:
# mkfat /dev/hda1 41803
Creating FAT16, Cluster size 4
bioshd: bad partition start=0 sect=-1 nr_sects=0
bioshd: I/O error: dev 301, block 0
Can't create FAT image on /dev/hda1
fdisk /dev/hda
displays this partition information:
Geometry: 614 cylinders, 4 heads, 17 sectors
Device #:ID Cyl Head Sect Cyl Head Sect Start Size
/dev/hda1 *1:06 0 1 1 614 3 17 17 41803
On the new branch version_0_2_0
(commit 0965525ec11cfbcce9012b2f0674bb6c3ed76214
), the command cargo run -r
in the install
directory causes compilation to fail, with this error:
error[E0446]: private type `MouseData` in public interface
--> frontends/martypc_desktop_wgpu/src/emulator/mod.rs:71:5
|
71 | pub mouse_data: MouseData,
| ^^^^^^^^^^^^^^^^^^^^^^^^^ can't leak private type
|
::: frontends/martypc_desktop_wgpu/src/lib.rs:166:1
|
166 | struct MouseData {
| ---------------- `MouseData` declared as private
error[E0446]: private type `KeyboardData` in public interface
--> frontends/martypc_desktop_wgpu/src/emulator/mod.rs:72:5
|
72 | pub kb_data: KeyboardData,
| ^^^^^^^^^^^^^^^^^^^^^^^^^ can't leak private type
|
::: frontends/martypc_desktop_wgpu/src/lib.rs:216:1
|
216 | struct KeyboardData {
| ------------------- `KeyboardData` declared as private
error[E0446]: private type `Counter` in public interface
--> frontends/martypc_desktop_wgpu/src/emulator/mod.rs:73:5
|
73 | pub stat_counter: Counter,
| ^^^^^^^^^^^^^^^^^^^^^^^^^ can't leak private type
|
::: frontends/martypc_desktop_wgpu/src/lib.rs:95:1
|
95 | struct Counter {
| -------------- `Counter` declared as private
Host: Arch Linux, Rust 1.70
Guest: have tried PC-DOS 3.30, MS-DOS 6.22, IBM BASIC
I can use shifted characters, but only if they are letters. Unshifted a and shifted A works and all the other letters, but trying to type characters like :
, ?
, or *
doesn't work. It just does nothing.
[2023-07-03T18:34:07Z ERROR marty_core::machine] CPU Halted!
[2023-07-03T18:34:07Z ERROR marty_core::machine] CPU Error: The CPU was halted at address: 0FE0AB.
Yep turbo mode is off, and warpspeed too:
turbo = false
warpspeed = false
in toml
Originally posted by @graphixillusion in #33 (comment)
Yes, they're the same, but the emulator doesn't accept them.
Originally posted by @chungy in #32 (comment)
MartyPC build:
Branch: version_0_2_0
Commit:
commit 587693817c7efba9dab1a0356bd6688e0cc2898e
Author: dbalsom <[email protected]>
Date: Mon Dec 25 10:31:53 2023 -0500
Make some types public for compile issues
Built using cargo build -r --features=ega
My martypc.toml
:
# martypc.toml
# Main configuration file for the MartyPC emulator
[meta]
file_type = "main_config"
config_version = "0.2"
# ----------------------------------------------------------------------------
# Emulator paths
#
# By default, emulator paths are defined as relative to the base_dir path.
# If $base_dir$ is omitted from a path specifier, then that patch becomes
# an absolute path.
# Each path entry must be defined on a single line due to TOML grammar.
#
# Multiple entries for the same resource string can be defined for the
# following resources:
#
# hdd - MartyPC will search all defined paths for valid VHD images.
# rom - MartyPC will search all defined paths for valid ROMs.
# floppy - MartyPC will search all defined paths for valid floppy images.
# ----------------------------------------------------------------------------
[emulator]
# basedir: Base emulator data directory.
# Other emulator paths can be set as absolute paths, or relative to
# basedir with $basedir$
# The default is ".", effecting a portable installation with all
# directories relative to the current working directory.
basedir = "."
paths = [
{ resource = "machine", path = "$basedir$/configs/machines", recurse = true },
{ resource = "rom", path = "$basedir$/roms", recurse = true },
{ resource = "hdd", path = "$basedir$/hdd", recurse = true },
{ resource = "floppy", path = "$basedir$/floppy", recurse = true },
{ resource = "dump", path = "$basedir$/output/dumps" },
{ resource = "trace", path = "$basedir$/output/traces" },
{ resource = "screenshot", path = "$basedir$/output/screenshots" },
]
# Exclude any matching directories from recursion. Useful for temporarily
# hiding files, or moving files in and out of a "library" subdir.
ignore_dirs = [ "parking" ]
# -------------------------------------------------------------------------------------
# General emulator options
# -------------------------------------------------------------------------------------
# Power on the emulated machine on startup (only applicable in gui mode)
auto_poweron = true
# cpu_autostart: Run the CPU on startup - if false CPU will start paused
# (only applicable in gui mode)
cpu_autostart = true
# headless: Run MartyPC without any windows
headless = false
# fuzzer: Run the instruction fuzzer (requires validator feature)
fuzzer = false
# Debug mode does a few miscellaneous things.
# - CPU Autostart is disabled
# - Several debug panels are opened automatically
# - CPU Instruction history is turned on (overrides setting)
debug_mode = false
# Warn if MartyPC was compiled in debug mode. Disable this if you intend to
# do so and don't want the nag.
debug_warn = true
# Help the developer debug any keyboard issues you may be having. With this
# feature set to true, MartyPC will print information about every keystroke
# to the terminal.
debug_keyboard = false
# Don't load BIOS if true (not useful on its own)
no_bios = false
# Run the specified program instead of booting BIOS. The CPU reset vector will
# be set to 'run_bin_seg:run_bin_ofs'
#run_bin = "./program/a_effect.bin"
run_bin_seg = 0x1000
run_bin_ofs = 0x0000
[emulator.backend]
# Enable vsync. For wgpu frontend, I would recommend leaving this off. FIFO
# presentation mode increase latency and causes window resizing issues.
vsync = false
[emulator.audio]
# Set to false to disable sound system initialization.
enabled = true
[emulator.media]
# Provide a list of file extensions to interpret as raw floppy sector images.
raw_sector_image_extensions = [ "img", "ima", "dsk", "mnx" ]
[[emulator.media.vhd]]
# VHD to mount into drive 0 (Typically C:)
drive = 0
filename = "main.vhd"
[[emulator.media.vhd]]
# VHD to mount into drive 1 (Typically D:)
drive = 1
filename = "storage.vhd"
# ----------------------------------------------------------------------------
# Emulator Window Options
#
# MartyPC will always have a main window, unless run headless. The main
# window can be set to display a video adapter, or not. Additional windows
# can be defined in [[emulator.window]] sections. Multiple windows can
# reference the same video card - aperture and scaling options are set
# per-window, so you can visualize an adapter's output multiple ways.
# Of course, every window you create has a cost in memory throughput and
# rendering time.
#
# At least one [[emulator.window]] section must be present. The first
# [[emulator.window]] defines the main window.
#
# A note about sizes - the real minimum size of a window is the unscaled size
# of the card's selected video aperture, which may be larger than expected
# due to overscan. If this is larger than the requested min_size, min_size
# will be ignored, the scaler will not resample downwards.
# Therefore if you specifically want a 640x480 window, you should
# select the "Cropped" aperture.
# ----------------------------------------------------------------------------
[[emulator.window]]
# Provide a name for this window. (Required)
name = "Main GUI"
# If this parameter is provided, the window will be created at *at least*
# this size, or the video aperture resolution, whichever is higher.
# It is useful to use this value for the main window, but for secondary
# display windows, you may wish to use card_scale instead.
size = { w=1024, h=768 }
# If this window has a GUI menu, add the vertical height of the menu to the
# window height, and adjust the scaler to display the emulated display
# beneath it. Otherwise, if you create a 640x480 Cropped main window,
# the menu bar will overlap the top of image unless the GUI is hidden.
menu_adjust = true
# If set to false, the window cannot be resized by the user. It may still
# resize if the associated video card changes resolutions or the display
# aperture is changed.
resizable = true
# If this field is present, the window will display the specified card in its
# client area. If you do not want the window to display a card, comment this
# out.
# card_id is the numeric index of cards defined under the Machine section in
# [[videocard]] blocks. A standard PC will likely only have at most 0 and 1.
card_id = 0
# Size the initial window dimensions to the specified card's aperture size
# times this number.
# Setting this value overrides 'size' and 'resizable'.
#card_scale = 1
# Specify the scaler preset to use for this window. See the
# [[emulator.scaler_preset]] definitions defined below for reference.
scaler_preset = "default"
# Request that this window remain on top. Not recommended for main window.
always_on_top = false
# Second window, optional. Set 'enabled' to true to activate.
[[emulator.window]]
enabled = false
name = "Secondary Window"
size = { w=800, h=600 }
resizable = false
card_id = 0
card_scale = 1
scaler_preset = "Green CRT"
always_on_top = false
# Third window, optional
[[emulator.window]]
enabled = false
name = "Tertiary Window"
size = { w=640, h=480 }
resizable = false
card_id = 0
card_scale = 1
scaler_preset = "default"
always_on_top = false
# ----------------------------------------------------------------------------
# Emulator Scaler Presets
#
# Rather than define scaler settings for each possible window/display target,
# targets can reference a scaler preset defined here. Any number of
# [[emulator.scaler_preset]] sections can be defined, as long as the 'name'
# field is unique.
#
# At least one preset named "default" must be present.
#
# MartyPC's display pipeline for a video card has two stages - rendering
# and shading. Renderer options are listed under
# [emulator.scaler_preset.renderer] blocks. These must appear at the end
# of a scaler_preset definition.
# ----------------------------------------------------------------------------
[[emulator.scaler_preset]]
# Provide a unique name for this preset. Reference this name in window
# definitions. A name is required.
name = "default" # Default preset must exist! Do not rename.
# Specify the scaler mode to use for this window when displaying a video card.
# The default value is "Integer". This has no effect if no card_id is provided.
#
# Valid options for Scaler mode are
# Fixed1x - Video and shader output will be displayed at native base resolution
# Fixed2x - Video and shader output will be displayed at double base resolution
# Integer - Video and shader output will be scaled to the largest integer
# multiple that will fit in the window. This generally produces the
# clearest results, but can leave large black borders.
# Fit - Video will be scaled proportionally to fit the window.
# Stretch - Video will be scaled to fit the window.
mode = "Fit"
# Valid options for filter are:
# Linear - Bilinear filtering. Best results but may introduce blur.
# Nearest - Nearest neighbor filtering. Crisp, but may introduce scanline
# artifacts at non-integer scale sizes. Looks terrible with crt
# effects.
filter = "Nearest"
# RGBA color to use for the 'border' area around scaler output.
# This is also used for the background color of a window with no card
# attachment.
border_color = 0x323338 # Medium gray.
# Enable or disable CRT shader effects
crt_effect = false
# Degree to which the corners of the display should be rounded, from
# 0.0 (sharp corners) to 1.0 (maximum rounding)
crt_corner_radius = 0.0
# Amount of barrel distortion from 0 (no distortion) to 1.0
crt_barrel_distortion = 0.0
# Emulated phosphor type
# Valid values are:
# Color - (default) Normal color CRT
# White - White CRT phosphors
# Green - Green CRT phosphors
# Amber - Amber CRT phosphors
crt_phosphor_type = "Color"
# Emulate scanlines?
crt_scanlines = false
# Gamma correction value (only used when crt_phosphor_type != Color)
gamma = 1.0
# Renderer options. In MartyPC a renderer is responsible for presenting data
# to the scaler for display. These options are not technically part of the
# scaler, but included in scaler presets for convenience.
[emulator.scaler_preset.renderer]
#
# display_aperture: Valid options are:
# Cropped - Display the card in the "traditional" resolution for each graphics
# mode, with no overscan. Ie, 320x200 for low resolution CGA,
# 640x350 for high resolution EGA, 640x480 for high resolution VGA
# Accurate - Display the card with overscan extents as they would appear on a
# typical CRT monitor
# Full - Display the entire overscan area
# Debug - Display the entire video field, including horizontal and vertical
# blanking periods. Helpful for debugging video code.
#display_aperture = "Cropped"
# Aspect-correct scaler output to 4:3. This will make the video output more
# visually accurate to what you would see on a real monitor, but will introduce
# vertical blur if using Integer or Fixed scaling modes. This can be toggled in
# the GUI.
aspect_correction = true
# Aspect ratio to use, representing a w:h ratio. Both fields should be
# integers.
aspect_ratio = { h=4, v=3 }
# Emulate a composite color signal (and produce artifact color)
# Has no effect unless card type is CGA.
composite = false
# Define additional scaler presets below...
[[emulator.scaler_preset]]
name = "IBM 5153"
filter = "Linear"
border_color = 0x323338 # Medium gray.
crt_effect = true
crt_barrel_distortion = 0.2
crt_corner_radius = 0.2
crt_phosphor_type = "Color"
crt_scanlines = true
gamma = 1.0
[emulator.scaler_preset.renderer]
display_aperture = "Accurate"
aspect_correction = true
aspect_ratio = { h=4, v=3 }
composite = false
[[emulator.scaler_preset]]
name = "Green CRT"
filter = "Linear"
border_color = 0x323338 # Medium gray.
crt_effect = true
crt_barrel_distortion = 0.2
crt_corner_radius = 0.2
crt_phosphor_type = "Green"
crt_scanlines = true
gamma = 1.0
[emulator.scaler_preset.renderer]
display_aperture = "Accurate"
aspect_correction = true
aspect_ratio = { h=4, v=3 }
composite = false
[[emulator.scaler_preset]]
name = "Amber CRT"
filter = "Linear"
border_color = 0x323338 # Medium gray.
crt_effect = true
crt_barrel_distortion = 0.2
crt_corner_radius = 0.2
crt_phosphor_type = "Amber"
crt_scanlines = true
gamma = 1.0
[emulator.scaler_preset.renderer]
display_aperture = "Accurate"
aspect_correction = true
composite = false
aspect_ratio = { h=4, v=3 }
# ----------------------------------------------------------------------------
# GUI options
# ----------------------------------------------------------------------------
[gui]
# Disable the GUI entirely. Use autostart=true or you'll have no way to start
# the machine.
disabled = false
# Global zoom level for GUI. Smaller numbers will make all the GUI elements
# smaller. Default: 1.0 Max: 1.0 Min: 0.1
zoom = 1.0
# Enable dark theme (Recommended)
theme_dark = true
# Specify the color modifier for the selected EGUI theme. Comment out for the
# default color scheme. Theme colors only work properly with Dark mode.
theme_color = 0x382D59 # Marty purple (for Dark theme)
#theme_color = 0x2D4859 # Alt blue (for Dark theme)
[input]
# ----------------------------------------------------------------------------
# Some platforms reverse the left and right mouse button id #'s.
# We try to detect this, but it can be overridden here.
reverse_mouse_buttons = false
# ----------------------------------------------------------------------------
# CPU Options
# ----------------------------------------------------------------------------
[machine.cpu]
# Enable CPU wait states. This includes wait states from DMA, memory access
# and device IO. Setting this to false may speed up the CPU, but reduce
# accuracy (Area 5150 will break)
wait_states = true
# Attempt to detect when the CPU is executing invalid instructions and halt.
# May need to disable for certain test programs like acid88
off_rails_detection = false
# What to do when the CPU has entered an unrecoverable halt condition.
# Valid options are:
# Continue - Do nothing; just keep running
# Stop - Stop the system and display a warning notification
# Warn - Keep running, but display a warning notification
on_halt = "Warn"
# Enable instruction history. This slows down the emulator a modest amount
# when enabled. Only enable if debugging.
instruction_history = false
# Enable MartyPC's internal emulator serivce interrupt at 0xFC. You may need
# to disable this if conflicts arise. 'mdebug.com' requires this to be set
# true.
service_interrupt = true
# ----------------------------------------------------------------------------
# CPU Tracing Options
# ----------------------------------------------------------------------------
# CPU tracing may be enabled by specifying trace_mode
# Tracing does not begin unless trace_on == true or set in GUI
#
# Valid values for trace_mode:
# Instruction - Output per-instruction traces (slow, big)
# Cycle - Output per-cycle traces, text format (very slow, huge)
# Sigrok - Output per-cycle traces, csv format (very slow, huge)
# Designed for import into sigrok PulseView for debugging.
# Use an import string of t,x20,l,l,x2,x3,l,l,l,l,l,l
#
# >>> WARNING: Any of these options will quickly make multi-gigabyte files <<<
#
# Additionally, a valid value for trace_file must be supplied.
#
trace_on = false
#trace_mode = "Instruction"
#trace_mode = "Cycle"
#trace_file = "./traces/cycle_trace.log"
# ----------------------------------------------------------------------------
# Machine Options
# ----------------------------------------------------------------------------
[machine]
# Specify the name of a machine configuration to load.
config_name = "ibm5160_hdd"
#config_name = "ibm5160_hdd_ega"
# Specify configuration overlays to load on top of machine configuration.
#config_overlays = ["ega"]
# Turbo Button
# ----------------------------------------------------------------------------
# Change the clock divisor/multiplier for the CPU to run the CPU faster than
# normal. Other devices like the timer will continue to run at the same rate.
#
# On IBM PC/XT, turbo increases CPU clock from 4.77Mhz to 7.16Mhz.
turbo = false
# Emulate phase offset of PIT vs CPU. Don't change this if you don't know why
# you would want to do that.
pit_phase = 0
# Keyboard Type
# ----------------------------------------------------------------------------
# Valid options for keyboard_type are:
# ModelF - This was the original 83-key keyboard shipped with the PC/XT
# (More keyboard types yet to be implemented)
keyboard_type = "ModelF"
# Keyboard layout. Used to load the appropriate keyboard translation file.
# MartyPC will look for the file keyboard_XX.toml in the ./keyboard/ directory
# where XX is the string specified by keyboard_layout.
#
# Certain scancodes have changed their meaning since the 1980's. Your help
# would be appreciated in developing new translation files.
keyboard_layout="US"
# Enable typematic repeat for the emulated keyboard. Host repeat is ignored.
typematic = true
# Delay in milliseconds before typematic repeat begins.
typematic_delay = 500.0
# Delay in milliseconds between each scancode during typematic repeat.
typematic_rate= 50.0
# ----------------------------------------------------------------------------
# Benchmarking (not yet implemented - configs are placeholder)
# ----------------------------------------------------------------------------
[benchmark]
# Machine configuration to benchmark
config_name = "ibm5160"
# Valid options for benchmark_end_condition are:
# "Timeout" - Benchmark for 'timeout' seconds and exit
# "Trigger" - Terminate benchmark on signal from internal service interrupt
# "Cycles" - Terminate benchmark after 'cycles' CPU cycles
end_condition = "Timeout"
timeout = 60
cycles = 572400000 # 2 minutes
# ----------------------------------------------------------------------------
# Options for the CPU Validator module.
# ----------------------------------------------------------------------------
# You must have an Arduino8088 connected via USB to utilize
# the validator. For more information, see
# https://github.com/dbalsom/arduino_8088
[validator]
type = "Arduino8088"
trigger_address = 0xFFFF0
trace_file = "./traces/validator_trace.log"
# ----------------------------------------------------------------------------
# Options for JSON test facilities
# MartyPC can create JSON tests or validate them.
# ----------------------------------------------------------------------------
# Test generation requires a functioning CPU Validator module, see above
[tests]
# Valid values for test_mode are:
# None - Do not generate or validate tests (default - run emulator normally)
# Generate - generate tests based on supplied parameters
# Valdidate - validate tests
test_mode="None"
# Random seed for testing. The same random seed should produce the same
# set of tests. If you want a different set of tests, change this to any
# other number.
test_seed=1234
# Directory to look for / place tests
test_dir="tests/v1"
# Opcode range to generate or validate. Provide start and end opcodes.
# If start == end, that single opcode will be generated or validated.
test_opcode_range = [0, 0]
# List of opcodes to exclude in generation or validation.
test_opcode_exclude_list = [0xF1]
# Number of tests to generate per opcode.
test_opcode_gen_count = 5000
# If true, append to existing test JSON if < test_opcode_gen_count.
# If false, generation will replace any existing JSON file.
test_opcode_gen_append = true
Output of MartyPC when run:
Resolved resource path: "./roms"
Resolved resource path: "./hdd"
Resolved resource path: "./floppy"
Resolved resource path: "./output/traces"
Resolved resource path: "./configs/machines"
Resolved resource path: "./output/dumps"
Resolved resource path: "./output/screenshots"
Have 11 Machine Configurations:
generic_xt_base
videocard 0: type: CGA
generic_xt_hdd_ega
videocard 0: type: EGA
ibm5150_64k_hdd
videocard 0: type: CGA
generic_xt_hdd
videocard 0: type: CGA
ibm5150_256k_hdd
videocard 0: type: MDA
ibm5160
videocard 0: type: CGA
ibm5150_64k
videocard 0: type: MDA
generic_xt
videocard 0: type: CGA
ibm5160_hdd_ega
videocard 0: type: EGA
ibm5160_hdd
videocard 0: type: CGA
ibm5150_256k
videocard 0: type: MDA
Hash collision! Rom #1: "./roms/ibm_6277356_ega_card_u44_27128.bin" Rom #2 "./roms/ibm_6277356_ega_card_u44_27128 (1).bin" both have hash 0636f46316f3e15cb287ce3da6ba43a1. Rom #2 will be ignored.
Hash collision! Rom #1: "./roms/IBM_XEBEC_62X0822_1985 (1).BIN" Rom #2 "./roms/IBM_XEBEC_62X0822_1985.BIN" both have hash 66631d1a095d8d0d54cc917fbdece684. Rom #2 will be ignored.
Hash collision! Rom #1: "./roms/IBM_XEBEC_6359121_1982.BIN" Rom #2 "./roms/IBM_XEBEC_5000059_1982.BIN" both have hash bac8f05bedbec7009dd9dbc55e9ee22f. Rom #2 will be ignored.
Hash collision! Rom #1: "./roms/IBM_XEBEC_104839E.BIN" Rom #2 "./roms/IBM_XEBEC_104839RE.BIN" both have hash a9335919a1960998d83192cf449c38f6. Rom #2 will be ignored.
ROM scan found 33 unique ROMs.
Selected machine config ibm5160_hdd requires the following ROM features:
expansion
ibm5160
ibm_basic
ibm_xebec
Selected machine config ibm5160_hdd has resolved the following ROM sets:
ibm5160_86_v2_wbasic
ibm_xebec
Found VHD image: "./hdd/storage.vhd" size: 21412352
Found VHD image: "./hdd/main.vhd" size: 21412352
Using default audio device: default
Failed to load keyboard mapping file: ./keyboard/keyboard_US.toml Err: No such file or directory (os error 2)
[2023-12-29T05:40:22Z ERROR martypc_pixels_desktop::emulator] Number of videocards installed does not match number of cards in config!
My machine:
...-:::::-... <redacted>@<redacted>
.-MMMMMMMMMMMMMMM-. ---------------
.-MMMM`..-:::::::-..`MMMM-. OS: Linux Mint 21.2 x86_64
.:MMMM.:MMMMMMMMMMMMMMM:.MMMM:. Host: MS-7D91 2.0
-MMM-M---MMMMMMMMMMMMMMMMMMM.MMM- Kernel: 6.2.0-33-generic
`:MMM:MM` :MMMM:....::-...-MMMM:MMM:` Uptime: 11 days, 6 hours, 28 mins
:MMM:MMM` :MM:` `` `` `:MMM:MMM: Packages: 2875 (dpkg), 16 (flatpak)
.MMM.MMMM` :MM. -MM. .MM- `MMMM.MMM. Shell: bash 5.1.16
:MMM:MMMM` :MM. -MM- .MM: `MMMM-MMM: Resolution: 2560x1440
:MMM:MMMM` :MM. -MM- .MM: `MMMM:MMM: DE: Cinnamon 5.8.4
:MMM:MMMM` :MM. -MM- .MM: `MMMM-MMM: WM: Mutter (Muffin)
.MMM.MMMM` :MM:--:MM:--:MM: `MMMM.MMM. WM Theme: Mint-L-Dark (Mint-Y)
:MMM:MMM- `-MMMMMMMMMMMM-` -MMM-MMM: Theme: Mint-L [GTK2/3]
:MMM:MMM:` `:MMM:MMM: Icons: Mint-L [GTK2/3]
.MMM.MMMM:--------------:MMMM.MMM. Terminal: lxterminal
'-MMMM.-MMMMMMMMMMMMMMM-.MMMM-' Terminal Font: Fixedsys Excelsior 3.
'.-MMMM``--:::::--``MMMM-.' CPU: 12th Gen Intel i5-12400 (12) @
'-MMMMMMMMMMMMM-' GPU: NVIDIA GeForce RTX 3070 Ti
``-:::::-`` GPU: Intel Device 4692
Memory: 10838MiB / 31863MiB
Issue: I'm only getting about 53 fps. Seems like my machine should be able to handle 60.
MartyPC does seem to be running only on one core.
See attached screenshot of performance monitor:
QEMU and Bochs have the port 0xE9 available for easy debugging.
Would it be possible to add that port to the emulator?
Azhagen
Jungle Hunt is not working with MartyPC 0.1.3. You can set options but starting the game just gives you a blank screen. I believe that Jungle Hunt uses the 6845's light pen registers for timing the mid-screen palette change in-game.
Serhii
This issue seems to be caused by MartyPC attempting to use integrated graphics when there is a discrete graphics card in the system.
A workaround is to set an environment variable to tell MartyPC to use the highest-performance adapter:
WGPU_POWER_PREF=high
I will probably add another config option for choosing the high performance adapter and default it to true. Although I figured MartyPC should work well on any basic video card, in a lot of cases people ignore the integrated adapter and don't bother updating the drivers for it, so it can have issues.
Describe the bug
Multitasking MS-DOS 4.0 fails to boot on MartyPC.
The system hangs because it is looping for the memory address at [DS:0568] (0x05E01)
to be 0xFF
, but in MartyPC it appears to be 0x00
, which means the system loops forever and does not continue to boot. The memory address in question only appears to be set by the BIOS prior to being checked by the kernel. I tested with both the May 9, 1986 IBM XT bios and the default BIOS (GlaBIOS) provided with MartyPC. The relevant code is located at 0x3DE2-3DE8 in the kernel (IBMDOS.COM
). Not sure what is causing it - but have verified the kernel and bootloader are being copied into memory correctly. There is some kind of 8087 init code near what is freezing, but the system boots correctly on 86Box with no FPU.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
The operating system boots to its shell.
Environment (please complete the following information):
Build info
Tested with both 0.1.3 and code built from 28c0586, release configuration, on Windows.
Config:
martypc.toml.zip
what would be the good target for implemention? perhaps the controller the is already implemented - IBM/Xebec
which variation of the Xebec adaptor was used? if this one, was did it support any hard drives over 20mb? or its better to implement this one?
Click here to see IBM's technical document for this variation of the card (contains matching circuit diagram).
Click here for a cabling information.
Click here for information about low-level formatting.
Click here for information about the controller's power-on diagnostics (POD).
Click here for the code contained in the two ROM's.
it says that only 4 geometries were supported. Unable to determine which, seeking for information.
some info that is lacking here (in Russian, includes original disassembly of rom). long forum thread in Russian.
Hi! I tried on Ubuntu 23.04 and martypc almost starts up. I get a window with some working menus, but the main area stays black.
I get this in the output:
john@banana ~/GIT/martypc/install (main) $ ../target/debug/martypc
[2023-07-04T17:06:11Z ERROR wgpu_hal::gles::egl] EGL 'eglInitialize' code 0x3002: EGL_BAD_ACCESS error: In eglInitialize: EGLDisplay (0x5574896f1cc0): Backend failed to allocate context
Couldn't create specified video tracelog file: No such file or directory (os error 2)
[2023-07-04T17:06:11Z ERROR marty_core::machine] Couldn't create specified CPU tracelog file: ./traces/instr_trace.log
Couldn't create specified CPU tracelog file: ./traces/instr_trace.log
The Performance ...
window shows this:
I don't know if there any any useful clues there.
Settings / About
shows:
And it's an x11 desktop session.
Hi! The docs don't seem to include the build and run instructions:
cargo build --release
cargo run --release
I'm familiar enough with software that I figured it out, but would be helpful for anyone who doesn't already know Rust. Thank you :)
Describe the bug
I've installed NetSerial 4.34 and created a virtual COM2, the PC has a real COM1 installed.
In options, "attach COM2" - the only available option to connect to is COM1 (see attached screen greab).
Build info
I've had two reports of this. If anyone has experienced this, could you please drop a line here if you'd be willing to help troubleshoot?
Please search closed issues to see if you issue has already been addressed; if you are experiencing an issue that was believed to be resolved and any suggested fix/workaround isn't working, you may comment on the closed issue and I will reopen it if necessary.
When submitting a new issue, please state your CPU and GPU model, operating system, whether you are using a build of MartyPC or if you built it from a specific branch / commit / tag. It would be super useful if you could also set the following environment variable:
RUST_LOG=debug
...before running MartyPC. You'll need to run MartyPC from the command prompt to see debug messages.
Please zip up the log file and attach it. To get the text, in Windows, you can click the icon in the upper right of the command prompt window, go to Edit->Select All, then hit enter to copy the contents to the clipboard.
If you are having performance issues please include a screenshot of your Performance window under the Emulator menu.
Before submitting a new feature request, check my Kanban board to see if it is something I'm not already planning or working on:
https://github.com/users/dbalsom/projects/1/views/1?filterQuery=
Thanks for your interest in MartyPC!
Hi! I'm trying to install Minix 2.0.2 using the emulator. (Note that this is a different version, and a different error, than the issue in #61 ). Disk images are available here:
https://www.minix-vmd.org/pub/minix/2.0.2/
I tried loading the TINYROOT.MNX
(renamed to TINYROOT.IMG
) image to floppy drive A: and booting. However, the boot silently failed for unclear reasons; the disk was ignored, and the boot processed finished at the IBM BASIC terminal as if there was no disk. There was no error message displayed; I tried to run with RUST_LOG=trace
per the instructions, but there were so many messages that any error would have immediately scrolled off the screen.
I am using Ubuntu 22.04 on a laptop, and am on the branch main
, commit ID 23617a7500192f35a13ffd65539ef1171581a691
.
Describe the bug
Scream Tracker 2 (2.2 and (ended up entirely forgetting to test 2.2, guess I was impatient and made a false memory of me thinking I tested that version..) 2.3 tested) crashes MartyPC with "The CPU was halted at address: 032E1A" (confirmed on both latest release and on the new_ega
branch, I also tested using NANSI.SYS via FreeDOS, it halts at 033BEA, standard MS-DOS 3 also halts)
To Reproduce
Steps to reproduce the behavior:
[2023-11-26T15:53:08Z ERROR marty_core::machine] CPU Halted!
[2023-11-26T15:53:08Z ERROR marty_core::machine] CPU Error: The CPU was halted at address: 032E1A.
Expected behavior
The program should start up to this screen (my color scheme is different though shouldn't matter, screenshotted using DOSBox-X then aspect corrected using paint.net)
Environment (please complete the following information):
Build info
a189d6e
on new_egaf6b59ae
)When trying to start the emulator using cargo run
on the main branch (commit 23617a7500192f35a13ffd65539ef1171581a691
), there's an error that it can't find the file icon.png
. Moving icon.png
from the install/
directory into the repo root directory fixes the issue.
Seen on twitter:
https://twitter.com/sonneveld/status/1682635904824016896
From the disassembly, that sure is a lot of halts. MartyPC only halts in an error state if the interrupt flag is disabled, since an interrupt is the only thing that can resume from halt.
Need to investigate.
Just going to get ahead of this one. Latest builds seem to be flagged as WACATAC malware by Windows SmartScreen.
MartyPC doesn't use Tauri but I think this is a similar issue, as Tauri uses Tao, and Tao was a fork of Winit, which I do use: tauri-apps/tauri#2486
In any case, googling WACATAC leads to many, many reports of false positives.
I plan to bite the bullet and purchase a code signing certificate for MartyPC despite the obscene expense, which hopefully will reduce the weighting of these ML-detections.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.