summaryrefslogtreecommitdiff
path: root/sys/src/games
AgeCommit message (Collapse)Author
2023-03-21v8e: clean unused argument and tidy usage (thanks mkf)Jacob Moody
2023-03-05/sys/src/games/^(aout2gba gba/rom): basic gba toolkitJacob Moody
2023-02-28games/dmid: fix running status for streamsqwx
regression from previous commits; better handling
2023-02-24games/gb: crude serial port emulationJacob Moody
Timing is not as good as it needs to be, but servicable in more forgiving scenarios. Clock drift between two paired systems sits around 8 - 32 cycles when tested locally.
2023-02-11games/gb: implement internal window line counterJacob Moody
The y offset used for windows is not based on LY but another internal window counter that is incremented alongside LY but only when the window is on screen. This fixes an issue with the dmg-acid2 and cgb-acid2 test roms. https://github.com/mattcurrie/dmg-acid2 https://gbdev.io/pandocs/Tile_Maps.html#window
2023-01-26games/wadfs: parse hexen map behavior lumpJacob Moody
2023-01-22games/dmid: no longer threadedqwx
2023-01-21games/dmid: update for opl3 streamingqwx
2023-01-21games/opl3: implement real time streaming modeqwx
this pushes all responsibility for timing to opl3, absolving dmid(1) and other writers from constantly sending sync events to force opl3 to synthesize audio in between events. it reduces cpu usage and syscalls dramatically and enables applications other than dmid(1) to modify its state in real time, for instance to use it as a synth.
2023-01-15games/dmid: simplify and reuse input code for streamingqwx
2023-01-15games/dmid: add control 00h, bank selectqwx
akai mpk mini 2 and similar midi pianos: this is a nice way to select opl3 banks 0-127 using a knob, while the pads are mapped to percussions on channel 9
2023-01-15games/dmid: properly skip delay field from streamqwx
2023-01-12games/midi: fix desyncs after tempo changes in multitrack filesqwx
same as 89c60481afd8307f7825281bd561995f83a7bfb2.
2023-01-11games/dmid: fix tempo changes causing desyncs in multitrack filesqwx
if tempo changes while older events are in flight at different timings in a multitrack file, and since there's no compensation for it, tracks desyncronise, the order of events get jumbled up and everything just falls apart. rather than doing dances with the old code to figure out what corrective factor to apply and where, just use the simplest and most robust way, advance one tic at a time. also add a tracing mode and don't always print useless and annoying warnings.
2022-09-18games/dmid: don't buffer outputqwx
fixes streaming, doesn't really affect performance elsewhere
2022-08-22games/doom: raise static limitsqwx
makes very large/detailed maps work; raising max intercepts and spechits may break demos and cause desynchronizations, so they're left alone despite their potential issues; savegame buffer overflows can happen for stupidly huge maps with tons of entities
2022-08-22games/doom: fix glitchy mouse movementqwx
use all mouse deltas during a tic instead of just the last one, to prevent extremely annoying stutters and jumps in mouse movement; adjust filtering/sensitivity, without additional knobs
2022-08-22games/doom: raise max scale factor for 4kqwx
side-bonus: fullscreen 1920x1200 working perfectly on t61p :)
2022-08-22games/doom: rename mouse use key for what it is and remove double clickqwx
one can still play with just the mouse via m_forward, there's no longer any need for a button to move forward
2022-08-22games/doom: add optional autorunqwx
2022-08-19games/doom: add "m_forward" cvar to disable vertical motion move; actually ↵Sigrid Solveig Haflínudóttir
implement use_mouse
2022-03-18games/gb: minor style fixesMichael Forney
2022-03-18games/gb: various RTC fixesMichael Forney
MBC3 write switches on a>>13, so the RTC register is 5 (0xA000-0xBFFF). Mask off upper bits of DH register when updating the timer. Only the lowest bit is part of the day counter. Use uint for x in timerforward() so that we don't set negative values for timer registers if it happens to overflow. Update timer and then latch rather than the other way around. Otherwise, timer remains static and will overflow after 512 days.
2022-02-10gba: fix flash chip id for 128k and add settingqwx
Some gba cartridges use flash chips produced by a few different manufacturers for backup memory. A game rom may then try to read the device id for its flash chip and break if it's the wrong one. There's no way for us to know which chip is supposed to be there, save for looking it up in some database. These chips are either 64k or 128k big. gba(1) hardcodes the id for the SST 64k chip, but games like the Pokémon ones use a 128k Macronix chip and expect a different id, completely breaking them. This patch sets a different default for 128k flash backups, and gives the ability to set the exact type when creating the save file if it's really necessary. This new default fixes the Pokémons. The type is saved in the save file, but this will *not* break existing ones. It may be that we don't need to worry about the type and just have an id that corresponds to the right chip size, which is why these defaults make sense, but I haven't tested more than a dozen roms, mostly since I don't really know which games use 128k flash.
2021-09-01add joy(1): joystick script for all emulators, and docsqwx
remove old /sys/src/games/nes/joynes in favor of joy(1). joy(1) has more buttons for the other emulators; there is no longer a significance in the order of the keys. document nusb/joy, add information in each emulator manpage.
2021-08-26bring games/swar from 1ed sources.rodri
2021-05-05games/opl3: use correct sampling rateqwx
games/dmid uses the same sample rate as the chip for music, but other applications do not. opl3 and its older version opl2 (not in 9front) read an input stream of commands in basically IMF format, something used in other id Software games and some others, which assumes a given input sampling rate: 700 Hz for Wolfenstein 3D music, 560 Hz for Commander Keen, 60 Hz for Ultima 6, etc. The opl3 emulation on the other hand is not really intended to run at a sampling rate different that the chip's 49.716 kHz sampling rate. Previously, we assumed it runs at 44.1 kHz and just used the input rate as a divisor to get the number of samples per delay tic. From what I understand, the correct way to use it for accurate emulation is to run the opl chip emulator at its intended sampling frequency, then downsample to 44.1 kHz. This means better output but more code. The alternative is to basically do the same as before rev 8433, except with no buffering, but at accuracy/quality loss. This change implements the former and just forks pcmconv to deal with resampling.
2021-04-27games/opl3: don't buffer output and simplify (thanks umbraticus)qwx
this fixes real-time applications. -n previously specified a rate divisor rather than the rate itself, which was used for specific applications outside of 9front. instead, just set the rate directly, more useful and straightforward.
2021-04-13remove juke (use play or zuke instead)Sigrid
2021-04-02games/glendy: your complication had a complication (god damn it kemal)cinap_lenrek
2021-04-02games/glendy: don't use lucida sans in menus by default and bugfix (thanks ↵cinap_lenrek
kemal) i have found one bug. when i put glenda in a position like this i somehow win, but the glenda can escape from there. in addition, i have changed the games manpage to include more info about glendy.
2021-02-22games/snes: use 4-point hermite interpolation to resampleMichael Forney
This is noticeably better than nearest-neighbor.
2021-02-17games/snes: use enum constants KON and ENDX instead of their valuesMichael Forney
2021-02-17games/snes: implement DSP echoMichael Forney
2021-02-17games/snes: implement DSP noiseMichael Forney
I'm not sure if this LFSR is the same one used by the hardware or is arbitrary, but it matches the noise sequence used by all other snes emulators I looked at.
2021-02-17games/snes: fix BRR decoding with filters 2 and 3Michael Forney
s1 and s2 should store the last and next to last output, but were set in the wrong order, causing them both to be the last output. This breaks filters 2 and 3, which both utilize s2.
2021-02-08games/gb: fix reversed audio channelsMichael Forney
The high bits correspond to the left channel, and the low bits to the right channel. Reference: https://gbdev.io/pandocs/#sound-control-registers Tested with pokemon crystal.
2021-02-08games/gb: various HDMA fixesMichael Forney
H-blank DMA should only transfer 16 bytes per h-blank, rather than waiting for the first h-blank and then transferring the whole size. HDMAC should read 0xff when the transfer is finished, and 0 in the high bit when the transfer is ongoing. Also, if 0 is written in the high bit, the current transfer should be aborted. Introduce two flags, DMAREADY and DMAHBLANK rather than special constants 1 and -1. If dma is non-zero, there is an ongoing DMA. If DMAREADY is set, the next chunk is ready to transfer. Reference: https://gbdev.io/pandocs/#ff55-hdma5-cgb-mode-only-new-dma-length-mode-start Tested with pokemon crystal. What was happening is that when the game was loading N background tiles into vram (each 16 bytes, so one per h-blank), it did something like this: - start an hdma transfer for N+1 tiles - after the Nth tile is transferred, it would read HDMA5, clear the high bit, then write it back to abort the transfer. games/gb would instead transfer all N+1 tiles at once, overwriting one extra tile with whatever was 1 past the end of the source array, and then would interpret the cancel request as the start of a new transfer of 16 bytes, which would copy an additional tile past the end. The end result is that every transfer would end up copying N+2 tiles instead of just N, overwriting certain tiles with whatever was after the end of the source data.
2021-02-08games/gb: fix timer divider for input clock 0Michael Forney
According to [0], input clock 0 should divide by 1024=2¹⁰, not 2¹². This caused audio to run at quarter-speed in one game I tried. [0] https://gbdev.io/pandocs/#ff07-tac-timer-control-r-w Tested with zelda: oracle of seasons, and dr. mario ---
2020-11-28games/mix: fix decoding of shift instructionsAlex Musolino
2020-11-28games/mix: fix SLAX and SRAX instructions (thanks nicolagi)Alex Musolino
MIX shift instructions shift by bytes not bits.
2020-11-27games/mix: fix implementation of MOVE instruction (thanks nicolagi)Alex Musolino
Plan 9 memcpy(2) uses the same implementation as memmove(2) to handle overlapping ranges. Hovewer, the MIX MOVE instruction, as described in TAOCP, specifically does not do this. It copies words one at a time starting from the lowest address. This change also expands the address validation to check that all addresses within the source and destination ranges are valid before proceeding.
2020-10-15games/nes: workaround for truncated chrSigrid
2020-09-13games/4s: increase thread size (thanks majiru)Ori Bernstein
It seems like on amd64, we're overflowing the stack. Let's not do that.
2020-05-02make bind(2) error handling consistentcinap_lenrek
The mount() and bind() syscalls return -1 on error, and the mountid sequence number on success. The manpage states that the mountid sequence number is a positive integer, but the kernels implementation currently uses a unsigned 32-bit integer and does not guarantee that the mountid will not become negative. Most code just cares about the error, so test for the -1 error value only.
2020-03-08games/playlistfs: open /proc/n/ctl OWRITE, not ORDWRcinap_lenrek
2020-01-22add v8eaiju
2019-11-03games/turtle: do exit instead of crash in redraw() when there where no lines ↵cinap_lenrek
drawn
2019-11-03add games/linden and turtle to mkfileaiju
2019-11-03add games/linden and games/turtleaiju