Пікірлер
@rohithbhandari7836
@rohithbhandari7836 5 күн бұрын
I dont really understand why there is CPUcopy ?
@GeorgeGeorgievCA
@GeorgeGeorgievCA 10 күн бұрын
You should probably include a note that 0xFFFC is not where the PC is set at reset but rather where the PC is loaded from. Of course, this would make you first implement "Load PC from memory" fuction, rather that LDA ;)
@kimo3813
@kimo3813 17 күн бұрын
I really cant get the googletest working. I ran into so many errors such as gtest file not found, g++ compiler wrong version etc etc, to the point where I have no idea what Im doing. do you have any tips? I am using vscode
@axelandru9346
@axelandru9346 Ай бұрын
@arham9006
@arham9006 2 ай бұрын
this what rosetta on mac m1 do ? to make app competible with intel proc ?
@zx81alive65
@zx81alive65 2 ай бұрын
27:38 i always write it just for visual/mental "symmetry", but the break at the end of the switch statement is not required. ;-)
@automan1223
@automan1223 2 ай бұрын
First code I wrote before basic was in my electronics class on an Rockwell AIM 6502 computer. Circa 1983 or so. Then we took that code we learned & adapted small electronics packages we built and engineered to the computer to measure temperature, windspeed, solar outputs. etc. Best classes in my school memory....
@MasteringWoodwinds
@MasteringWoodwinds 2 ай бұрын
Apologies if this is a noob-ish question, but when you debug at 29:34, is it an extension that you're using to see all of that extra information including the memory browser? I had a quick look around and didn't see one that looks like yours. Awesome video, I'm having a lot of fun following along!
@smallcube-zn2mm
@smallcube-zn2mm 2 ай бұрын
Maybe a hex editor but I also can't find what editor he used
@djchrisi
@djchrisi 2 ай бұрын
There is a nice little trick in Visual Studio. If you put memory.Data+0xff,10 in the watch window it will display the array with an offset of 0xff with 10 items.
@domenicosorrentino1972
@domenicosorrentino1972 2 ай бұрын
hi, i'm trying to install but i get error 21 in Cmake -> googletest failed. could you please address me for a solution? thx
@rogerfroud300
@rogerfroud300 2 ай бұрын
This is an easy and fun way to get a handle on how microprocessors work. There were no books on the Motorola 6800 except for the one intended for computer specialists when I started. I must have read that book twenty times before I had a clue what it was talking about. No hobby machines existed, and I was a Mechanical Engineer with a final year Degree project to control a machine using a D2 Evaluation Kit. To say it was a struggle would be a hell of an understatement. With no assembler, the opcodes had to be looked up and entered using a Hex keypad using a debug monitor program. A hard way to learn, but something you never forget. You guys have it so easy!
@patty1991
@patty1991 2 ай бұрын
You emulate CPUs In c++ I write on my app in C and SDL2 "Electronic-Circruit" SIMULATOR But with photorea graphic .. its an endless Job Class😂...[i]... * 500 times
@Nick-ui9dr
@Nick-ui9dr 3 ай бұрын
Ok how about writing one for Modern intel 11th gen processor? 😀
@jpdj2715
@jpdj2715 3 ай бұрын
In 1990 and later, I used "SoftPC AT" on the Mac. It emulated an IBM PC-AT and was more compatible with IBM's standard (while virtual) than IBM's physical PC-AT. IIRC it implemented a virtual machine that seemed like an exact Intel 8086 (16 bits), and it had an interface layer mimicking motherboard, BIOS and interface connections. This ran on the Mac's processors of the time by Motorola with a larger instruction set and some more complex instructions than Intel's processors. There was absolutely no 1:1 pass through of binary code between OS/applications and hardware.
@mytube001
@mytube001 3 ай бұрын
So, this video is a logical simulation/emulation of a 6502. I would like to see a simulation of the actual, physical hardware, with bits of code that represent the transistors and their interconnectedness.
@LunaticEdit
@LunaticEdit 3 ай бұрын
For anyone coming here later, there's no way this function will work correctly as written. You have to read the first operand byte, push the highword of PC, push low word of PC, then read the second operand byte. While what this guy has works 95% of the time, it's not 100% accurate and WILL fail Tom Harte's unit tests for some of the edge cases.
@realhaidinh
@realhaidinh 3 ай бұрын
i have a question, when we create two timer, the counter timer is 2 but the first counter timer handle is still 1, so we can't get the time remaining of the first time handle right?
@ImaginationToForm
@ImaginationToForm 3 ай бұрын
Pretty cool to see. I had a C64 back when I was a kid.
@rhtcguru
@rhtcguru 3 ай бұрын
This is still one of the best ways to learn how to embed Lua that I can find. Excellent series. However, a caution to those watching. In the parts where he is setting up global tables and metatables, he duplicates the table on the stack and doesn't pop it in the end. Likewise, he doesn't clean up the metatable on the stack either. For small programs, you won't notice any issues; however, as your project scales this will cause many problems and the symptoms won't be easy to diagnose. In general, when you are setting up globals on the stack, you want to make sure you leave the stack in the state you started. Hope this helps someone out there.
@michaelhalpern8167
@michaelhalpern8167 4 ай бұрын
You should try it in veilog like my INTO TO COMPUTER ORGANIZATION CLASSES final we also wrote a whole assembly language and designed a memory hierarchy
@hedgehogform
@hedgehogform 4 ай бұрын
Can you make an i9 9900k emulator so I don't have to buy the cpu? Thanks!
@WeirdDuck781
@WeirdDuck781 4 ай бұрын
I recommend any enthusiasts to check the game "Turing Complete" It's not only a puzzle but also a sandbox where you can mess with your own architectures and program for them. You can technically even make a compiler and a language to interface with your creations in the sandbox since you can load your PC files into the sandbox. Have fun!
@user-ym3mo9bd9h
@user-ym3mo9bd9h 4 ай бұрын
BASIC THEORY CODE OF EMULATOR
@alk3myst
@alk3myst 4 ай бұрын
I have no need for this, but I can't stop watching these videos. My dad brought home an Apple //e in 1983 with a Grappler+, Apple DMP, Midi card, dual disks, Kensington System Saver :), modem and more. Lots of Beagle Bros software including a copy of their Peek and Pokes chart. :)
@enverhaase8562
@enverhaase8562 4 ай бұрын
6:52 "ähm, wo war ich?" ? As in "where was I", but in German?!?!
@fullstackcoder1234
@fullstackcoder1234 5 ай бұрын
Do you have a discord server or account?
@damiandamiann509
@damiandamiann509 5 ай бұрын
cw wystarczy napisac struct
@SaraMorgan-ym6ue
@SaraMorgan-ym6ue 5 ай бұрын
emulate why on earth would you want to when you can just make a new 6502 system from scratch or buy a premade 6502 system like the commander x16?🤔
@albertkennis
@albertkennis 5 ай бұрын
Very clear and educational, thanks!
@jkobain
@jkobain 5 ай бұрын
These videos don't have a fancy intro/outro, they span for hours, the guy doesn't play a video game or set up pranks. Yet, it is enjoyable to watch.
@calinculianu
@calinculianu 5 ай бұрын
Learn about ranged for-loops. They work on C-like arrays too. E.g. `for (auto & c : data) c = 0;`
@calinculianu
@calinculianu 5 ай бұрын
Nit: Use C++ headers and not C headers. Also use <cstdint> and uint16_t, etc. Also for the love of God, man.. write c'tors to things. :)
@EricPham-gr8pg
@EricPham-gr8pg 5 ай бұрын
Or can we write emulator to link microcontrol link device hardwares then software cpu is quite good and convenient
@EricPham-gr8pg
@EricPham-gr8pg 5 ай бұрын
But what processor we use on to write emulator is import because it need to know directives before emulator could work..could we write emulator on parallax bs2 stamp?
@jkobain
@jkobain 5 ай бұрын
How it sounds in the background: - _Why register… Why register? Why register?…_ Because *TAX,* of course! ;D
@diskoboi3342
@diskoboi3342 5 ай бұрын
This is really cool, I've always wondered how to write something like this. Now I know where to start! Thanks :)
@Malcrom1967
@Malcrom1967 5 ай бұрын
This has gone off the rails. You added all the instructions in a blast last video where you concentrated on google test and now you write the code for the stuff you blasted through?
@Tapajara
@Tapajara 5 ай бұрын
I don't get why so many are enamored by the 6502. Once you had enough money for a good processor like the Z80 or 6800, you don't need one of those old things any more.
@ricardos.6198
@ricardos.6198 5 ай бұрын
Good strategy!!! fine!
@DamianReloaded
@DamianReloaded 5 ай бұрын
I just profiled this and doing this string comparison for member access is twice as slow as having a table and accessing the property as a function. (using luajit in release mode). Not worth it imho. my2c
@DamianReloaded
@DamianReloaded 6 ай бұрын
This is fantastic. Thank you for putting this up. Important to note that getglobal pushes the user data onto the stack and if this call to getglobal was inadvertently inside a loop without calling lua_pop(L,1); at the end of each iteration it would cause a stack overflow. my2c
@chitlitlah
@chitlitlah 6 ай бұрын
Long ago, I wrote a Z80 emulator in x86 assembly. That's a good way to gain a thorough understanding of two different processors at once. I did it a lot like you did in this video but I put the more commonly used opcodes near the top so the emulator wouldn't have to do as many checks on average as it went through the list. I've since wondered if it would've been faster to check the opcode one bit at a time, thus guaranteeing that there are eight comparisons per opcode rather than fewer comparisons for common opcodes but over a hundred comparisons for rare ones. (Unlike with the 6502, Z80 opcodes aren't all 8-bit, but you get the point hopefully.) Or maybe there's an in-between solution that's ideal. I'm glad you have more of these videos so I can see how you do it. The eventual goal was to make a Sega Master System emulator, but I realized I was in over my head. Emulating the processor seems pretty easy compared to emulating a graphics adapter that's totally different than the machine on which you're running your emulator. Old games would often be timed to the h-sync and v-sync signals from the CRT, which don't exist on modern computers, and sometimes the program would write to the background color register just as the electron beam was at a certain horizontal position on the screen to make the background more than one color. How do you get your emulator to realize the background color was changed when the hypothetical electron beam was halfway across the screen, so the left half needs to be one color and the right half needs to be the other color? Things like that are why it's really hard to make an emulator that works with all software.
@jkobain
@jkobain 6 ай бұрын
FFS, I just clicked the second episode, and YT suggests me #35 in this series. Eyyy, it appears to be quite a journey.
@user-ip3rg1qq9i
@user-ip3rg1qq9i 6 ай бұрын
Please don't use a switch statement for the machine code instruction. Use a function pointer array
@orsteinnkristjansson5315
@orsteinnkristjansson5315 6 ай бұрын
Regarding the conflicting Documentation on RTI and the Break Bit, After RTI is called the Break Bit should always be 0, it should however not be cleared by the RTI command. The code that handles the interrupt should clear it before calling RTI (If its 1 when RTI is called you have an improperly handled Interrupt aka irql_not_less_or_equal)
@ignacionr
@ignacionr 6 ай бұрын
Great video, but the stack is 8 bit and you need to know that typically a stack is used backwards.
@astemet
@astemet 6 ай бұрын
Yea, you will learn alot sbout that cpu doing that
@PeterRichardsandYoureNot
@PeterRichardsandYoureNot 6 ай бұрын
This project was done by another gentlemen on his channel where he wrote a 6502 emulator in JavaScript including the ability to load the Apple ][e ROM which then full emulated an Apple ][e as well as AppleSoft basic. I don’t know if he finished the firmware for the disk i/o emulator or mother peripherals as the original Apple,][ boards used add in cards for I/o, sound, etc.
@CrazyBloo
@CrazyBloo 6 ай бұрын
for anyone trying this out and using Rider instead of Visual Studio, I was having a lot of trouble getting gtests setup how I wanted, but it turns out Rider actually uses GTests by default instead of microsoft's unit test library, all you have to do is create new project -> 'Unit Test Project' and GTests is already setup for you
@viktorhugo8252
@viktorhugo8252 6 ай бұрын
This is a very good project. sometimes it is easier taking the real CPU for old programs. if you have the sources you can translate it for another processor. for demonstrate the OP-codes it will help to understand the executions. for exact timing and small interrupt routines you can’t fix this without a lot of work around. take the old 6502 if this is fast enough, or take the 65816 to solve your software problem. dissembling the old code on any machine is much easier as simulate the original mnemonics to emulate and executing a real 40 years old program.