Commit Graph

303 Commits

Author SHA1 Message Date
Voxel9 c90335801c nv2a: Fix FFP texgen assertions
Should compare against channel index instead of texture stage index
2020-06-29 07:49:51 -07:00
Voxel9 3bbea5269e nv2a: Remove TEXGEN_SPHERE_MAP assertion 2020-06-29 07:49:51 -07:00
Matt Borgerson 7f4b9d5480 nvnet: Fix ringbuffer index reset, multi-desc frames, IRQ status bits 2020-06-19 05:43:14 -07:00
Matt Borgerson 60d3dc8ae1 nv2a: Add VMStateDescription 2020-06-19 05:43:14 -07:00
Matt Borgerson c9cf9a9972 nv2a: Add state flushing to PGRAPH 2020-06-19 05:43:14 -07:00
Matt Borgerson 0673010e54 nvnet: Add VMStateDescription 2020-06-19 05:43:14 -07:00
Matt Borgerson af38316719 nvnet: Set DEVICE_CATEGORY_NETWORK bit on device class 2020-06-19 05:43:14 -07:00
Matt Borgerson 1e3e81b02c nvnet: Fix and check register addrs 2020-06-19 05:43:14 -07:00
Matt Borgerson 6e4f91fabd nvnet: Use parent_obj per QEMU conventions 2020-06-19 05:43:14 -07:00
Matt Borgerson 7ecabc52a9 xid: Add VMStateDescription stub 2020-06-19 05:43:14 -07:00
Matt Borgerson f68d358b0a mcpx-apu: Add VMStateDescription 2020-06-19 05:43:14 -07:00
Matt Borgerson 97b932f08b dsp: Split DSPState structure off into new file 2020-06-19 05:43:14 -07:00
Matt Borgerson 0932e05d60 mcpx-aci: Add VMStateDescription stub 2020-06-19 05:43:14 -07:00
Matt Borgerson 92e07437fd xbox-apci: Add VMStateDescription 2020-06-19 05:43:14 -07:00
Matt Borgerson b9b0f38bbb xbox-pci: Add SMBus/LPC/PCI VMStateDescription 2020-06-19 05:43:14 -07:00
Matt Borgerson f898b5e875 nv2a: Rename PCIDevice dev to parent_obj per QEMU convention 2020-06-19 05:43:14 -07:00
Matt Borgerson f2869790d9 nv2a: Check for PGRAPH FIFO access before context switch 2020-06-17 01:14:43 -07:00
Matt Borgerson ec4e798426 nv2a: Merge pfifo pusher/puller threads 2020-06-12 00:06:06 -07:00
Matt Borgerson c9df1d1047 nv2a: Replace some non-critical assertions with debug macros
In the event these features are utilized, execution may still continue,
albeit with the likely possibility graphical problems of varying degree.
This patch replaces hard assertions with debug print statements when
configured to do so.
2020-06-10 19:04:22 -07:00
Matt Borgerson 382d6e383d smc: Add eject, power button, and basic drive tray status 2020-06-03 04:51:09 -07:00
Matt Borgerson ab5add9a2f xbox: Add ACPI GPE0 block and support EXTSMI# 2020-06-03 04:51:09 -07:00
Matt Borgerson f93c7b4ea3 nv2a: Fix device reset 2020-05-31 14:26:15 -07:00
Matt Borgerson 7e67f18595 ui: Cleanup debug messages 2020-05-22 14:57:58 -07:00
Matt Borgerson 1c8c1babf9 xbox: Do not crash if BIOS fails to load 2020-05-04 07:23:30 -07:00
Matt Borgerson c2b74a08d3 ui: Move QEMU main loop to a thread 2020-05-04 07:22:56 -07:00
Matt Borgerson 0245d3bee9 nv2a: Update Makefile offscreen GL sources 2020-05-04 07:15:29 -07:00
Matt Borgerson 31c526d10a xid: Use xemu input interface 2020-05-04 07:15:25 -07:00
Matt Borgerson 2d364b5bd1 nv2a: Add SDL-based offscreen GL context interface 2020-05-04 07:13:16 -07:00
Matt Borgerson 2199dbc4e9 nv2a: Remove platform-specific GL context management 2020-05-04 07:10:26 -07:00
Matt Borgerson 2fe8618d24 xbox: Fix missing includes 2020-05-01 03:48:35 -07:00
Matt Borgerson 6e5b208e41 lpc47m157: Align with new QOMified interface
Ideally this would be further abstracted to use existing SuperIO
(TYPE_ISA_SUPERIO) or at least serial-isa, but those both require core
changes. Continue with embedding SerialState for now and update to
support new SerialState device model change.

