Giter VIP home page Giter VIP logo

Comments (13)

dbalsom avatar dbalsom commented on June 4, 2024

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.

keenmaster486 avatar keenmaster486 commented on June 4, 2024

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.
image

from martypc.

dbalsom avatar dbalsom commented on June 4, 2024

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.

dbalsom avatar dbalsom commented on June 4, 2024

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:

image

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.

keenmaster486 avatar keenmaster486 commented on June 4, 2024
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.

dbalsom avatar dbalsom commented on June 4, 2024

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.

keenmaster486 avatar keenmaster486 commented on June 4, 2024
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.

dbalsom avatar dbalsom commented on June 4, 2024

what machine configuration are you using?

from martypc.

dbalsom avatar dbalsom commented on June 4, 2024

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.

keenmaster486 avatar keenmaster486 commented on June 4, 2024
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.

dbalsom avatar dbalsom commented on June 4, 2024

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.

keenmaster486 avatar keenmaster486 commented on June 4, 2024

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.

dbalsom avatar dbalsom commented on June 4, 2024

yeah, that is weird. let me know if it comes back.

from martypc.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.