Emulating a BBC Micro in Javascript

  Рет қаралды 5,527

Matt Godbolt

Matt Godbolt

Күн бұрын

Пікірлер
@lickers1
@lickers1 5 жыл бұрын
Great video. Never thought I would learn more about the architecture some 30 years later via an emulator!
@stalepalemale
@stalepalemale 9 жыл бұрын
incredible piece of work!
@MattGodbolt
@MattGodbolt 9 жыл бұрын
+Jake Draper Many thanks!
@erikpiehl1764
@erikpiehl1764 9 жыл бұрын
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.
@MattGodbolt
@MattGodbolt 9 жыл бұрын
+Erik Piehl Thanks! If you have any questions, don't hesitate to ask :)
@erikpiehl1764
@erikpiehl1764 9 жыл бұрын
+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...
@MattGodbolt
@MattGodbolt 9 жыл бұрын
+Erik Piehl Hahah that's fantastic!
@DaveJeffery
@DaveJeffery 9 жыл бұрын
Wonderful presentation - I really enjoyed watching it, and I learned a huge amount. Many thanks for uploading it.
@DudeOfSlam
@DudeOfSlam 5 жыл бұрын
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.
@sassquadsteve
@sassquadsteve 9 жыл бұрын
My brain hurt after the first 10-15 minutes :-) Thanks for putting this video online Matt.
@MattGodbolt
@MattGodbolt 9 жыл бұрын
Stephen Scott You're so welcome! Sorry I made your brain hurt, but hopefully there was enough non-migraine-inducing stuff there to entertain!
@JasonSobell
@JasonSobell 5 жыл бұрын
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.
@MattGodbolt
@MattGodbolt 5 жыл бұрын
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!
@MattGodbolt
@MattGodbolt 5 жыл бұрын
I say clarifying...thanks for correcting me more like!
@JasonSobell
@JasonSobell 5 жыл бұрын
@@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!
@NickEnchev
@NickEnchev 5 жыл бұрын
Matt puts the God in Godbolt.
@simont936
@simont936 4 жыл бұрын
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.
@youreale
@youreale 8 жыл бұрын
it was great, thank you man!
@KevinEdwardsRetro
@KevinEdwardsRetro 5 жыл бұрын
If only I had a debugger like that BITD!
@endofthelinejoel
@endofthelinejoel 3 жыл бұрын
you are a genius !
@MattGodbolt
@MattGodbolt 3 жыл бұрын
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!
Emulating a 6502 system in JavaScript • Matt Godbolt • GOTO 2016
45:23
Retro Tea Break | Steve Furber on Acorn Computers and the BBC Micro
1:05:38
It’s all not real
00:15
V.A. show / Магика
Рет қаралды 20 МЛН
How to treat Acne💉
00:31
ISSEI / いっせい
Рет қаралды 108 МЛН
The Dome Paradox: A Loophole in Newton's Laws
22:59
Up and Atom
Рет қаралды 298 М.
This open problem taught me what topology is
27:26
3Blue1Brown
Рет қаралды 527 М.
Python laid waste to my C++!
17:18
Sheafification of G
Рет қаралды 160 М.
Five things you didn't realise your CPU did for you
11:13
Matt Godbolt
Рет қаралды 31 М.
Miracle - a JavaScript Sega Master System Emulator
47:20
Matt Godbolt
Рет қаралды 4,9 М.
Acorn Archimedes - A Technical Introduction -  1987 BBC VHS Video
26:32
The Centre for Computing History
Рет қаралды 57 М.
Wolfenstein 3D's map renderer
14:49
Matt Godbolt
Рет қаралды 276 М.
Emulating a CPU in C++ (6502)
52:28
Dave Poo
Рет қаралды 1 МЛН
It’s all not real
00:15
V.A. show / Магика
Рет қаралды 20 МЛН