Associated commits:
- 7781b88ee4
- c9808d6028
- 4f67d30b5e
2020-05-01 03:40:21 -07:00
Matt Borgerson 402fd6bf2a nvnet: Make NetCanReceive() return a boolean
Applying change b8c4b67e3e to nvnet.
2020-05-01 02:52:01 -07:00
Matt Borgerson 4e0ada2b14 xbox: Get rid of piix3_init_functions
Applying the following changes to the Xbox machine:
- df45d38f73
- 987aa99e3f
2020-05-01 02:51:57 -07:00
Matt Borgerson bf51b0a9c0 xbox: Set properties with device_class_set_props
Applying change 4f67d30b5e to Xbox
hardware.
2020-05-01 02:51:54 -07:00
Matt Borgerson 2b667343db hw/xbox: Update xbox machine to align with new pc/x86 machine 2020-02-18 22:14:32 -07:00
Matt Borgerson 8d50346ce6 hw/xbox: Update includes that have changed upstream 2020-02-17 23:49:33 -07:00
Luke Usher 0ced417e73 dsp: Use endianness handling functions when accessing memory 2020-01-03 02:28:14 +01:00
Stanislav Motylkov c230d77bc2 nv2a: Add some missing RAMDAC registers
Cromwell sets these registers on video initialization and
guest OS should be able to read them in order to obtain
current screen resolution set up by firmware.
2019-10-18 21:30:16 +01:00
Stanislav Motylkov c4fca3843f lpc: Fix typo in CONFIG_DEVICE_INTERRUPT constant 2019-10-04 23:36:10 +02:00
Jannik Vogel 2dc570561e nv2a: Fix VGA get_bpp for X1R5G5B5 2019-10-01 12:48:45 -07:00
Jannik Vogel f9b9a9bad8 nv2a: Add support for PGRAPH RDI select 0xCC 2019-09-16 12:15:25 -07:00
Jannik Vogel e42fb24752 nv2a: Add support for PGRAPH RDI select 0x17 2019-09-16 12:15:25 -07:00
Jannik Vogel 973f8db16a nv2a: Support PGRAPH RDI 2019-09-16 12:15:25 -07:00
Jannik Vogel 5ccd95ec4b nv2a: Use `pg` shortname in PGRAPH MMIO handler 2019-09-16 12:15:25 -07:00
Stanislav Motylkov 5e8af994c0 smc: Make attached avpack configurable
Also improved constant definitions based on https://xboxdevwiki.net/AV_Cables

Co-authored-by: Matt Borgerson <contact@mborgerson.com>
2019-09-09 12:46:20 -07:00
Stas'M dd1248a563 nv2a: Set PCI class id and subsystem id to match hardware
This patch sets the class id, subsystem id, and subsystem vendor id
in the PCI device header to match what the NV2A hardware advertises.

This resolves an issue with PCI device enumeration failing to detect and load
the driver for the NV2A device in some operating systems, namely ReactOS
version 0.2.5-xbox (custom build), which depend on these fields being
programmed correctly.
2019-08-28 13:55:21 -07:00
Matt Borgerson 4cf920d594 apu: Disable buffer sampling for now 2019-07-12 18:42:03 -07:00
Matt Borgerson 6c11490a35 apu: Add license for ADPCM decoder files 2019-07-12 18:42:03 -07:00
Matt Borgerson dd20a673ed apu: Fix unused var warnings used only in debug prints 2019-07-12 18:42:03 -07:00
Matt Borgerson ededef3b38 apu: Use MCPX_DPRINTF instead of printf 2019-07-12 18:42:03 -07:00
Matt Borgerson 3ae172c209 apu: Fix indentation for step_envelope 2019-07-12 18:42:03 -07:00
Matt Borgerson e90304a223 apu: Buffer playback cleanup and build fixes 2019-07-12 18:42:03 -07:00
Matt Borgerson 4073c3200e apu: Import JayFoxRox's basic buffer sampling code
This patch adds the code necessary to perform basic buffer sampling for
HW voices. Includes new register definitions, support for a few new
methods, envelope stepping, ADPCM decoding, and the individual voice
buffer sampling to be added to the VP output mixbufs. This code does not
add system audio playback nor streaming support.

