aSMtris - Tetris in x86 assembly

Discussion in 'Game Development General Discussion' started by smccd, Aug 28, 2014.

  1. smccd

    smccd Member

    Joined:
    Mar 1, 2012
    Messages:
    20
    Likes Received:
    5
  2. Eviltaco64

    Eviltaco64 or your money back

    Joined:
    Jul 16, 2008
    Messages:
    1,027
    Likes Received:
    136
  3. Piratero

    Piratero Peppy Member

    Joined:
    Feb 28, 2009
    Messages:
    367
    Likes Received:
    8
    Very very nice!
     
  4. artillery_ghosted

    artillery_ghosted Gutsy Member

    Joined:
    Jan 5, 2013
    Messages:
    486
    Likes Received:
    7
  5. cez

    cez Site Supporter

    Joined:
    Apr 4, 2007
    Messages:
    1,194
    Likes Received:
    29
    That's really nice. I also enjoyed reading your development log and will try out the game the next time I'm on a Windows computer.

    It really is amazing what can be packed into a 2 kb file.
     
  6. rso

    rso Gone. See y'all elsewhere, maybe.

    Joined:
    Mar 26, 2010
    Messages:
    2,190
    Likes Received:
    447
    The log was the best bit imho, I've played enough Tetris for one lifetime :)

    Re: Windows - just get DOSbox on whatever platform you're running, it's likely you'll need to do that on Windows too (as stated, the game runs only on XP or earlier, the latter ones removed the required DOS subsystem).
     
    Last edited: Aug 29, 2014
  7. mudlord

    mudlord Member

    Joined:
    Sep 6, 2014
    Messages:
    10
    Likes Received:
    0
    Not really, I seen tetris done in 256 bytes......
     
  8. cez

    cez Site Supporter

    Joined:
    Apr 4, 2007
    Messages:
    1,194
    Likes Received:
    29
    Proof or it never happened. ;)
     
  9. mudlord

    mudlord Member

    Joined:
    Sep 6, 2014
    Messages:
    10
    Likes Received:
    0
  10. keropi

    keropi Familiar Face

    Joined:
    Feb 2, 2011
    Messages:
    1,068
    Likes Received:
    64
    nice tetris, thanks for sharing OP!
     
  11. cez

    cez Site Supporter

    Joined:
    Apr 4, 2007
    Messages:
    1,194
    Likes Received:
    29
  12. TauntButon

    TauntButon Member

    Joined:
    Nov 2, 2014
    Messages:
    15
    Likes Received:
    0
    As someone learning som x86, this is super rad. I have no idea how you are drawing but this is nice work.
     
  13. rso

    rso Gone. See y'all elsewhere, maybe.

    Joined:
    Mar 26, 2010
    Messages:
    2,190
    Likes Received:
    447
    Simple. He's setting up a framebuffer:
    ...and then goes on frobbing individual pixels in there:
    (Btw, this board is lacking some
    Code:
     tags...)
     
  14. TauntButon

    TauntButon Member

    Joined:
    Nov 2, 2014
    Messages:
    15
    Likes Received:
    0
    So the x86 has some way to set up a native framebuffer. Neat.
     
  15. rso

    rso Gone. See y'all elsewhere, maybe.

    Joined:
    Mar 26, 2010
    Messages:
    2,190
    Likes Received:
    447
    Not exactly, that's actually not a function of the CPU, but of the BIOS - which not every x86 system has. But as long as you're targeting Windows-capable non-UEFI PCs you should be good to go 99.99% of the time.
     
    Last edited: Nov 5, 2014
  16. TauntButon

    TauntButon Member

    Joined:
    Nov 2, 2014
    Messages:
    15
    Likes Received:
    0
    Is this what get's used by the BIOS to display some sort of interface to a user trying to change it's boot settings?
     
  17. rso

    rso Gone. See y'all elsewhere, maybe.

    Joined:
    Mar 26, 2010
    Messages:
    2,190
    Likes Received:
    447
    Beats me - I'm not much of a graphics guy. The BIOS menus are (or at least look like) usually textmode, but even that needs to be rendered to be a framebuffer somewhere afaict. Wether that's the same memory you use in mode13, I have no idea.

    Other than that, things like "mode 13" don't have much meaning to the BIOS, since that's just an abstraction/a function it provides to OSs - the BIOS itself is one level closer to the HW and can do whatever it feels like. Maybe it uses the mode13 code internally too, maybe it doesn't.

    If you want in-depth details about this, I believe you want to read up on the VESA standards, which afaik isn't x86-specific so might be outside of your scope. Or you could look at a complete yet reasonably-sized x86 OS like BareMetal.
     
  18. Calpis

    Calpis Champion of the Forum

    Joined:
    Mar 13, 2004
    Messages:
    5,906
    Likes Received:
    21
    Graphics cards actually still contain VGA hardware compatibility to some degree, including text modes, specifically for BIOS support. Internally the hardware may rasterize character cells to a bitmap for further processing (necessary for digital displays), but the hardware interface is still there.

    So using the BIOS for game graphics isn't necessary, but it was perhaps the most "clean" choice since abstracting the output behind a pixel plotting function (BIOS call) decouples the game logic from the platform specific code, at the cost of performance (which is hardly a consideration on today's hardware).
     
    Last edited: Nov 10, 2014
sonicdude10
Draft saved Draft deleted
Insert every image as a...
  1.  0%

Share This Page