1400: 00 NOP ; Time/size pad to match CPL in EraseShiftedSprite
1401: CD 74 14 CALL CnvtPixNumber ; Convert pixel number to coord and shift
1404: 00 NOP ; Time/size pad to match CPL in EraseShiftedSprite
1405: C5 PUSH BC ; Hold count
1406: E5 PUSH HL ; Hold start coordinate
1407: 1A LD A,(DE) ; Get the picture bits
1408: D3 04 OUT ($04),A ; Store in shift register
140A: DB 03 IN A,($03) ; Read the shifted pixels
140C: B6 OR (HL) ; OR them onto the screen
140D: 77 LD (HL),A ; Store them back to screen
140E: 23 INC HL ; Next colummn on screen
140F: 13 INC DE ; Next in picture
1410: AF XOR A ; Shift over ...
1411: D3 04 OUT ($04),A ; ... to next byte in register (shift in 0)
1413: DB 03 IN A,($03) ; Read the shifted pixels
1415: B6 OR (HL) ; OR them onto the screen
1416: 77 LD (HL),A ; Store them back to screen
1417: E1 POP HL ; Restore starting coordinate
1418: 01 20 00 LD BC,$0020 ; Add 32 ...
141B: 09 ADD HL,BC ; ... to coordinate (move to next row)
141C: C1 POP BC ; Restore count
141D: 05 DEC B ; All done?
141E: C2 05 14 JP NZ,$1405 ; No ... go do all rows
1421: C9 RET ; Done
private void POP(ref ushort reg)
{
reg = ReadWord(SP.Value);
SP.Value += 2;
cycles += 10;
}
private void PUSH(ushort reg)
{
SP.Value -= 2;
WriteWord((ushort)(SP.Value), reg);
cycles += 11;
}
private void CALL()
{
PUSH((ushort)(PC.Value + 2));
PC.Value = ReadWord(PC.Value);
cycles += 6;
}
private void RET()
{
POP(ref PC.Value);
}
Wow, last post was a while ago now!
I have just started my Space Invaders emulator, after completing the Chip8 emulator (will add in SChip support when I feel like it).
I'll update as I progress (or get stuck )
Going to make a Space Invaders emulator for android, using LibGDX. I'll be posting here as well .
For the flags, specific "events" trigger a flag set/clear.
http://en.m.wikipedia.org/wiki/Intel_8080#Flags documents these events, take a look there
Something else: How does the stack pointer work on the 8080? From what I can tell, it doesn't have a dedicated "stack", so... where is it retrieving the values from?
Also, do you happen to know how the AC flag works? If you could explain that, it'd be appreciated!
if(((a & 0xF) + (b & 0xF)) & 0x10)
aux_carry = 1;
else
aux_carry = 0;
Hi,
trying to emulate Space Invaders in Javascript, inspired by Thibault Imbert.
Does anybody know why the 8080 ANA instruction the AC flag gets set? How?
Thanks