Some portions are disabled as they will need to be fixed up for
compilation in this new tree.

This code originates from Jannik Vogel's 2017 audio branch. Copied into
the current, recently LGPL-licensed version of this file with
permission.

https://github.com/JayFoxRox/xqemu-espes/commits/audio
2019-07-12 18:42:03 -07:00
Lucas d1e77ec0c4 xid: Swap SDL binding for black and white buttons 2019-07-05 15:14:08 -07:00
Matt Borgerson 8d17b4d772 smbus: Fixup potential buffer oob on ADM1032 2019-07-04 12:11:28 -07:00
Matt Borgerson bc049f43e1 smbus: Fixup smbus_read/write_block calls 2019-07-04 00:04:00 -07:00
Matt Borgerson 68bfbf65a3 smbus: Cleanup SMC device and track cmd 2019-07-04 00:04:00 -07:00
Matt Borgerson 1f2ae93e5c smbus: Cleanup CX25871 device and track cmd 2019-07-04 00:04:00 -07:00
Matt Borgerson edf04b1364 smbus: Cleanup ADM1032 device and track cmd 2019-07-04 00:04:00 -07:00
Matt Borgerson ab5027a5ea smbus: Fixup headers 2019-07-04 00:04:00 -07:00
Matt Borgerson 818f31a04f chihiro: Fixup headers 2019-07-04 00:04:00 -07:00
Matt Borgerson fc559b1aed lpc: Update qemu_chr_new call arguments 2019-07-04 00:04:00 -07:00
Matt Borgerson 28dd7de81d xbox_pci: Replace deprecated init func with realize 2019-07-04 00:04:00 -07:00
Matt Borgerson 00c2a0c5b2 xbox: Fixup headers 2019-07-04 00:04:00 -07:00
Matt Borgerson 67359423a6 xbox: Rename pit to pit_enabled per pcms change 2019-07-03 23:42:53 -07:00
Luke Usher e90b18616a nvnet: Guest MAC address should not be initialized by hardware
This is set by the running application, so the default value remains
unused.
2019-03-26 03:16:26 -07:00
Jannik Vogel 1026f0e42f vsh: Minor improvements to individually weighted skinning 2019-02-24 17:05:50 -07:00
Jannik Vogel c331854c55 vsh: Support generated weights in skinning 2019-02-24 17:05:50 -07:00
Jannik Vogel f3b7fefde4 vsh: Fix skinning mode order 2019-02-24 17:05:50 -07:00
Jannik Vogel 0f39a2cc76 nv2a: Slot 0 of SET_VERTEX_DATA specifies a vertex 2019-02-22 17:02:44 -07:00
Jannik Vogel c5962e0920 apu: Add mixbin beep tone for debugging 2019-02-18 11:49:31 -07:00
Jannik Vogel f2901a24d4 apu: Add VP framework 2019-02-18 11:49:31 -07:00
Jannik Vogel 46dccb0182 apu: Use GP_DSP_MIXBUF_BASE to refer to MIXBUF base 2019-02-18 11:49:31 -07:00
Darren 7fca76a2d9 xid-sdl: Enable left/right force feedback with SDL2 2019-02-18 11:44:47 -07:00
Jannik Vogel 851e478319 psh: Separate input component usage selection for RGB and ALPHA portion 2019-02-18 11:43:20 -07:00
Jannik Vogel f9ba5b9c8c psh: Final combiner G input is a scalar 2019-02-18 11:43:20 -07:00
Jannik Vogel 52f897aa17 psh: Use vec4 for all registers 2019-02-18 11:43:20 -07:00
Jannik Vogel d225ff7a98 psh: Use float for alpha, vec3 for rgb 2019-02-18 11:43:20 -07:00
Jannik Vogel f21c2d7ddb psh: Use output clamping from NV_register_combiners GL extension 2019-02-16 12:43:08 -07:00
Jannik Vogel c1494de8d3 psh: Use input mapping from NV_register_combiners GL extension 2019-02-16 12:42:49 -07:00
DaveX 65cd1cf9ae chihiro: Use hyphens in machine object prop names 2019-02-15 15:12:48 -07:00
Stefan Schmidt 960698a24e nv2a: Set content of disabled register combiner stages to zero 2019-02-06 23:32:22 -07:00
Jannik Vogel f3d7e72a5c nv2a: Fix A8Y8 texture formats 2019-02-06 23:28:43 -07:00
Matt Borgerson 7a59bf14d3 nv2a: Use linear addressing for LU_IMAGE_A4R4G4B4 2019-02-06 20:05:12 +01:00
Jannik Vogel e7bd7bf228 dsp: Support FIFO output in DMA 2019-01-28 12:01:58 -07:00
Jannik Vogel 2e660193a0 apu: Add support for DSP FIFOs 2019-01-28 12:01:58 -07:00
Jannik Vogel 423b6f57bc apu: Fix off-by-one in scatter gather page entry check 2019-01-28 12:01:58 -07:00
Lucas Eriksson 929954e713 smbus: Fix wordwrite bug 2019-01-27 13:24:50 +01:00
CakeLancelot ebb1052278 xid: Fix trigger range in xid-sdl 2019-01-27 12:39:34 +01:00
Matt Borgerson 47452495c0 nv2a: Fix NV097_SET_VERTEX_DATA2S scaling
Vertex attribute values provided via NV097_SET_VERTEX_DATA2S are
apparently two 16-bit signed integers, packed into 32 bits, which are
then to be directly mapped to floating point values in the range
[-32768.0, 32767.0].

