-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
35 lines (30 loc) · 747 Bytes
/
main.py
File metadata and controls
35 lines (30 loc) · 747 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#import pygame
#screen = pygame.display.set_mode((256,240), pygame.HWSURFACE)
#
#surf = pygame.PixelArray(screen)
#
#for i in range(100):
# surf[i][10:51] = screen.map_rgb((0, 255, 0))
#
#s = screen.map_rgb((0, 255, 0))
#pygame.display.update()
#while True:
# for event in pygame.event.get():
# if event.type == pygame.QUIT:
# break
#
from nes import Nes
import pygame
nes = Nes()
nes.loadRom('test.nes')
nes.start()
eventCheckCount = 0
while nes.isRunning:
eventCheckCount += 1
if eventCheckCount >= 10000:
for event in pygame.event.get():
if event.type == pygame.QUIT:
nes.stop()
break
eventCheckCount = 0
nes.cpu.emulate()