VOGONS


Reply 380 of 392, by superfury

User metadata
Rank l33t
Rank
l33t

Managed to fix some issues with the 32-bit RGB modes of the SC11487 (undocumented case from WhatVGA's mode 3a without pixel repack register bit 0 set, which causes a 32-bit rising-edge only (documented as both edges for pixel repack bit being set only, other mode now implemented is undocumented behaviour?) RGBA mode, based on WhatVGA's results (the top byte might be ignored or might not be ignored. The software leaves it 0 always)).
Also repack mode 2(24-bit mode)'s BGR mode is enabled again (it was being applied but not precalculated from the register values, thus effectively forced to 0 in the precalcs).

Edit: Also, the CRTC/Sprite start address above 2MB is now fixed by implementing the missing 22th address bit to the register precalcs.

Author of the UniPCemu emulator.
UniPCemu Git repository
UniPCemu for Android, Windows and PSP on itch.io

Reply 381 of 392, by superfury

User metadata
Rank l33t
Rank
l33t

Just added support for touch inputs to act like the mouse inputs when performing light pen inputs. This is now archieved by touching the middle mouse button area on the touch screen, then touching the right mouse button area to enable the custom input. After that, any touch will be registered as the location of the light pen to hold it at (as long as the other two areas are still touched. the location is registered and changed by touching with a third touch. A touch after the third touch will register as the light pen button instead. So you use two touches to enable the mode, then one touch for the location and another touch or re-touch (for both the location and button)). So that amounts to basically two touches on specific locations to enable the mode, and two linked (if two touches are used) for the button(two finger) or location(one finger).
Afaik this is the first emulator supporting light pen inputs on a touch screen now! 🤣

Author of the UniPCemu emulator.
UniPCemu Git repository
UniPCemu for Android, Windows and PSP on itch.io

Reply 382 of 392, by superfury

User metadata
Rank l33t
Rank
l33t

After lots of bug fixing, the new touch based input and existing mouse inputs now properly map to the light pen inputs.

I've also added a simple indicator (L for the light pen inputs being activated (using the first two inputs out of the four touch inputs to activate the mode, the third pointer not being shown, the fourth being shown using another LED display) and when it's showing the L it will show a P to the left of it when pressing the button on the light pen). The location will keep tracking into the emulation(updating location) as long as the light pen input is enabled and the third touch is (re)pressed. The release of the mode (middle mouse button area and right mouse button inputs not being pressed at the same time) will remove the light pen from the screen. The button is unaffected by this and will only be released when the left mouse button(using a mouse) is released or fourth touch is released from the screen.

