1 C000 4C F5 C5 JMP $C5F5 A:00 X:00 Y:00 P:24 S:FD CYC:7
2 C5F5 A2 00 LDX #$00 A:00 X:00 Y:00 P:24 S:FD CYC:10
3 C5F7 86 00 STX $00 = 00 A:00 X:00 Y:00 P:26 S:FD CYC:12
4 C5F9 86 10 STX $10 = 00 A:00 X:00 Y:00 P:26 S:FD CYC:15
5 C5FB 86 11 STX $11 = 00 A:00 X:00 Y:00 P:26 S:FD CYC:18
6 C5FD 20 2D C7 JSR $C72D A:00 X:00 Y:00 P:26 S:FD CYC:21
7 C72D EA NOP A:00 X:00 Y:00 P:26 S:FB CYC:28
8 C72E 38 SEC A:00 X:00 Y:00 P:26 S:FB CYC:30
9 C72F B0 04 BCS $C733 (?) A:00 X:00 Y:00 P:27 S:FB CYC:32
10 C735 EA NOP A:00 X:00 Y:00 P:27 S:FB CYC:35
Curious: Where did you learn how to do systems programming?I read the NESDev wiki
After that, you spend a week or so doing every opcode, and apparently the PPU is simple enough to get done quickly, then you can play Mario.
sounds fun. looks like C#, right?Yeah, that's just a big array declaration with one of the parameters being an array of delegates. I use this coding pattern a lot. C++ is used very often in emulators because people think it's faster, but that's a myth. It uses more memory and will chug if you don't know what you're doing, but with the latest .NET JIT optimizations generally any code you write will be just as fast as a compiled language. C/C++ diehards think I'm over here creating a new object to spam the GC every frame, when even amateur C# users know not to do that. Proof of that is RyuJinx, a switch emulator that (ran) as fast as the C++ Yuzu despite being written in C#.
that almost sounds not too bad except what about graphics and audio? isn't there some kind of sprite system, etc? how does that work? and how do you play 8-bit audio? maybe there are libraries for this? (I see PPU is the graphics but that doesn't sound easy).I've only been told the PPU is easy, I haven't actually gotten to it yet. So I'll do my best to explain what I know so far about those things;
Are you going to charge for it and get sued by Nintendo?Nothing I do is popular enough for that, but I hope they have the courtesy to DMCA me first at least. I don't think I will do a Patreon even if it does get popular.
C++ is used very often in emulators because people think it's faster, but that's a myth.I know what you mean yes. I usually follow the rule of thumb "premature optimization is the root of all evil". once something works, then profile it and optimize it (if necessary).
How it works is essentially this; the CPU writes values to the a certain area. The APU has some registers mapped to that area, the APU reads these values (just like parameters) and outputs sounds accordingly.I mean though that you would have to also implement the APU instructions, which would require playing 8-bit audio on a modern system, somehow. (or something, not sure). same with graphics, you will need to have a graphics library and render to a surface and present it to the screen, etc.
I know what you mean yes. I usually follow the rule of thumb "premature optimization is the root of all evil". once something works, then profile it and optimize it (if necessary).Idk if it's because C# is a higher level language but I generally write keeper code off the bat so I don't have to do it again. For the NES, I really don't have to worry about optimizations outside of obvious mistakes like looking through a big list every frame, since it's not demanding anyway.
I mean though that you would have to also implement the APU instructions, which would require playing 8-bit audio on a modern system, somehow. (or something, not sure). same with graphics, you will need to have a graphics library and render to a surface and present it to the screen, etc.I'm pretty familiar with MonoGame/Godot, and graphically I think both of those will be adequate enough to use without even writing shader code. At worst I'll have to do a palette swap shader.
I just made the repo public since it's getting some actual progress donehmm. a hobby C# NES emulator...
MNES.Core.Machine.Log
Nothing I do is popular enough for that, but I hope they have the courtesy to DMCA me first at least. I don't think I will do a Patreon even if it does get popular.You're probably safe unless you're stupid about it like Yuzu was by selling cracked copies of games. If Dolphin can keep going strong for 20+ years with barely a whiff of legal trouble you're probably fine to continue.
If Nintendo starts throwing tomahawks at random NES projects (others are first) I'll start worrying about that.
You're probably safe unless you're stupid about it like Yuzu was by selling cracked copies of games. If Dolphin can keep going strong for 20+ years with barely a whiff of legal trouble you're probably fine to continue.Yuzu didn't sell cracked copies, I think at worst some mod or developer linked to a pirated copy in their discord. They also took a settlement, which doesn't really set any precedent or even confirm they would have lost. Another thing is that they had an LLC set up, so most likely no developer is going to pay a dime.
hmm. a hobby C# NES emulator...Having had some experience developing with others on community projects, I am opposed to fork/branch spam lol. It's the real rookie mistake.
FYI I will be strongly tempted to contribute, or at least make suggestions, though I have very little time and energy, and I'm not terribly familiar with the etiquette of coding with others.
(I think I slightly overdid it the last time, but I'm not sure what to avoid or not avoid. maybe I should just work on a fork that I keep updated and not worry about merging my changes into yours.) (last time I was relatively new to git but have been using it quite a while now.) (due to the limited time and energy I may not be able to do much even if I want to.)
Seem to be missing types in the namespaceYeah any namespace issues you describe are accidental on my end.MNES.Core.Machine.Log
Nullable disabled in MNES.Core?
Are you ok with file-scoped namespaces?
do you have any particular coding conventions that I should adhere to such as braces, etc? (I will try to use 4 spaces though I am used to 3)
let me know if I'm too annoying (as soon as there's a second dev things get a lot more complicated so if it's too much definitely let me know and I'll just work separately)
00000000_00000000_00000000_00000000_00000000_00000000_00000000_00000001 true
00000000_00000000_00000000_00000000_00000000_00000000_00000000_00000001 true
00000000_00000000_00000000_00000000_00000000_00000000_00000000_00000001 true
00000000_00000000_00000000_00000000_11111111_11111111_11111111_11111111 0xffffffff
00000000_00000000_00000000_00000000_11111111_11111111_11111111_11111111 0xffffffff
00000000_00000000_00000000_00000000_11111111_11111111_11111111_11111111 0xffffffff
I've mostly stuck to the formatting that you used last time since I really liked your style of fitting as much stuff on the screen as possible.that's kind of it yeah; it's that you should justify usage of vertical space. sometimes using more vertical space is ok to keep things readable, but sometimes things can be compressed and still be quite readable and maintainable. and some people do things that waste vertical space not realizing how much that hurts readability. but there is a middle-ground somewhere.
Forks are for entirely new repositories that are not meant to merge again.hmm, I sort of know what you mean, a real "fork" is meant to permanently diverge.
Size of a single Single in bytes is 4.
Size of a single Double in bytes is 8.
Size of a single Boolean in bytes is 4.
An array of type Single of size 5 takes up 20 bytes.
An array of type Double of size 5 takes up 40 bytes.
An array of type Boolean of size 5 takes up 5 bytes.
I don't think what you've said about floats and bools is correct. floats are 4 bytes/32 bits. doubles are 8 bytes/64 bits.Hmm, ok, that probably checks out, but I'll have to look into it later. I hope you're at least a little bit impressed by my habit of assuming everyone else is wrong about something basic except me (I swear it's not an ego thing). "I'm not wrong the compiler is" syndrome.
bools are in many places 4 bytes/32 bits, except in arrays they are 1 byte (each).
I don't have a hexdump of memory to confirm this, but some quick tests do seem to confirm it: https://ideone.com/4ELLjh
hmm, I sort of know what you mean, a real "fork" is meant to permanently diverge.Yeah forks are necessary if you don't have permission, if you accept the organization invite you should be able to push directly to the repo. Then you can ask for forgiveness and not permission.
but from my past understanding the last time I used github to contribute it is necessary to work on a fork, I think. I fork your repo (on github) and then I clone my fork. I keep my fork updated against yours, and I keep my local PC updated against my fork. I then push to my fork (since I have write access to it and not yours) and then I make a pull request to your repo from my fork. (I don't think you can make a pull request from CLI git? or maybe you can? in that case I don't know why I'd use a fork then. (didn't get it to work))
the "fork" in this case is just a temporary place to give me write access to github and a place on github from which to send a pull request.
let me know if I have a part of this wrong.
I will try to do something simple today and you can reject it if it's not working for you.
And it's so optimized already, it only uses 1.5 GB of memory!
Is it ready to play the shitty NES games I own on Steam?The only real compatibility issue is that NES cartridges all used different mappers, some of them literally added hardware to the NES. That game used MMC3, which is one of the easier ones to do.
just like GooglePlay, so you know that's qualityYes, time to slap 50 ads and trackers on it and send it to the play store. You consent to being tracked, right ?
You consent to being tracked, right?