Halo:CE uses this format to provide texture (u,v) coordinates for
render-to-texture techniques, including weapon scope, dynamic shadows,
and radar beacon--all of which are now working as expected with this
patch.
2019-01-22 16:12:11 -07:00
Matt Borgerson fc995f154c xid: Port fixes made to xid.c to xid-sdl.c
The recent fixes to xid.c (32bf810) didn't make it to xid-sdl.c. This
patch ports over those changes. In the future, the parts common to both
xid.c and xid-sdl.c should be factored out so this doesn't happen again.

Original work done by Jannik Vogel (aka JayFoxRox) on Jul 5th, 2018.
2019-01-15 14:44:54 -07:00
Jannik Vogel 01be8ef6b8 dsp: Improve DMA debug message 2018-12-29 12:07:38 +01:00
Jannik Vogel 4513ab50da dsp: Decode all DMA control bits 2018-12-29 12:07:38 +01:00
Jannik Vogel e3a93c48fb apu: Access system memory directly 2018-12-27 15:00:35 -07:00
Jannik Vogel 9cac29fe07 apu: Activate voice on VOICE_ON, regardless of list position 2018-12-26 15:44:15 -07:00
Jannik Vogel 7c43feded0 apu: Fix offset of scratch space PRD control word 2018-12-26 15:44:15 -07:00
Jannik Vogel 8579e23ecb apu: Use NV1BA0_PIO_VOICE_OFF_HANDLE mask 2018-12-26 15:44:15 -07:00
Jannik Vogel f94bcbacfa dsp: Support 'dec d' 2018-12-26 14:58:32 -07:00
Jannik Vogel fae1e33622 dsp: Support 'inc d' 2018-12-26 14:58:32 -07:00
Matt Borgerson 02f3b701d0 nv2a: Replace texture cache with a simpler implementation 2018-12-13 11:42:14 -07:00
Jannik Vogel 910dadc5ab nv2a: Fix window-clip region off-by-one error 2018-11-08 12:00:12 -07:00
Jannik Vogel e3d0803843 nv2a: Force GL surface transfer on surface address or pitch changes 2018-11-06 12:05:15 -07:00
Jannik Vogel 781a73e118 nv2a: Debug log GL surface transfers in GL 2018-11-06 12:05:15 -07:00
Jannik Vogel b42d49498c psh: Cleanup and dead code removal 2018-11-06 11:56:01 -07:00
Jannik Vogel 5db1694f88 psh: Rename c0 and c1 uniforms 2018-11-06 11:56:01 -07:00
Matt Borgerson d7dbfce2bc nv2a: re-enable texture caching
Texture caching (enabled via `USE_TEXTURE_CACHE` macro) got turned off
in a cleanup commit. Turn it back on for performance.
2018-11-03 15:53:02 -07:00
Lucas Eriksson 6ecac32cff eeprom: Read EEPROM from file 2018-10-10 11:40:18 -07:00
espes e12aa122cf relicense xbox components as LGPL
(with permission)
2018-10-10 13:38:16 +10:00
Stefan Schmidt 1c6bb37bec Replace ffs() calls with ctz32() 2018-10-08 11:34:23 -07:00
espes 3d33d8101b cleanup nv2a 2018-09-26 17:42:41 +08:00
espes 3ee213e59a cleanup xbox.c 2018-09-26 17:03:42 +08:00
Matt 316967c441 nv2a FIFO Refactoring (#76)
* Port espes's fifo work to the split up nv2a code

This patch ports over the following commits from the XQEMU 1.x tree
(available via tag archive-xqemu-1.x) to the refactored nv2a code:

- 4d9107e8 (HEAD -> xbox, upstream/xbox) Merge branch 'fix-fifo' into xbox
- c33f4ab2 cleanups
- d3f83d93 cleanups
- faca5dd0 fix
- 7c62d7c1 fixes
- 8ad239b0 wip
- 45ed3c31 wip
- c006d5e8 wip

However, in its current form, this patch causes some regressions and
needs further investigation.

* nv2a: basic pattern object
2018-09-26 16:10:07 +08:00
Lucas 7960ffe466 nv2a: Ptimer fixes (#113)
Set NV2A_CRYSTAL_FREQ to Retail speed
Fix ptimer_get_clock() behaviour
2018-09-26 16:01:28 +08:00
Matt Borgerson 6b21948bcc Merge branch 'master' into merge_3_0_0_sync 2018-09-05 20:07:50 -07:00
Matt Borgerson 5246cad0c1 nvnet: don't trigger interrupt if no packets are sent 2018-09-04 01:20:16 +02:00
Lucas Eriksson c01c27d968 nv2a: Fix EXP and LOG
According to the NV_vertex_program specification, our implementations of
these functions were wrong.
spec:
https://www.khronos.org/registry/OpenGL/extensions/NV/NV_vertex_program.txt
2018-09-04 01:14:55 +02:00
Matt Borgerson aa32236d5a smbus: Replace smbus_eeprom_init_single with new upstream equivalent 2018-09-02 14:14:34 -07:00
Matt Borgerson a0dad83029 nv2a: Replace QINC/DECREF macros with new inlines 2018-09-02 13:49:53 -07:00
Matt Borgerson 12401cd500 nv2a: remove global_vmstate arg in vga_common_init 2018-09-02 13:49:24 -07:00
Matt Borgerson 9c96d7bc08 sio: Use serial_hd(i) instead of serial_hds[i] 2018-09-02 13:48:02 -07:00
Matt Borgerson a0ed8d9c8b smbus: Use DeviceClass::realize instead of init
I2CSlaveClass::init removed in c8c9e10, use DeviceClass::realize
instead.
2018-09-02 13:44:07 -07:00
Jannik Vogel 92af9ca78e dsp: Implement GP memory register access 2018-07-30 12:27:15 -07:00
Jannik Vogel 2543aaf615 dsp: Fix EP memory register reads; implement writes 2018-07-30 12:27:15 -07:00
Jannik Vogel 57e9059e17 dsp: Fix broken X-Memory map 2018-07-30 12:27:15 -07:00
Matt Borgerson f169ce4c26 nv2a: Move some defs to nv2a.h and fix minor nits 2018-07-25 02:03:30 +02:00
Matt Borgerson 10b3b06320 nv2a: Fix minor prototype style issues 2018-07-25 02:03:30 +02:00
Matt Borgerson 8075a2f7ce nvnet: Fix checkpatch nits 2018-07-25 02:03:30 +02:00
Matt Borgerson f63c322740 smbus: Replace debug printf statements with macro 2018-07-25 02:03:30 +02:00
Matt Borgerson a4c9ee6b13 sio: Replace debug printf statements with macro 2018-07-25 02:03:30 +02:00
Matt Borgerson f0ea80b4bd nv2a: Use a macro to define the nv2a stub handlers 2018-07-25 02:03:30 +02:00
Matt Borgerson 7e7f837bad nv2a: Remove STUB stuff from nv2a.c 2018-07-25 02:03:30 +02:00
Matt Borgerson d53f884ec1 nv2a: Remove HACK HACK HACK code 2018-07-25 02:03:30 +02:00
Jannik Vogel 32bf810a59 xid: Improve emulation based on tests with real hardware
XID tests with a real Duke controller were done.
The results have been added to XboxDevWiki.

The behaviour documented on XboxDevWiki has then been implemented:
- XID_GET_CAPABILITIES is now supported
- Interrupt-out doesn't STALL anymore
- More accurate STALL conditions
- Packet truncation to actual length
- XID descriptor dumped from real Duke controller
2018-07-21 19:34:34 -07:00
Jannik Vogel 4ffe83b696 nv2a: Add ARL-bias to work around OpenGL float behaviour 2018-07-12 15:10:59 -07:00
Matt Borgerson 2497e2d7c4 nv2a: Add support for window clipping
Fixes several games which utilize clipping, such as Halo:CE which
uses clipping in multiplayer to render multiple player screens.

Research and original PoC work done by Jannik Vogel:
- JayFoxRox/xqemu-espes@c05d91b
- JayFoxRox/xqemu-espes@a254830
2018-07-10 01:11:05 +02:00
Jannik Vogel 67500be6e6 Add SDL flags and libs to objects which use it 2018-07-08 12:58:21 -07:00
Jannik Vogel a9db473231 Check for GL debug extensions before use 2018-07-01 14:50:50 -07:00
Jannik Vogel 0f190369d3 Switch from GLEW to epoxy 2018-07-01 14:21:53 -07:00
Matt Borgerson 0523deaa93 nv2a: Recycle FIFO command queue memory
This patch adds an additional "retired" queue in which FIFO command
entry objects are placed after execution. This queue of objects is then
returned to the pusher's new "available" queue for re-use.

This improves the performance of the system by avoiding the costly
overhead associated with the general-purpose use of `malloc` and `free`
for previous allocation of FIFO command queue objects.
2018-06-28 10:17:57 -07:00
Matt Borgerson 6eb2e9ac93 Update Xbox Makefile.objs 2018-06-26 17:07:42 -07:00
Matt Borgerson dc57d0e3c0 Add offscreen GL code 2018-06-26 17:07:41 -07:00
Matt Borgerson 584dbda1d6 Fix and refactor NV2A code
This patch does the following:
- Fixes up things for Qemu 2.x compat
- Factors out the high-level NV2A blocks into separate files
- Updates g-lru-cache for latest glib compat (github.com/chergert/glrucache@c10af24)
- Changes texture hashing algorithm from FNV to xxH v0.6.5
2018-06-26 17:07:41 -07:00
Matt Borgerson cff0d97e35 Add SDL2 gamepad based XID emulation 2018-06-26 17:07:41 -07:00
Matt Borgerson 6629cc354a Fix keyboard based XID emulation 2018-06-26 17:07:41 -07:00
Matt Borgerson 20414991be Fix Xbox ACI/APU code 2018-06-26 17:07:41 -07:00
Matt Borgerson a87f67f143 Fix Xbox SuperIO code 2018-06-26 17:07:41 -07:00
Matt Borgerson 5e1deea596 Fix Xbox ACPI code 2018-06-26 17:07:41 -07:00
Matt Borgerson fcc596cb7f Fix Xbox DSP code 2018-06-26 17:07:41 -07:00
Matt Borgerson 6f2eafa9bb Fix NVNet code 2018-06-26 17:07:41 -07:00
Matt Borgerson 65c5afbeac Fix Xbox SMBus devices 2018-06-26 17:07:41 -07:00
Matt Borgerson 3486a4f1f4 Fix basic Chihiro machine init (IDE still needs fixing) 2018-06-26 17:07:41 -07:00
Matt Borgerson 8e24af7bda Fix basic Xbox machine init 2018-06-26 17:07:41 -07:00
Matt Borgerson 3f557e6d45 Add hw/xbox sources from XQEMU 1.x @ 4d9107e 2018-06-26 15:08:01 -07:00