What's new

Space Invaders

mendus

New member
According the the manual in the first page, the ANA instructions ignore the AC flag (i.e., it will have the same value before and after the instruction).
 

tangomar

New member
thanks. I must have an old document (98-153B_Intel_8080_Microcomputer_System_User_Manual_197509.pdf) where at page 52 it says that AC flag is updated by the instruction.
 

Coca Koala

New member
I'm working on an 8080/SI emulator as my first emulator project. I've been using the 8080 instruction manual as a reference, implementing opcodes as I get to them in the ROM.

I just hit the 0xd3 opcode, OUT, and it's time for me to start figuring out how I/O works in this thing. Can I restate my understanding of how some of this stuff works, and somebody tells me if I'm heading down the wrong track?

OUT takes a port as an argument, and writes the contents of reg A to that port. The OP states that I can get away without implementing OUT 3, OUT 5, and OUT 6. OUT 2 means that I'm shifting the bitshift register by some offset, and OUT 4 means that I'm writing the contents of A to the bitshift (specifically, to the left half of the bitshift). So I need to have some sort of uint16_t, like a double register, and use that as the bitshift.

IN takes an argument, and depending on what argument that is (1, 2, or 3), it reads the contents of a uint_8 and treats that as a mask where each bit indicates that input is coming from a particular source (directional buttons, dipswitches, etc). So I need to make keyboard listeners, map keys to certain inputs, and maintain input masks; when I detect keyboard input, set the appropriate bit in the mask and wait for the IN instruction to read it.

As far as video goes, there's a section of the ram devoted to video; I should be able to just read the ram from $2400 to $3fff, call it a bmp, and blit it on to the screen with something like SDL. I don't need to worry about the bmp file header, because that's only important before the bmp is stored in ram; since the rom is generating the bmps on the fly, they're already in memory and I can just say it's a bmp.

Is that basically correct?
 

MoleskiCoder

New member
To perhaps revive this thread, i can attest that writing a space invaders emulator is pretty straightforward, if you've already coded a Chip-8 emulator.

My code is available here:
https://github.com/MoleskiCoder/invaders

It's written in C++11, using SDL2 for the graphics, sound etc.

Things of interest:

* I've got a pseudo-interlace mode, that flickers alarmingly and gives nice vertical scanlines.
* ****tail mode screen flip is available
* Xbox 360 style controllers are supported, including a haptic shudder if a life is lost

Anyway, thanks Hap for starting this thread.

Adrian
 
Last edited:

Top