Great video. Never thought I would learn more about the architecture some 30 years later via an emulator!
@stalepalemale9 жыл бұрын
incredible piece of work!
@MattGodbolt9 жыл бұрын
+Jake Draper Many thanks!
@erikpiehl17649 жыл бұрын
Really cool presentation! I just loved the anecdotes! Very nice to watch something real for a change, true expertise here - on the BBC Micro, 6502 and Javascript. Especially the code transforming [from 6502 instructions to Javascript] was very nice indeed.
@MattGodbolt9 жыл бұрын
+Erik Piehl Thanks! If you have any questions, don't hesitate to ask :)
@erikpiehl17649 жыл бұрын
+Matt Godbolt Thanks, will keep that in mind :) As a C/C++ and assembler programmer (from Z80 and 6502 to DSPs to x86) I've been waiting for a suitable project to get started with Javascript, and this may just have been the inspiration to get something done :) It's quite on the other end of the spectrum though - quite literally - I recently implemented an FPGA version of ZX Spectrum...
@MattGodbolt9 жыл бұрын
+Erik Piehl Hahah that's fantastic!
@DaveJeffery9 жыл бұрын
Wonderful presentation - I really enjoyed watching it, and I learned a huge amount. Many thanks for uploading it.
@DudeOfSlam5 жыл бұрын
Love your stuff in general. The only complaint I have for this video is the sound level. This might only be a problem since I watched it on a bus ride. Keep up the good work.
@sassquadsteve9 жыл бұрын
My brain hurt after the first 10-15 minutes :-) Thanks for putting this video online Matt.
@MattGodbolt9 жыл бұрын
Stephen Scott You're so welcome! Sorry I made your brain hurt, but hopefully there was enough non-migraine-inducing stuff there to entertain!
@JasonSobell5 жыл бұрын
Elite didn't switch between 2 and 4 colour modes, it just looked like that. It was actually drawing the whole screen in 4 colour Mode 5, and using the video ULA to switch the old drawn lines to black and the newly drawn lines to white in the top half to give a new 'frame' and avoid flickering, then it switched all four colours visible for the bottom half. I guess if you disable the colour change mode in your ULA code you'll see it doing it's switching :) I used the same colour switching in Future Shock to make the eyes at the top change colour because I had to use Mode 5 so I had the extra 10K to memory to load all the sprites into RAM :) I'm going to have to look at your code here. It's an awesome job you've done! Did you emulate the 'secret' opcodes too? If you have issues with some games it may be related to those, as many of us used them for a tiny performance optimisation.
@MattGodbolt5 жыл бұрын
Thanks for clarifying! I had been thinking about this recently, as it happens... Can't believe I hadn't realised. Yes, all the undefined opcodes are handled too, along with their timings!
@MattGodbolt5 жыл бұрын
I say clarifying...thanks for correcting me more like!
@JasonSobell5 жыл бұрын
@@MattGodbolt More revealing than correcting :) I was amazed by the smoothness of the 3D process at the time so looked to see how they achieved it. Your emulator runs all the games I wrote in the 80's (or at least those I can find!) and brings back many happy memories. Really nice work!
@NickEnchev5 жыл бұрын
Matt puts the God in Godbolt.
@simont9364 жыл бұрын
From an Atari 8-bit fanatic.... I really enjoyed watching your talk but I think it is misnamed. It is really, "how to make a BBC Micro emulator". Similar problems - perhaps more - with timing and DMA exist with the Atari, with Pokey (sound and serial chip) and Antic and GTIA barging into the processor. I wrote one demo which worked very smoothly on the PAL Ataris in the UK/Europe at 50Hz and 1.79Mhz clock, but not in the US at 60Hz and 3Mhz, that in theory those were synced to the screen refresh rate but in practice my code was about seventeen cycles too long to update each cycle in the US, which I found out by Ye Olde Dialle-Up Modemme BBS that we used to run. A couple of years ago I was working on a STAR embedded processor which is rather schizophrenic about being 8 or 16 bit but was quite clearly a dressed-up 6502. 64k of addressable RAM, and paging to get to extra RAM so that a bit like the 8080 you could do "long" addressing but don't you dare, because if you got a context switch at that point then some other task will be looking at the wrong page... it did have a MUL and DIV instruction I think, but quite often you don't need them. You can implement the Liang-Bargsky line clipping algorithm, or for that matter the parametric equation for drawing a line, without any multiplication or division (and subtraction only in the guise of comparison). It really is quite worrying how people who grew up with floating-point arithmetic on the chip can't understand either that itself, or that most of the time you don't need it anyway and can do it all in fixed point... You're incorrect in a couple of places, that you have instructions INX and INY which I believe do actually go through the ALU, yet for A register you have to do ADC #0 or ADC #1 to get the same thing, there is no INC A. (If you're clever, and I was like an optimizing compiler here, you could prove that at that point in the code "carry" would be clear or set, and avoid the extra cycle of doing CLC or SEC). It was really interesting hearing you talk about needing to emulate the exact cycles - and some indirect instructions particularly LDA (pppp),Y can take 6 or 7 depending on whether pppp jumps a page boundary. Some of my demos for the Atari 8-bit are around online, WRITTEN on the Atari, are around online, but unfortunately not the best ones. These are written in assembly and were done to demonstrate to my club members various graphics tricks - they are not particularly interesting in themselves. Best wishes S.
@youreale8 жыл бұрын
it was great, thank you man!
@KevinEdwardsRetro5 жыл бұрын
If only I had a debugger like that BITD!
@endofthelinejoel3 жыл бұрын
you are a genius !
@MattGodbolt3 жыл бұрын
That's lovely of you to say but the real geniuses are those that made the original system; and the emulators I then based mine in!