Assembly Programming & Colour – Computerphile

Assembly Programming & Colour – Computerphile


So I’ve been creating a brand new game for the SEGA Mega Drive I’m using original development hardware from the nineties I’m also running a small set of tutorials on to how I got it running in the first place. Today we’re gonna turn the screen red, but that’s easier said than done so bear with me, there’s a lot to explain.

100 thoughts to “Assembly Programming & Colour – Computerphile”

  1. Matt — don't waste your time mate, not many will be about to enjoy your hard worked efforts. Save the world doing something else. Like writing the game for PICO-8.

  2. I always remember flicking the switch on my Genesis and seeing that first flicker of initilization just before the SEGA logo would pop up. Now I know why. Thanks!

  3. This brings back memories.
    He is a better man than me.
    I don't see myself deliberately going back to old CPUs and using Assembler.
    Good luck.

  4. As a developer currently using Unity all I want to comment is: "Jesus….! I have it easy these days."
    Add UI Image/Sprite. Use the color picker to whatever I want. Hit play and done. Ha.

  5. You should hook this guy up with the GameHut channel.
    He's an ex megadrive programmer showing all the tips and tricks and how-to's under the hood for the official megadrive games he and the team at Traveller's Tales made.

  6. Good job leaving the 'cut this out' bits in, Brady – it made me smile. Plus it's interesting to see what he's doing anyway. 🙂

  7. I once took a class that had us build a MIPS-type CPU in VHDL. When the whole thing was done, you could run little assembly programs on it, which was just mind blowing to me. You really had to fiddle with everything kind of like this, because it also obviously didn't have an OS to help you with memory, etc. In a weird way, its all way simpler than you think and waaay more complex at the same time.

  8. more actual programming vids like this please. i like the theory videos but we want more code writing.

  9. Ah yes, the good old DOS debug. Never used it on a Sega, but I sure as hell learned to do assembler on an X86 Intel chip with it, in '95.
    Now show us edlin. There's something I haven't seen in 25 years or so, for which I'm grateful…. All the modern day people who hate vi and emacs, you want to see a REAL primitive editor, go check out edlin from about 1980 ~ '85…. Nothing you will ever see on Linux or any other semi-modern system, is as primitive and useless, as edlin…. It does work, and it uses up about 50 bytes of ram. Yes bytes, not kilobytes… No, it's not easy to use. It makes vi look like the whole M$ Office suite….

  10. I wrote a bit of open source stuff for the Atari ST in the 80s. The 1040st at the time didn't have a clock chip, meaning you had to set the clock every time you booted up. I wrote a 68000 assembly app to dial out to the Naval Observatory which had (still has?) a dedicated line outputting the current time in julian date format. My program captured that string, and set the time. Setting the time had to be done bit by bit. It was a great exercise.

    Now I develop in .NET and have no clue how the machine works anymore. lol. But I also don't spend 2 days trying to the set the datetime, so there are tradeoffs!

  11. I only just learned the basics to motorla 68k assembly last semester so this was a bit tough to follow (why divide by 2?) but was very interesting!

  12. I really want to get started with assembly language. I have an Arduino with sensors, motors, wires etc

  13. Im making a game in assembly for a school project and i have no idea how the hell can i detect collision by using only whole numbers😕

  14. there's a great feeling of freedom when coding this way for a system you become deeply in-tune with. no messy API red tape to deal with.

  15. Are you guys giving this guy the money for these videos? He deserves it. Maybe should set up his own channel!

  16. I'm glad Matt finally became a programmer. A man such as himself had no place on a whaling ship, due to him having women's hands.

  17. I work in real estate. Why am I up late watching videos about programming game graphics in assembly? Damn youtube rabbit holes.

  18. 0x0EEE, why is EEE the highest values for RGB here? Wouldn't FFF (making it 0x0FFF) be the highest values in hexadecimal?

    Edit: answered in video literally three seconds after I posted. 😑

  19. "The two hardest problems in computer science are naming things, cache invalidation, and off-by-one errors" (with apologies to Phil Karlton)

  20. A "background" color leads me to believe there are "layers". But isn't there only one level of VRAM? This would also mean there is a color in the palette for transparency, to allow the background to show through. I guess I'm not understanding why the red is showing when the VRAM is set to display black (from the palette) on every pixel.

    Thanks,
    Marcus

  21. 2 adresses to talk to the chip. Oh VDC, you were not alone in your persuit to screw with peoples sanity 🙂
    Jokes aside, i loved my C-128D. An 6502 clone and a Z-80, 2 seperate video chips (VIC, VDC)
    I don't know… the (almost) limitless power of modern computers killed off my wish to mess with them.
    There is no challenge with timings, cycle counting, interrupts and so on anymore for me.
    If something does not work just stick a bigger chip in it.
    I think it was the limits of my commodore… i had to push them.
    No limits… no pushing anymore.

    I think i will pickup uC coding again. See what stupid things i can make a 328 do 🙂

  22. Silly question but I'm curious… why does the Mega Drive's VDP chip have 4 unused registers? I know it was based on one of their arcade boards during development, would it have something to do with being a less powerful derivative with fewer functions?

  23. This is real programming, Machine/Assembly coding, none of this slow language compiling code, C++ or Java, Great Stuff.
    Loved the video :o)

  24. Why is 0xFFFF 64KB. To me this is the max value for an int (in 64bit C). Is this because it's a different system/language?

  25. I wonder how long it would take to make a modern game purely in assembly … like seriously just pure assembly.
    Also in the future we will either program with our thoughts or AIs will do the programming for us.

  26. I wonder what the equivalent number of lines of assembly source would be for the average game nowadays. Amazing how there's so much involved in doing something so simple!

  27. 20 years ago, I wrote a blaster game in assembly. It was CGA. I was so proud of myself. My parents always wonder why I always look at my computer screen and worry I will be socially dysfunctional.

  28. I know this probably has to do with recording a monitor, the way different cultures see and assign color, or both, but that's orange, not red. 😛

  29. I used to code 68000 assembly for Amiga demos ~30 years ago. It's amazing how much I forgot. I never used macros, and I think I didn't even use constants that much, certainly not for addresses.
    Not sure if i wanted to learn it again. But the video certainly pulled back nice memories. Thanks!

  30. I barely understand what he's explaining (I think) and I don't know any programming language at the moment, but I still find this interesting to watch.

  31. so sexy lanugage for me
    not necessery to learn
    it wont be useful for me or anyone
    but ı gotta learn it
    why ?
    because I just love hard things

  32. Prof. Brailsford (of computerphile) would call m68k-assembler High Level. As he would say, any REAL programmer use 5 hole paper tape and a needle.

  33. I've done some 6800 but never any 68000… that's quite a fascinating assembler…. all that move.b and move.w is kinda unusual.

Leave a Reply

Your email address will not be published. Required fields are marked *