Results 1 to 3 of 3
  1. #1
    EmuTalk Member
    Join Date
    Feb 2021
    Posts
    2
    Mentioned
    0 Post(s)

    Space Invaders Emulator - All the Invaders draw in bottom LH corner

    Hi All,

    First time post on what looks like a great forum.

    I am after some assistance with a Space Invaders Emulator that I have written. Before I start I will say that it is written in Blitz3D as I was just interested to see whether an old skool language like Blitz would have enough grunt to do the job, and when it works, I will then try it on older more obscure platforms (maybe PS2 YaBasic for real old and obscure..).

    It turns out that it runs pretty well and at full speed without sweating and I have implemented 8080 processor, Interrupts and 16 bit shift register.

    The emulator runs well until it gets to the attract screen, where all of the invaders draw themselves in the same screen location at the bottom LH side of the screen, and then the gun shows up and starts blasting away at empty space.

    From what I can see, the Space Invaders pixels are taken from the shift register and then placed into the correct video memory location a column at a time. As the Space Invaders display in on its side, this means that the invaders are drawn from the bottom left of the screen to top right in Columns(rows) a byte of pixels at a time. The actual memory location that the pixels from the shift register are put is I think derived from the memory location stored in HL, and each column is counted off in BC, something like 24 lots of 8 bytes of pixels per column.

    Has anyone had an issue like this and if so how was it resolved?

    Many thanks for any information that anyone can give.

    Edit 1 - Having spent an hour trawling through the debug log, I can see that HL is around 16 bytes off where it should be when it starts to draw invaders. This may be because at least part of the emulator thinks that there is no space invaders left to draw... and the other part thinks there is and starts drawing them! Back to ComputerArcheology's space invaders code page...
    Attached Thumbnails Attached Thumbnails Click image for larger version. 

Name:	SI1.jpg 
Views:	5 
Size:	83.1 KB 
ID:	40321   Click image for larger version. 

Name:	SI2.jpg 
Views:	4 
Size:	73.7 KB 
ID:	40322  
    Last edited by Randall_Flagg; February 16th, 2021 at 14:37.

  2. #2
    Moderator Robbbert's Avatar
    Join Date
    Aug 2005
    Posts
    221
    Mentioned
    4 Post(s)
    Don't forget that Space Invaders has a special chip (MB14241) for doing bit-shifts, which you'll need to emulate too.


  3. #3
    EmuTalk Member
    Join Date
    Feb 2021
    Posts
    2
    Mentioned
    0 Post(s)
    Quote Originally Posted by Robbbert View Post
    Don't forget that Space Invaders has a special chip (MB14241) for doing bit-shifts, which you'll need to emulate too.
    Yer that's the 16-bit Shift register. Have implemented this and it seems to work as without it, I wouldn't get any invaders drawn at all, but the offset in the screen memory is incorrect. Am just trawling through Computer Archaeologies Space Invaders code page to try and work out where the offset comes from.

    Edit: Finally found out what was wrong with a lot of trawling through debug log and comparing to working emulator. I misread how Opcode 0x2A - LHLD, A16 works. The A16 in the name gives it away, A for address. I was treating it as a D16 and loading PC and PC+1 into registers H and L. All invaders now in correct places. Now the next bug! Attract mode shot collision doesn't seem to work :-(
    Last edited by Randall_Flagg; February 26th, 2021 at 13:27.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •