- SDL_PumpEvents(); // Force key events into the buffer.
- gram[0xC804] = gram[0xC806] = gram[0xC80C] = 0; // Reset PIA ports...
-
- if (keys[SDLK_ESCAPE])
- running = false; // ESC to exit...
-
- if (keys[SDLK_SEMICOLON])
- gram[0xC804] |= 0x01; // Fire (;)
- if (keys[SDLK_l])
- gram[0xC804] |= 0x02; // Thrust (L)
- if (keys[SDLK_SPACE])
- gram[0xC804] |= 0x04; // Smart Bomb (space)
- if (keys[SDLK_BACKSPACE])
- gram[0xC804] |= 0x08; // Hyperspace (BkSp)
- if (keys[SDLK_2])
- gram[0xC804] |= 0x10; // Two Player Start (2)
- if (keys[SDLK_1])
- gram[0xC804] |= 0x20; // One Player Start (1)
- if (keys[SDLK_RETURN])
- gram[0xC804] |= 0x40; // Reverse (Enter)
- if (keys[SDLK_f])
- gram[0xC804] |= 0x80; // Down (F)
-
- if (keys[SDLK_r])
- gram[0xC806] |= 0x01; // Up (R)
- if (keys[SDLK_a])
- gram[0xC806] |= 0x02; // Inviso (A)
-
- if (keys[SDLK_F1])
- gram[0xC80C] |= 0x01; // Auto up (F1)
- if (keys[SDLK_F2])
- gram[0xC80C] |= 0x02; // Advance (F2)
- if (keys[SDLK_5])
- gram[0xC80C] |= 0x04; // Right Coin (5)
- if (keys[SDLK_F3])
- gram[0xC80C] |= 0x08; // High Score Reset (F3)
- if (keys[SDLK_3])
- gram[0xC80C] |= 0x10; // Left Coin (3)
- if (keys[SDLK_4])
- gram[0xC80C] |= 0x20; // Center Coin (4)
- if (keys[SDLK_F4])
- gram[0xC80C] |= 0x40; // Slam Switch (F4)
-
- if (keys[SDLK_F5]) // Sound CPU self-test (F5)
- soundCPU.cpuFlags |= V6808_ASSERT_LINE_NMI;
- if (keys[SDLK_F6]) // Reset the 6808 (F6)
- soundCPU.cpuFlags |= V6808_ASSERT_LINE_RESET;
-
-/*
-$CB00 is scanline counter, bits 2-7 (1 frame/240 =69.44... usec)
-
-Some places of interest to look at:
-
-RdMem: Reading address C80E [=0C, PC=15C3] <- Inside interrupt (read, then discarded)...
-RdMem: Reading address CB00 [=43, PC=15C6] <- interrupt
-RdMem: Reading address C80C [=00, PC=0758] <- input (?)
-RdMem: Reading address C80C [=00, PC=07B9] <- input (?)
-RdMem: Reading address C806 [=00, PC=078C] <- input
-RdMem: Reading address C804 [=00, PC=2679] <- input
-*/
- uint32 startTicks = SDL_GetTicks();
-// long video_clk = 0;
-// gram[0xCB00] = 0;
-
-/*
-//This is where the interrupt mask is restored in CC... Hmm...
-//This enables interrupts *after* the previous interrupt has occurred... Hmm.
-//Could $C80F (rom_pia_ctrlb) be the IRQ inhibit? Yes, it is!
-
- // the IRQ signal comes into CB1, and is set to VA11
- pia_1_cb1_w(0, scanline & 0x20);
-...
- // the COUNT240 signal comes into CA1, and is set to the logical AND of VA10-VA13
- pia_1_ca1_w(0, 0);
-...
- // the COUNT240 signal comes into CA1, and is set to the logical AND of VA10-VA13
- pia_1_ca1_w(0, 1);
-*/