Assembly Programming & Colour - Computerphile

แชร์
ฝัง
  • เผยแพร่เมื่อ 24 ส.ค. 2024
  • The simple task of turning a screen red takes on new complications when you have no graphics libraries and no drivers - Assembly coding for the Sega Megadrive/Genesis with Matt Phillips.
    EXTRA BITS: • EXTRA BITS: Using Macr...
    Matt's previous assembly programming video: • Game Physics (in Assem...
    More info on Matt's Project: www.tanglewoodg...
    Eternal thanks to the National Videogame Arcade in Nottingham for hosting us! bit.ly/Computer...
    / computerphile
    / computer_phile
    This video was filmed and edited by Sean Riley.
    Computer Science at the University of Nottingham: bit.ly/nottsco...
    Computerphile is a sister project to Brady Haran's Numberphile. More at www.bradyharan.com

ความคิดเห็น • 428

  • @killfalcon
    @killfalcon 6 ปีที่แล้ว +71

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

    • @MaxAbramson3
      @MaxAbramson3 6 หลายเดือนก่อน +1

      0, 1, 2...
      Yup, story checks out.
      I have 0 problem with starting evert court at 0.

    • @killfalcon
      @killfalcon 6 หลายเดือนก่อน

      You gotta be consistent, though, or that's where the problems start.

    • @MaxAbramson3
      @MaxAbramson3 6 หลายเดือนก่อน

      @@killfalcon Yo, I got 99 problems and a buffer overflow ain't one.

  • @harrysvensson2610
    @harrysvensson2610 6 ปีที่แล้ว +251

    5:53
    Matt:"boring bit, boring bit, boring bit, cut this out, cut this out, cut this out"
    Sean: "Nah man, screw you, I find this interesting! I won't cut this out!!!!!!!!!"

  • @amihartz
    @amihartz 6 ปีที่แล้ว +117

    I love seeing assembly code. I wrote a graphics driver for the TI-84+CSE in Z80 Assembly. There was no software-level stuff for graphics in the slightest nor was there a GPU. You had to directly write bits to the input pins of the LCD controller chip (ILI9335). The Z80 assembly chip only could address at maximum 16-bit values, this means that you couldn't even control the entire screen at one time. Instead the chip supported a "window" feature where you give it coordinates and a width and height and it gives you control of a little portion of the screen called a "window". You could use this to draw sprites by selecting the coordinates and width and height of where you wanted the sprite to be and then outputing all the pixels of the sprite into the window. I've never seen anyone use an actual GPU tho through assembly so this is definitely pretty interesting, figuring out how to use a GPU is hard enough as it is in C lol.

    • @BertGrink
      @BertGrink 6 ปีที่แล้ว

      Is that feature shared between all the Z80-based calculators from TI?

    • @amihartz
      @amihartz 6 ปีที่แล้ว +6

      +BertyFromDK
      No. The original TI-84+ and the Silver Edition (2004) have monochrome 96x64 displays. 16-bits is enough to map them to RAM, so you don't have to control the LCD controller directly (although it's possible if you want). The TI-84+CE (2015, the most recent one) upgraded the processor from a Z80 to an eZ80 chip which has 24-bit registers so it can support much more RAM and can map the video memory to RAM. It's only the TI-84+CSE (2013) specifically that you need to control the chip directly because it has a color screen but does not have the upgraded eZ80 processor.

    • @BertGrink
      @BertGrink 6 ปีที่แล้ว +3

      amihart
      Wow, i didn't know there are now color versions of the TI-84!
      All i have is a TI-85 and a TI-86, but the TI-84 color sounds very intriguing, i may have to get me one of those :D

    • @amihartz
      @amihartz 6 ปีที่แล้ว +5

      +BertyFromDK
      I find them interesting to program for because to my knowledge they're the only modern computers that still use Z80 CPUs, and again to my knowledge the TI-84+CE is the only computer on the market that runs the upgraded eZ80 processor.

  • @Discount_Friendly
    @Discount_Friendly 6 ปีที่แล้ว +33

    13:32 “fingers crossed it should be red” *press keyboard, screen goes orange “there we go”

    • @Seiseary
      @Seiseary 3 ปีที่แล้ว

      xD

    • @Mizu2023
      @Mizu2023 2 ปีที่แล้ว

      maybe the given light is just too bright that it made the image more green

  • @noxabellus
    @noxabellus 6 ปีที่แล้ว +152

    "Wait have I just debugged it?"
    - Me every day

  • @Elios0000
    @Elios0000 6 ปีที่แล้ว +97

    MORE OF THIS PLEASE

  • @tonybobay6276
    @tonybobay6276 6 ปีที่แล้ว +32

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

    • @tertrih9078
      @tertrih9078 6 ปีที่แล้ว +3

      That's what makes youtube awesome :D

    • @goeiecool9999
      @goeiecool9999 6 ปีที่แล้ว +10

      _It's free real estate_

  • @willsi
    @willsi 6 ปีที่แล้ว +39

    Love this assembly series.

  • @LumiLumi1300
    @LumiLumi1300 5 ปีที่แล้ว +3

    Bruh how is this dude so chill? He’s a good teacher too.

  • @jaredmaxwell2678
    @jaredmaxwell2678 6 ปีที่แล้ว +23

    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!

  • @Nebuloa305
    @Nebuloa305 6 ปีที่แล้ว +49

    This guy is totally to the METAL! more videos with megadrive guy pls! :)

  • @crazieeez
    @crazieeez 5 ปีที่แล้ว +4

    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.

  • @robertkraus357
    @robertkraus357 6 ปีที่แล้ว +129

    Once the hard work's done...the hard work's done

    • @cheaterman49
      @cheaterman49 6 ปีที่แล้ว +30

      The first rule of the tautology club is the first rule of the tautology club. :-)

    • @alswo9628
      @alswo9628 6 ปีที่แล้ว +3

      Rejoice! /r/tautology is a thing

    • @ChrisLeeW00
      @ChrisLeeW00 6 ปีที่แล้ว +28

      If (hardwork == done)
      hardwork = done;

    • @TheRealFaceyNeck
      @TheRealFaceyNeck 6 ปีที่แล้ว

      while hardwork == done :
      hardwork += done

    • @NoNameAtAll2
      @NoNameAtAll2 6 ปีที่แล้ว +1

      Facey Neck
      That will add value of done and might stop the function
      While (hard work == done) {
      hard work = hard work;
      hard work = done;
      }

  • @StreuB1
    @StreuB1 6 ปีที่แล้ว +19

    These vid's are fantastic. The end bit was the perfect ending as well lol

  • @Decco6306
    @Decco6306 3 ปีที่แล้ว +4

    Sega: "hah you will never guess the security pass code to make ROMs!"
    Coder from 2018: "Its just 'SEGA' isn't it?"
    *Sega would like to know your location*

  • @segmentkings
    @segmentkings 5 ปีที่แล้ว +2

    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!

  • @goeiecool9999
    @goeiecool9999 6 ปีที่แล้ว +79

    The assembly looks pretty clean compared to what I'm used to from Z80 or 6502.

    • @cheaterman49
      @cheaterman49 6 ปีที่แล้ว +3

      Is that really what m68k assembly looked like? It feels "modern" compared to what I remember of it.

    • @goeiecool9999
      @goeiecool9999 6 ปีที่แล้ว +1

      I'm not sure. I was particularly surprised seeing the LEA instruction. Maybe it's some trickery handled by the assembler.

    • @mdmenzel
      @mdmenzel 6 ปีที่แล้ว +1

      goeiecool9999 yeah, I remember seeing a colleague's senior-level compiler writing project that targeted 6502 assembly and it didn't seem elegant at all to work with by comparison.

    • @meirnl
      @meirnl 6 ปีที่แล้ว +1

      Could indead be some trickery by the assembler. Wouldn't be suprised if some assemblers are able to 'simulate' the behaviour and just replace it with a specific set of instructions for the architecture.

    • @BertGrink
      @BertGrink 6 ปีที่แล้ว +12

      The 68K CPU and support chips had an almost perfectly orthogonal programming model which gives the code a much cleaner look compared with what Z80 and 6502 code looks like.
      In this context, being orthogonal means that you can (theoreticaly) apply any desired addressing mode to any of the user registers.

  • @kasuma377
    @kasuma377 6 ปีที่แล้ว +32

    Assembly; always fun.

  • @MrTridac
    @MrTridac 6 ปีที่แล้ว +46

    The dreaded off-by-one error. Been there. A lot ...

    • @quintrankid8045
      @quintrankid8045 6 ปีที่แล้ว +29

      There are two major problems in computer programming.
      1) Handling cache.
      2) Naming things.
      3) Off by one errors.

    • @Dawwwg
      @Dawwwg 6 ปีที่แล้ว +10

      What about buffer-overflows?PhLULZX5LULZXACBKJI
      root@localhost: ~$

    • @quintrankid8045
      @quintrankid8045 4 ปีที่แล้ว +1

      @Evi1M4chine There are 10 kinds of people in the world. Those who understand binary and those who don't.

    • @Robstafarian
      @Robstafarian 4 ปีที่แล้ว +2

      @@quintrankid8045 0x10 year olds should not be allowed to drive.

  • @strummerrr
    @strummerrr 6 ปีที่แล้ว +85

    Just use MS Paint and the bucket tool

  • @bardfinn
    @bardfinn 6 ปีที่แล้ว +6

    Hey, kids: If you're working in Assembly, are doing the memory management & code optimisation yourself, have an inner loop that gets called a lot, that is always going to have the same number of iterations, and you have the memory to hold the code, consider unrolling your loops; It might save you the overhead of the code for alloc'ing and handling and dealloc'ing for a loop.

    • @bardfinn
      @bardfinn 6 ปีที่แล้ว +1

      But YMMV.

    • @Dawwwg
      @Dawwwg 6 ปีที่แล้ว +2

      Even Java 8 still has newly introduced loop-unroll optimizations ... also: don't call subs in a tight timing loop, but inline it instead (could be a macro)

  • @ayushsharma9270
    @ayushsharma9270 6 ปีที่แล้ว +11

    I absolutely love assembly.

    • @shayan_ecksdee
      @shayan_ecksdee 6 ปีที่แล้ว +3

      Assembly is the biggest horror for dumbasses like me :(

    • @darjiaethera
      @darjiaethera 6 ปีที่แล้ว +3

      Same! I get this little thrill when I can make the mental connection to what exactly what the hardware is doing with the code. I don't get the same feeling from higher level languages because its too abstracted for me to really see it.

  • @mdmenzel
    @mdmenzel 6 ปีที่แล้ว +3

    I remember doing this kind of graphics assembly programming 13 years ago with an Atari ST. Good memories, a lot of fun.

  • @nqinadlamini
    @nqinadlamini 6 ปีที่แล้ว

    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.

  • @tycoinreno
    @tycoinreno 6 ปีที่แล้ว +7

    You need to get this guy in contact with the person running the GameHut channel; that would be a great collaboration :D

    • @SapphFire
      @SapphFire 5 ปีที่แล้ว

      I think he said that he has worked at Travelers Tales so they probably know each other.
      And yes that'd be great if it happened!

  • @marcovpv
    @marcovpv 6 ปีที่แล้ว +7

    How the hell did Chris Sawyer write the whole of RollerCoaster Tycoon in assembly

  • @erikhicks07
    @erikhicks07 6 ปีที่แล้ว

    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.

  • @digitalzoul57
    @digitalzoul57 3 ปีที่แล้ว

    A lot of work for changing the background screen, really appreciate it.

  • @Methodenlehre
    @Methodenlehre 6 ปีที่แล้ว +1

    Man, how far we've come.

    • @thorham1346
      @thorham1346 6 ปีที่แล้ว +1

      Not as far as you think, unfortunately.

  • @darjiaethera
    @darjiaethera 6 ปีที่แล้ว

    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.

  • @cnewtonc
    @cnewtonc 4 ปีที่แล้ว

    68000 was the best Assembler Language Ever. I miss it so much. I use to program Graphics in Assembler on the Atari ST decades ago. Loved that machine.

  • @rodolfonavarrete7362
    @rodolfonavarrete7362 5 ปีที่แล้ว +1

    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.

  • @nerkec603
    @nerkec603 3 ปีที่แล้ว +1

    It's insane to think this is how people used to program, mind blowingly awesome...

    • @MrEmiosk
      @MrEmiosk 2 ปีที่แล้ว +1

      Look up stuff on the altair 8800, the first PC. Then stare in confused wonder at how far we have come.

  • @AZOffRoadster
    @AZOffRoadster 3 ปีที่แล้ว

    Writing device drivers is where the fun is.

  • @NNNNTE
    @NNNNTE 6 ปีที่แล้ว +11

    digging the winston t-shirt

  • @justinmdominiak
    @justinmdominiak 6 ปีที่แล้ว

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

  • @ijabbott63
    @ijabbott63 6 ปีที่แล้ว +7

    There is an off-by-one error in your VRAM clearing loop.

  • @brotherlui5956
    @brotherlui5956 6 ปีที่แล้ว +12

    30 years ago i wrote motorola 68000 assembly programs on the Atari ST computers

    • @markdavies794
      @markdavies794 6 ปีที่แล้ว

      Me too!

    •  4 ปีที่แล้ว

      Nice one! I did the same on the same CPU inside the Amiga. Those were the days...no internet, few docs & examples. You needed a high level of raw natural talent to succeed in games programming. I wonder how things would be today if the internet stopped working.

  • @Ribby00
    @Ribby00 6 ปีที่แล้ว

    Alright, this was incredible. I'd like to see more of this guy!

  • @tertrih9078
    @tertrih9078 6 ปีที่แล้ว

    Sean is learning a lot of programming. So much that he could help debug the program :D

  • @valentinsteam
    @valentinsteam 4 ปีที่แล้ว +2

    The fact he's using a Razer Krait from 2006.

  • @nO_d3N1AL
    @nO_d3N1AL 6 ปีที่แล้ว

    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!

  • @MrAlFuture
    @MrAlFuture 6 ปีที่แล้ว +1

    This is a great series. Thank you!

  • @redaxxx
    @redaxxx 6 ปีที่แล้ว +221

    Notepad++ best IDE for assembly

    • @osemudiame123
      @osemudiame123 6 ปีที่แล้ว +3

      redaxxx really?

    • @meirnl
      @meirnl 6 ปีที่แล้ว +28

      Probably not, but I bet there is nothing comparable/better which is compatible and still downloadable for Windows 95/98

    • @BertGrink
      @BertGrink 6 ปีที่แล้ว +14

      IDE??? really? i thought Notepad++ was an editor that you could combine with other elements such as a compiler or assembler to form a complete programming environment.

    • @TheTrueShadowphoenix
      @TheTrueShadowphoenix 6 ปีที่แล้ว +48

      Vim exists

    • @theobserver7217
      @theobserver7217 6 ปีที่แล้ว +5

      I use visual studio

  • @seasong7655
    @seasong7655 6 ปีที่แล้ว +309

    so glad they invented high level languages 😂😂😂

    • @lzhedmitriy2719
      @lzhedmitriy2719 6 ปีที่แล้ว +6

      He IS programming in a high level language. It's called C++.

    • @meisterlumpi7822
      @meisterlumpi7822 6 ปีที่แล้ว +124

      Lzhe Dmitriy where did you see any C++ in this video??

    • @meirnl
      @meirnl 6 ปีที่แล้ว +53

      It's assembly. C++ is still quite low level, but definitely not as hard as assembly which is shown in this video.

    • @BertGrink
      @BertGrink 6 ปีที่แล้ว +22

      I think Assembly programming is more fun, but that's just me i guess ;)

    • @Dojan5
      @Dojan5 6 ปีที่แล้ว +38

      Well yeah, it's not like assembly is unimportant nowadays. Higher level languages were really just invented to make programming easier, and faster. By the time someone finished working on a program in assembly, the person working in a higher level language would've completed their program and iterated upon it several times.

  • @JoeBetro
    @JoeBetro 5 ปีที่แล้ว +1

    Genius at work. Absolutely blowing my mind! 🤯

  • @DaVince21
    @DaVince21 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. :)

  • @retrobeastgames
    @retrobeastgames 6 ปีที่แล้ว +1

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

    • @justinhughes7483
      @justinhughes7483 6 ปีที่แล้ว +3

      Real programmers program using hardware! None of this garbage machine code/assembly

    • @RussellTeapot
      @RussellTeapot 5 ปีที่แล้ว +2

      @@justinhughes7483 real programmers bitbang electric signal directly into the bus

  • @dariofabijancic9863
    @dariofabijancic9863 6 ปีที่แล้ว

    This is so awesome, keep up with the assembly language videos, I wouldn't mind to get to know about other assembly languages.

  • @uberDoward
    @uberDoward 6 ปีที่แล้ว +7

    REAL SOFTWARE ENGINEERING. *thumbsup*

  • @IllumTheMessage
    @IllumTheMessage 6 ปีที่แล้ว

    Love the old school stuff. Great vid guys.

  • @dankeroner
    @dankeroner ปีที่แล้ว

    Stunning, this channel is a godsend, thank you so very much.

  • @sabriath
    @sabriath 6 ปีที่แล้ว

    Brings back the days when writing drivers was cool.

  • @aaronkeith5714
    @aaronkeith5714 5 ปีที่แล้ว

    I love the use of tractor-feed paper

  • @RyanFaeScotland
    @RyanFaeScotland 6 ปีที่แล้ว +1

    In case anyone misses it there is an extra video on what macros are mentioned in the description. Here is the link so you don't even have to look: EXTRA BITS: th-cam.com/video/vRni1-KY0MQ/w-d-xo.html
    Great video again Matt, thanks for sharing.

  • @vjself
    @vjself 2 ปีที่แล้ว

    This dude is fantastic and an awesome teacher.

  • @fran12659
    @fran12659 6 ปีที่แล้ว +2

    awesome to see some assembly language programming

  • @brianmac8260
    @brianmac8260 5 ปีที่แล้ว

    Matt, more assembly please!

  • @markantony7413
    @markantony7413 5 ปีที่แล้ว

    More of this please!!!

  • @jawprince7720
    @jawprince7720 6 ปีที่แล้ว +1

    How many years of experience so I need to actually understand a word of what this man is saying

    • @__________________________4597
      @__________________________4597 6 ปีที่แล้ว +2

      about a month should be fine.

    • @spht9ng
      @spht9ng 2 ปีที่แล้ว

      You just need to read MrJester's 68k Assembly guide. Should take maybe a couple weeks of practice.

  • @RalphBarbagallo
    @RalphBarbagallo 6 ปีที่แล้ว +1

    So funny because the 68000 was a BREEZE to code for compared to previous CPUs. But I’m sooooo glad I don’t have to write games in assembler anymore.

  • @frognik79
    @frognik79 6 ปีที่แล้ว

    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.

  • @michalhikrysz
    @michalhikrysz 6 ปีที่แล้ว +12

    Cool video, however while clearing the VRAM you should loop from 0x7fff (0x10000/2 - 1) to 0, not from 0xffff/2-1, which is 0x7ffe.

    • @BertGrink
      @BertGrink 6 ปีที่แล้ว +3

      Yeah i found his technique somewhat odd as well. I assumed he did the final operation immediately after the loop finished.

    • @NaturalTangent
      @NaturalTangent 6 ปีที่แล้ว +5

      68000 dbra loops terminate when the counter reaches -1 rather than 0.

    • @petros_adamopoulos
      @petros_adamopoulos 6 ปีที่แล้ว

      Natural Tangent The value used in the video is (0xFFFF/2)-1 which evaluates to 32766, correct me if I'm wrong.
      So, how many times will the loop execute? (we need 32768 times)

    • @dipi71
      @dipi71 6 ปีที่แล้ว +2

      Also: keep in mind that 0xFFFF is already one less than 65536 (64 »Kibibyte«); off-by-two error, anyone?

  • @pras4499
    @pras4499 6 ปีที่แล้ว

    i love the way he explain assembly language

  • @qwertyasdf7615
    @qwertyasdf7615 6 ปีที่แล้ว +18

    vimy vim vim

    • @Tinnur_
      @Tinnur_ 6 ปีที่แล้ว +5

      Top tier taste
      :wq

    • @alcesmir
      @alcesmir 6 ปีที่แล้ว +2

      :wq is a waste, use ZZ

    • @npc6924
      @npc6924 6 ปีที่แล้ว +6

      How do I leave this comment?

    • @RussellTeapot
      @RussellTeapot 5 ปีที่แล้ว +1

      @@npc6924 please, read the manual entry for it :help comment

  • @gabrielfrank2878
    @gabrielfrank2878 5 ปีที่แล้ว +1

    Cool vid! Gotta Bit' Em All!

  • @damejelyas
    @damejelyas 6 ปีที่แล้ว +1

    congratulation for 1M

  • @AstAMoore
    @AstAMoore 6 ปีที่แล้ว +3

    Pfft. Sixteen-bit consoles with loads of RAM and a dedicated GPU. The ZX Spectrum is where it’s all at. :D

  • @ct92404
    @ct92404 6 ปีที่แล้ว

    Holy cow, you'd need superhuman patience and dedication to work with this. No thank you! I'll stick to writing my little programs in BASIC.

  • @WolfClant
    @WolfClant ปีที่แล้ว +1

    dude looks like what hollywood thinks hackers look like

  • @Nathan00at78Uuiu
    @Nathan00at78Uuiu 7 หลายเดือนก่อน

    Always trust a man who uses the work 'bespoke'.

  • @Abby_Liu
    @Abby_Liu 6 ปีที่แล้ว +1

    distracted by that godly tattoo the whole video time to go back and watch again

  • @Evanski
    @Evanski 5 ปีที่แล้ว

    Imagine if we were still using
    BASIC or Assembly
    Today to make triple A games

  • @KuraIthys
    @KuraIthys 6 ปีที่แล้ว +1

    I dunno. I found the process of creating a small program that turns the screen purple on a SNES pretty straightforward.
    And I had no assembler to work with, just a hex editor and an emulator with a debugging feature.
    Had to write out the code, manually convert it to hexadecimal (you do NOT wanna code jump instructions manually, believe me. Especially not relative jumps).
    OK, granted there were about 80 instructions worth of initialisation code (most of which is just used to set initial values in VRAM and various registers), and then it took about 3 instructions to set a background colour.
    That sounds like a lot of work, and of course, the highly manual method I was using made it more difficult than it should've been, but frankly, doing the equivalent using DirectX, the windows Api and all of that stuff was an order of magnitude more work than doing it 'bare metal' on a SNES...
    So in all honesty... Meh.
    I mean, in creating DirectX code I had to perform manual RGB conversions, deal with palettes, VRAM pitch and stride, manually setting each and every pixel. (because there is no 'background' in a DirectDraw surface - just some virtual VRAM)
    It's a lot more work than the assembly code on a 16 bit console ever was...

    • @KuraIthys
      @KuraIthys 6 ปีที่แล้ว

      Having said that, from looking at your code it seems as though the Mega Drive's VDP has an extra layer to it that's a bit annoying; Having to write to a port to access VDP registers sounds like a pain;
      SNES PPU registers are mapped into the CPU's address space at 0x2100. While there are ports for VRAM, CGRAM and OBJ attribute memory, all other registers are mapped directly into this address space.
      - The Audio data ports are also mapped in this range.
      (you also find some stuff mapped at 0x4200 - these registers are all CPU extensions. Features that the 65816 CPU core itself lacks, such as multiply/divide hardware, timers, DMA control registers, game controller registers, etc.
      The SNES of course has two address buses, bus A and bus B. Everything is on bus A, but bus B is effectively an alias for all the stuff that is mapped at 0x2100 to 0x21FF
      The DMA controller works by transferring data from a Bus A address to a Bus B address, or vice versa.
      Anyway, the point of this being that for the vast majority of features, dealing with these registers is no different to simply reading or writing to any memory location.
      It's not a complex task at all.
      Writing to VRAM (or CGRAM) presents an extra step in that you have to specify a starting address, but from there it auto-increments, so it's only if you need to do complex out of order VRAM access that it gets a little messy.
      Only OAM presents a complication, and only in that you have to write 544 bytes, and the data for a single sprite is broken between 2 bytes in one part of OAM and an additional 2 bits in the last 32 bytes of OAM.
      That's a bit of a pain. (but with careful planning writing to the upper 32 bytes of OAM is only needed on rare occasions, since it contains the OBJ size bit, and the high bit of the x-coordinate - which only needs to change if the object goes off the left edge of the screen.)
      Kind of ironic the Mega Drive would add an extra layer of complication, since as a general rule the Mega Drive's VDP seems less capable but more consistent and orthogonal. - the SNES PPU has a bunch of features and capabilities the VDP does not, but you can't use them in arbitrary combinations. It depends on which modes and settings you have enabled.
      The VDP lets you throw together basically any feature it has in any combination.
      Sprites on the VDP are also more flexible, since you can have any sprite be any size from 8x8 to 32x32, including stuff like 32x8, and each sprite can be it's own size - SNES sprites can be 8x8 to 64x64, but must always be square. Additionally only two sizes can be active at once. Eg, 8x8 + 64x64, or 16x16+32x32. You can pick any combination, but it's always only two sizes...
      Possibly the single most painful limitation the SNES has, since it makes optimising sprite use very tricky.
      (pick a size that's too small and large objects have to use way too many sub-sprites, which you then all have to move individually, slowing performance. Pick a size that's too large, and you waste huge amounts of VRAM, and potentially also limit how many sprites you can show since transparent areas of sprites still count towards limits on the number of sprite tiles you can draw in a line)
      Mega Drive sprites, even though technically smaller and there being only 80 instead of 128 are simply much more flexible and easier to use efficiently...

    • @RyanFaeScotland
      @RyanFaeScotland 6 ปีที่แล้ว +3

      ::slow claps::

    • @goeiecool9999
      @goeiecool9999 6 ปีที่แล้ว +2

      I fail to see the point of these comments... Maybe you should start a blog and post this there instead... DirectX is more work than taking on the task of an assembler? That makes no sense lol.

  • @borisdorofeev5602
    @borisdorofeev5602 5 ปีที่แล้ว

    Pure kino.

  • @iamthetinkerman
    @iamthetinkerman 3 ปีที่แล้ว +1

    This is awesome! I really like the idea of games made for the mega drive using procedurally generated levels! Are there any currently available?

  • @kaihendry
    @kaihendry 6 ปีที่แล้ว

    Nice editing

  • @ItzTheFury
    @ItzTheFury 6 ปีที่แล้ว +1

    Nice Winston Shirt :D

  • @br0fin
    @br0fin 6 ปีที่แล้ว

    This is fascinating.

  • @airborne501
    @airborne501 5 ปีที่แล้ว

    Excellent info. I appreciate the video, great stuff.

  • @HumbertoRamosCosta
    @HumbertoRamosCosta 6 ปีที่แล้ว +1

    The most impressive is that after that he will arrest the Joker...

  • @shune84
    @shune84 6 ปีที่แล้ว

    that was more a legal challenge rather than a technical one :D

  • @KONEY.INDUSTRIAL
    @KONEY.INDUSTRIAL 5 ปีที่แล้ว

    your dev unit is freaking cool!

  • @miltiadiskoutsokeras9189
    @miltiadiskoutsokeras9189 6 ปีที่แล้ว

    Excellent!! Please keep up the work!

  • @poorman-trending
    @poorman-trending 3 ปีที่แล้ว +1

    Can you do another assembly one but with Commodore 64? 6502/10

  • @MickeyD2012
    @MickeyD2012 6 ปีที่แล้ว +2

    I wish I just had access to a Sega CD devkit.

  • @r6inhardt
    @r6inhardt 6 ปีที่แล้ว

    Excellent example of asm

  • @firemacaw2417
    @firemacaw2417 6 ปีที่แล้ว

    the last bit was too real. omfg

  • @1954BJohn
    @1954BJohn 6 ปีที่แล้ว +2

    impressive!

  • @Kenbomp
    @Kenbomp 3 ปีที่แล้ว

    Nice but doesn't really get to drawing lines in assembly or other drawing routine

  • @kirill_bykov
    @kirill_bykov 3 ปีที่แล้ว

    5:00 0xFFFF/2 is not 64kB, but 64kB-1.

  • @SproutyPottedPlant
    @SproutyPottedPlant 6 ปีที่แล้ว

    ❤ Mr Megadrive and his Megadrive.

  • @flow5718
    @flow5718 6 ปีที่แล้ว +1

    Oh boy.. I learned programming 2 levels deep into the programception. Assembly > C > Python.

    • @Robstafarian
      @Robstafarian 4 ปีที่แล้ว

      I started with Python, and now I am learning C (all hobby stuff).

    • @Seiseary
      @Seiseary 3 ปีที่แล้ว

      You learned it in correct order

  • @edgeeffect
    @edgeeffect 5 ปีที่แล้ว

    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.

  • @mnmd-yr7kq
    @mnmd-yr7kq 2 ปีที่แล้ว

    More of this please! :) - Any update on how Matt is doing?

  • @PlasmaDabs
    @PlasmaDabs 6 ปีที่แล้ว +46

    What a scam! That is orange.

    • @interspect_
      @interspect_ 6 ปีที่แล้ว +16

      Plasma Dabs it’s a TN panel the brows angles screw the color

    • @Seiseary
      @Seiseary 3 ปีที่แล้ว

      its red

  • @marcello4258
    @marcello4258 3 ปีที่แล้ว

    9:40 you said bit, but it seems you were talking about a byte if I saw it correctly, didn't I?

  • @frogdeity
    @frogdeity 6 ปีที่แล้ว

    This is so cool.

  • @furan8477
    @furan8477 3 ปีที่แล้ว

    I didn't quite understand the bit of the move.w #(0xFFFF/2)-1.
    I get why we take 1, but I don't get why we have to divide 64 by 2.
    Thanks in advance to anyone willing to answer!

    • @williamdrum9899
      @williamdrum9899 ปีที่แล้ว +1

      He's doing 2 bytes at a time, so he has to divide by 2.

  • @conkerconk3
    @conkerconk3 3 ปีที่แล้ว

    this is the most interesting video ive ever seen...
    :)