6502ts / 6502.ts Goto Github PK
View Code? Open in Web Editor NEWEmulators for MOS 6502 based systems written in TypeScript
License: MIT License
Emulators for MOS 6502 based systems written in TypeScript
License: MIT License
Experimentating shows that the bottleneck on mobile is keeping up with 60 FPS --- worker messages start piling up, leading to slowdowns. This might be related to vsync and might also impair desktop class machines with vsync enabled.
Implementing a frameskip option would ameliorate this and allow for full speed emulation on the faster range of ARM devices. However, the implementation is not entirely straightworkward as the skipped frames must be merged in order to play well with sprite flickering.
Necessary steps:
Support DPC audio after finishing #44 .
Stella's new-sound branch contains a low level simulation of TIA audio generation written by Chris Brenner. This could be ported and adapted once we have #44 done.
The current scheduler is parameterized with a fixed number of cycles and works with variable timings. In order to do #44 we need the opposite: a scheduler that keeps emulation time ahead of wall clock time by a defined margin (otherwise, the audio buffer will underrun).
This is basically a copy of the exact same issue from Stella: stella-emu/stella#104. I've decided to put it off until I get to the new sound core, as you probably will as well. But the symptoms are the same in Stella and Stellerator (background hum), which are not present in other emulators tested (MAME, javatari, z26, etc).
Investigate the usage of third-party ARM emulation code for supporting ARM functionality in DPC+. Withhout digging deeper, two options come to mind:
The CPU currently lacks support for undocumented opcodes. This keeps some games (especially) homebrew from running.
Refactor Stellerator in preparation for adding more options and UI features.
Store all known gamepad IDs and mappings in indexedDB, allow customization in settings.
Support DPC+ ROMs, minus the VCS / ARM bridge stuff.
Reset is currently broken. Emulation restarts and runs, but no frames are generated (audio is OK though).
Frame detection currently ignores vsync and is solely based on vblank. This affects display in a numbe of games:
In it's current incarnation, the CPU does not emulate memory access correctly. In particular, several writes / reads can happen in a single cycle. The most importand cases are treated correctly (loads and stores happen in the last cycle), but some VCS ROMs are glitched (most prominently Pole Position).
Fixing this will require to turn each instruction into a full state machine. As a first step, it would be enough to turn address decoding into state machines, fully implement the most critical instructions (JSR, RTS, PHA, PHP, etc.) and wrap the others.
Provide a standalone desktop app via electron.
In Chrome 59 (and possibly higher), deactivating the frame limiter stalls the event loop and leaves the emulation unresponsive.
Undefined reads (e.g.undefined TIA registers) currently yield zero. This prevents Haunted House from running. Random values (cf. #10) should do the trick.
It should be possible to disable paddles in config. This currently causes Thrust controls to go crazy.
In a handful of games, minor horizontal positioning issues remain:
This is a tracking ticket for games with known issues.
Safaris indexedDB implementation is known to be badly broken -> fix by selectively enabling a shim in safari.
SWCHB can actually be used to store a small amount of data, as illustrated in the following:
http://atariage.com/forums/topic/167678-strange-color-problem-with-stella/page-2#entry2075671
This is already emulated in Stella some time ago. In my testing, only MAME emulates this; z26, javatari and Stellerator don't. I think it's actually used in Combat too, so it's not just an idiosyncrasy of the hardware that nobody uses.
You'll know if it works when you see the display cycling through the contents of ZP RAM, starting from $FF and going downward. When not implemented, the ZP RAM address stays at $FF (which makes sense, as the counter used the ROM is stored in SWCHB).
Needs #44.
The current audio implementation drives the WebAudio synth API. While this is very robust and well adapted to the timing issues present in the web environment, it is not accurate enough for PCM via bitbanging (Quadrun, DPC, ...).
For this, we need an alternate audio endpoint / driver combo that generates and plays PCM frames.
The current implementation of line caching will skip rendering, but all other TIA logic still executes. This can be improved by skipping all logic and fast-forwarding the emulation if the cache is flushed.
Initial state should be initialized with a seeded random number generator, the seed should be part of the config. This currently prevents games from generating random state :)
Random initial state causes Dark Chambers to fail, depending on seed.
I don't know how easy/possible this is, but would it be possible to have software volume control in Stellerator. Currently, every time I test a ROM, the windows in the house shake, since the volume is top high ๐
Apologies if this is already possible. In that case, please advise on how to use it.
Remaining issues in xayax bang! demo:
The correct logic is implemented in stella.
The new image processing pipeline would allow to run a much more sophisticated emulation of phosphor effects than the current, shader-based hack. Of course, a better shader would be welcome, too ๐
"src/machine/stella/cartridge/CartridgeFE.ts(110,13): error TS6133: '_cpu' is declared but its value is never read."
It looks like you are preparing for release, so there might be a unexpected change, or the repo isn't ready now. I looked at repo and it looks like you are refactoring.
I followed the instructions and grunt fails on "ts:main" task:
(main) umeboshi@bard:~/workspace/others/6502.ts$ grunt initial
Running "notify_hooks" task
Running "clean:base" (clean) task
>> 2 paths cleaned.
Running "clean:mrproper" (clean) task
>> 1 path cleaned.
Running "copy:install" (copy) task
Copied 4 files
Running "exec:tslint" (exec) task
Running "ts:main" (ts) task
Compiling...
Using tsc v2.6.2
src/machine/stella/cartridge/CartridgeFE.ts(110,13): error TS6133: '_cpu' is declared but its value is never read.
>> 1 non-emit-preventing type warning
>> Error: tsc return code: 2
Warning: Task "ts:main" failed. Use --force to continue.
Aborted due to warnings.
I am using node v6:
(main) umeboshi@bard:~/workspace/others/6502.ts$ node -v
v6.12.1
(main) umeboshi@bard:~/workspace/others/6502.ts$ npm version
{ '6502.ts': '0.0.0',
npm: '5.6.0',
ares: '1.10.1-DEV',
http_parser: '2.7.0',
icu: '58.2',
modules: '48',
node: '6.12.1',
openssl: '1.0.2m',
uv: '1.15.0',
v8: '5.1.281.109',
zlib: '1.2.11' }
Since you are refactoring, I decided to test the github.io branch:
(main) umeboshi@bard:~/workspace/others/6502.ts$ git checkout github.io
Branch github.io set up to track remote branch github.io from origin.
Switched to a new branch 'github.io'
(main) umeboshi@bard:~/workspace/others/6502.ts$ npm install
npm WARN [email protected] No repository field.
npm WARN [email protected] No license field.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
removed 50 packages in 22.449s
(main) umeboshi@bard:~/workspace/others/6502.ts$ grunt initial
Running "notify_hooks" task
Running "clean:base" (clean) task
>> 0 paths cleaned.
Running "clean:mrproper" (clean) task
>> 0 paths cleaned.
Running "copy:install" (copy) task
Copied 4 files
Running "exec:tslint" (exec) task
Running "ts:main" (ts) task
Compiling...
Using tsc v2.6.2
src/machine/stella/cartridge/CartridgeFE.ts(110,13): error TS6133: '_cpu' is declared but its value is never read.
>> 1 non-emit-preventing type warning
>> Error: tsc return code: 2
Warning: Task "ts:main" failed. Use --force to continue.
Aborted due to warnings.
Stellerator should sport a reset button on the emulation page.
Complete both masked and unmasked interrupt handling.
Adapt Klaus Dormann's testsuite.
Provide machine events (register writes, frame start etc.) as breakpoints. Will greatly simplify debugging.
Several timer-related bugs are described on (AtariAge)[http://atariage.com/forums/topic/259633-testing-the-new-stella-tia-core/].
Does it run in edge?
This comes with several benefits:
As you know, we often test ROMs in Stella and Stellerator, and when uploading the ROMs to git, they need to be zipped. Stella already supports loading zipped ROMs; it would be much easier if Stellerator did too.
No homebrew bankswitching schemes are currently supported.
The "Toyshop Trouble" PAL60 rom has just been posted on AA (http://atariage.com/forums/topic/273291-pal-version-of-toyshop-trouble/#entry3916621) and I noticed that stellerator doesn't support its bankswitching scheme (0840).
I don't know of other games utilizing that (The NTSC rom that was released a few years ago uses the classic F8 scheme)
Here are some info:
http://atariage.com/forums/blog/142/entry-2282-econobanking/
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.