I've also modified the VGA to not detect the light pen inputs when it's set to a location outside of active display (since the address is incorrect when latched that way (it could be at the right or left part of the screen, while being detected as being at the end of the last scanline, which of course is incorrect). So the overscan area won't detect the light pen input and will ignore it.

Author of the UniPCemu emulator.
UniPCemu Git repository
UniPCemu for Android, Windows and PSP on itch.io

Reply 383 of 392, by superfury

User metadata
Rank l33t
Rank
l33t

I've made a little bugfix to the way the i430fx/i440fx motherboards handle memory access in the 640K-1MB address space. They now should be properly not responding with memory when it shouldn't (when disabled using the chipset registers).

I've also been busy on making the Android Studio project a bit more simplified, removing many of the used files from the source control entirely. That should help with the constantly changing files that are specific to the user itself.
Most of those files will immediately be recreated when the IDE starts anyways.

Edit: Also, the new events on SDL 2.0.2 and up (the new audio and video events) are now supported and used. So when a new audio device (dis)connects, the app will automatically switch to the new source and back to the default when disconnecting. The same applies to recording sources, but it will go silent instead (as there is no default known to connect back into) until a new recording source is connected.
The new video refresh events are also handled, causing a recreation of textures (by recreating the entire SDL window and related textures etc.) or causing the display inside the window to be updated with actual pixels (for the other event).

Author of the UniPCemu emulator.
UniPCemu Git repository
UniPCemu for Android, Windows and PSP on itch.io

Reply 384 of 392, by superfury

User metadata
Rank l33t
Rank
l33t

Just added a command line parameter "fullscreenwindow" to the app. It will, when using the windowed mode(the initial mode), stretch the window using SDL2 to full desktop size (minus the task bar on Windows). So that should make it more usable on large or high resolution displays instead of becoming a much too small window (and requiring fullscreen to be usable otherwise).

Author of the UniPCemu emulator.
UniPCemu Git repository
UniPCemu for Android, Windows and PSP on itch.io

Reply 385 of 392, by superfury

User metadata
Rank l33t
Rank
l33t

Managed to implement a bit of extra support for high-DPI monitors. When the DPI reported by SDL is past 96 DPI, the rendering of the text surfaces on said monitor will cause UniPCemu to change the rendering of the text surfaces (all the text UniPCemu displays that's not from the emulated video card itself) to use roughly the same mode as used on Android and static screen devices (like the PSP). The PSP doesn't need any such rendering (it's enough to use 1:1 rendering), but Android (unchanged behaviour here) and now such high DPI monitors as well will use the same method for rendering the text surfaces on the display. So the display on the high DPI monitors will now actually cause UniPCemu to stretch the text display to fit the entire window, improving readability on said monitors (because otherwise the text would become too small).

Author of the UniPCemu emulator.
UniPCemu Git repository
UniPCemu for Android, Windows and PSP on itch.io

Reply 386 of 392, by superfury

User metadata
Rank l33t
Rank
l33t

Just adjusted the ISA DMA accesses to the UMB on the i430fx/i440fx motherboard emulation. This will float the bus when any UMB segment other than the E-segment is addressed(so for address ranged A0000-DFFFF and F0000-FFFFF).

Author of the UniPCemu emulator.
UniPCemu Git repository
UniPCemu for Android, Windows and PSP on itch.io

Reply 387 of 392, by superfury

User metadata
Rank l33t
Rank
l33t

I've just adjusted the Sound Blaster (including it's 1.5 version and the DSP 2.01 version) to use a partial decoding on the low 4 bits. It will now decode the upper 3 bits (as in the Sound Blaster clone (see my other thread Unknown port in/out to Sound Blaster ports on Windows 98?) of said 4 bits, using the upper 3 bits to decode the chip used (and DSP chip addressing using no more), while the other chips in the 22xh range using bit 0 as well(in this case only applied to the OPL2 chip, while the SAA-1099 chips are decoded directly instead(as do the OPL2 388/389 chip I/O range) with full 16-bits decoding(they might not really on the actual chipset though).
So this only applies to the 22xh range above 224h(so the range of 224h-22fh). This also means that the DSP chip aliases to their odd addresses(for example 22E aliasing to 22F).

Author of the UniPCemu emulator.
UniPCemu Git repository
UniPCemu for Android, Windows and PSP on itch.io

Reply 388 of 392, by superfury

User metadata
Rank l33t
Rank
l33t

Just fixed a bug in the UART, where if the device that can't receive data or no device being plugged in, while the UART is in loopback mode, allowing the loopback to properly send and receive data to the UART itself instead of not sending any data.

Author of the UniPCemu emulator.
UniPCemu Git repository
UniPCemu for Android, Windows and PSP on itch.io

Reply 389 of 392, by superfury

User metadata
Rank l33t
Rank
l33t

Just found something big that's now optimized away with my latest commits: the sound buffer rendering and pre-filtering algorithms.

When it was having sound channels that are in the 'new' state (meaning that they don't have any samples to parse, being disabled in their handling (effectively rendering silence only), it was still processing all silenced audio that's expected to be returned by the sound handler. So that includes: retrieving the sample, converting it to a standard floating point to parse(different kinds of samples are supported, like floating point, signed, unsigned etc.), applying volume to it, low-pass filtering it, optionally perform a high-pass filter as well, limiting the sample range to be within expected range, writing it to the filtered samples.

But since the filtered samples aren't used for channels when the audio renderer reports it has no audio to play, all those heavy processing steps can be ignored and not performed at all!

That pretty much reduces the entire audio rendering from a ~20% CPU usage to only ~2% when not rendering any MIDI channels (which are some 24 channels of audio being ignored now)!

Author of the UniPCemu emulator.
UniPCemu Git repository
UniPCemu for Android, Windows and PSP on itch.io

Reply 390 of 392, by superfury

User metadata
Rank l33t
Rank
l33t

Also made 2 other changes in the emulator (in source control, for the next release):
- The IRQ for the Sound Blasters that are emulated changed to IRQ 7 (seems to fix Windows detection somehow. It doesn't like to detect it on IRQ 5 it seems?).
- Better Windows modem dialing an empty phone number number (performing "ATDT;") to report "OK" and essentially NOP.
- Improved speed more by optimizing DMA transfer clocks that don't start any transfer when ticked multiple times to only parse the first clock, although ticking the remainder as well (first tick checks, remaining ticks NOP because it would do exactly the same).
- Saved some memory by shrinking the memory allocation registration from 256 byte text to only 18 byte text for each pointer, saving about 2MB (rounded) because of the wasted text space. Also changed various structures using an allocation name(or label) for their memory blocks to fit using shorter labels (only a few pointers used this, mainly audio precalcs, text surfaces and it's precalcs, GPU display memory and the main SDL wrappers for the display surfaces). And ~2MB is quite a lot of saving on small memory devices (like the normal PSP-1000, which only has about 20MB in total for the app to use).

Author of the UniPCemu emulator.
UniPCemu Git repository
UniPCemu for Android, Windows and PSP on itch.io

Reply 391 of 392, by superfury

User metadata
Rank l33t
Rank
l33t

I've changed a bit in my latest commits:
- Disk image readonly setting doesn't get cleared anymore when swapping disk images (unless unmounted completely by pressing triangle to remove the disk image mounted).
- Improved MIDI active sense handling with locks.
- Optimized directory listing for file lists.
- Improved debugger with virtual memory viewer and renamed the old memory viewer to physical memory viewer. Virtual memory can be viewed as either kernel privilege or debugged instruction privilege.
- Fixed EIP displaying in the on-screen debugger to not show part of the lower word on the next row (showing 32-bits properly when required, otherwise 16-bits) for both current and previous EIP addresses.
- Fixed debugger thread properly shutting down when the application is terminated.
- Properly stop logging when the debugger is active (not triggering memory access logs when the debugger is reading memory).
- Reduced default CPU IPS clocking speed to 3 MIPS for 80386 and up.
- Optimized TSC/APIC timing.
- Optimized directory listing to stop scanning the folder when it can't store any more items (list is full). Also don't check for dynamic/static disk images when not listing disk images.
- Don't reload the music file list when returning from a played song (only reload said list when choosing the option from the sound options menu).
- Generalized PSP code fixes in various modules to be done in the common emulator framework.

Also, the Windows builds using MinGW now properly compile with new compiler flags, not needing the use of the window fix program anymore to do it manually.
The PSP builds also have been fixed, now no longer crashing when terminating the application (this was caused by the SDLmain main() handler conflicting with UniPCemu's exit thread handling (which implements a proper timeout and lets the main thread close itself instead of SDL's direct call to sceKernelExitGame without cleaning up, which was causing crashes (due to missing memory allocations being half-deallocated and multithreading race conditions) or premature termination of the application)).

Author of the UniPCemu emulator.
UniPCemu Git repository
UniPCemu for Android, Windows and PSP on itch.io

Reply 392 of 392, by superfury

User metadata
Rank l33t
Rank
l33t

I've just changed the memory viewers in the debugger to use the single square button to start the memory viewer.

It will first ask for the address to view.
After that it will ask for the mode (which is new).
There are four options at this point:
- Triangle: View physical memory
- Square: View kernel privilege virtual memory
- Cross: View debugged instruction virtual memory
- Circle: Cancel and return to the debugged instruction.
Any of these (except circle) will open the memory viewer at the selected address in the chosen mode. Triangle is the old mode that was used before.
All memory is read directly. So effectively all ROM and memory mapped I/O is disabled for this viewer (this is to not disturb any state on said memory mapped I/O devices). Areas that the RAM won't respond to or are unmapped(including unmapped Virtual memory) will display accordingly (bytes displaying all ones and grayed out. It will also make the cursor become dark orange(for selected addresses) instead of green for such unmapped memory).

Author of the UniPCemu emulator.
UniPCemu Git repository
UniPCemu for Android, Windows and PSP on itch.io