Comments (13)
I think what's going on is there are too many UPS (353,293) Your actual emulation time (2.89ms) is fine but there are so many updates to process the overhead of that eats up all the frame time. I added a single, 1ms sleep to the event loop which in theory would cap UPS to 1000. Can you see if that helps?
from martypc.
Pulled the latest and built. I now get a stable 60fps, but PC speaker is still stuttering.
I'm testing it by running Quick Basic and entering the command PLAY "cdefgabc"
, which plays perfectly smoothly on a real 5150.
The stuttering is also noticable in the startup beep and games such as Commander Keen.
from martypc.
Ok, glad we got performance up. I am not going to dig too deeply into speaker issues at this time as the sound system is going to be rewritten soon. For the moment, you can disable sound in the config if it is distracting.
from martypc.
I was verifying that Area 5150 still ran after making some CPU changes, and noticed the audio problem myself. Turns out adding that 1ms sleep has disturbed the timestep calculations and so the emulator has been running slightly above 60fps and starving the audio buffer:
my timestep code is a bit slapdash so I will take the time to refactor it while fixing this. I swear 0.2 is never coming out at this rate...
from martypc.
2024-01-26.11-53-10.mp4
Having serious issues with the latest for a week or so now. PC speaker making all sorts of weird stuttering noises on startup, and now the keyboard is not working, so the emulator is unusable. See attached video with sound so you can hear my typing as the emulator seems to have a mind of its own, inserting random characters that I did not type, and constant backspaces to delete everything. Happens with EGA or CGA. Tried a fresh martypc.toml, same issue.
from martypc.
sorry you're having issues. can you change debug_keyboard to true in martypc.toml and show the terminal messages when you type a few keys (or see if key events are happening on their own)
either the phantom keystrokes are coming from the window system or from the emulator itself, and this would help determine that.
the current commit also adds a graph in the performance viewer it would be interesting to see.
from martypc.
2024-01-27.11-10-49.mp4
Looking at the terminal output, the keyboard events it's reporting are the correct ones, reflecting what I'm actually typing. What appears on the screen definitely is not.
from martypc.
what machine configuration are you using?
from martypc.
can you pull the latest commit, then show me with the PIC and PPI viewers open from the Debug->Devices menu?
what we're looking for is if there are spontaneous IRQ1s (keyboard interrupts) and if the 'Last Keyboard Byte' seems to change on its own
from martypc.
2024-01-27.11-52-44.mp4
I'm seeing that Last Keyboard Byte changing spontaneously from AA to 4D several times about once a second.
My machine configuration:
name = "ibm5160_hdd"
type = "Ibm5160"
rom_set = "auto"
speaker = true
[machine.memory]
conventional.size = 0xA0000
conventional.wait_states = 0
# Floppy disk controller
[machine.fdc]
type = "IbmNec"
# Drives connected to controller. Maximum of 4.
[[machine.fdc.drive]]
type = "360k"
image = "marty_util.img"
[[machine.fdc.drive]]
type = "360k"
# Hard disk controller
[machine.hdc]
type = "IbmXebec"
# Drives connected to controller. Maximum of 2.
# Drive #0 - (Typically C:)
[[machine.hdc.drive]]
type = "Mfm"
vhd = "main.vhd"
# Drive #1 - (Typically D:)
[[machine.hdc.drive]]
type = "Mfm"
vhd = "storage.vhd"
# Serial card
[[machine.serial]]
type = "IbmAsync"
[[machine.serial.port]]
io_base = 0x3F8
irq = 4
[[machine.serial.port]]
io_base = 0x2F8
irq = 3
# Video cards
[[machine.video]]
type = "CGA"
clock_mode = "Dynamic"
[machine.keyboard]
type = "ModelF"
layout = "US"
from martypc.
we can see IRQ1 ticking up very fast. so something is generating lots of keyboard interrupts.
4D is the scancode for Numpad 6...
can you disconnect your keyboard and see if the problem still occurs?
if you reset the machine does it keep happening on next boot?
if you remove the '[machine.keyboard]' section from the config does that stop the interrupts? (you won't be able to type, but if something else is causing it...)
from martypc.
Well I'll be darned, I unplugged my keyboard and plugged it back in again and now the problem's gone.
I wonder why this didn't affect any of my other programs.
Still having PC speaker problems though.
from martypc.
yeah, that is weird. let me know if it comes back.
from martypc.
Related Issues (20)
- Booting Minix 2.0.2 on PC XT fails silently HOT 29
- Cannot find icon.png error on startup HOT 4
- Failed to install ELKS due to error in mkfat HOT 6
- cargo run -r fails to compile on branch HOT 13
- Debug IO Port (0xE9) HOT 7
- Debugging: step over behavior HOT 4
- Microsoft Smartscreen / Windows Defender flagging MartyPC as malware HOT 3
- "Device Lost" panic at high resolutions
- Continuous beeping, continuous untyped key input, some OSes stop to work. HOT 8
- Fail to run XEBEC MFM Controller Rom HOT 32
- BUG: Look into always-on-top issue on Linux Mint Cinnamon
- MartyPC 0.2.0 fails to load keyboard mappings
- IBM 5150 fails to start on 0.2.0b stable due to missing overlay HOT 1
- Black screens in 8088MPH HOT 1
- Magiduck freezing at the end of a level HOT 1
- Monochrome blinks with colors in Doomtd3 HOT 6
- Emulator Crashes HOT 21
- Timing accuracy measurement or benchmark HOT 1
- macOS problems HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from martypc.