hasegawa-tomoki/php-terminal-nes-emulator

TypeError in Cpu/Cpu.php:54

Closed this issue · 3 comments

PHP 7.1.19 (cli) (built: Aug 17 2018 18:03:17) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.1.0, Copyright (c) 1998-2018 Zend Technologies
Rom size: 262160 (0x40010)
Program ROM pages: 8
Character ROM pages: 16
Mapper: 4
Character ROM start: 0x20010 (131088)
Character ROM end: 0x40010 (262160)
Program   ROM: 0x0000 - 0x1ffff (131071 bytes)
Character ROM: 0x0000 - 0x1ffff (131071 bytes)
Initial pc: ffff

Fatal error: Uncaught TypeError: Argument 1 passed to Nes\Cpu\Cpu::getAddrOrDataWithAdditionalCycle() must be an instance of Nes\Cpu\Addressing, null given, called in /path/to/php-terminal-nes-emulator/src/Cpu/Cpu.php on line 646 and defined in /path/to/php-terminal-nes-emulator/src/Cpu/Cpu.php:54
Stack trace:
#0 /path/to/php-terminal-nes-emulator/src/Cpu/Cpu.php(646): Nes\Cpu\Cpu->getAddrOrDataWithAdditionalCycle(NULL)
#1 /path/to/php-terminal-nes-emulator/src/Nes.php(112): Nes\Cpu\Cpu->run()
#2 /path/to/php-terminal-nes-emulator/src/Nes.php(128): Nes\Nes->frame()
#3 /path/to/php-terminal-nes-emulator/boot.php(43): Nes\Nes->start()
#4 {main}
  thrown in /path/to/php-terminal-nes-emulator/src/Cpu/Cpu.php on line 54

OS: macOS 10.14

The same problem occurs when I use Debian Linux (WSL) & php 7.2.9

What rom did you try to?
Supports only mapper 0 roms.

What rom did you try to?
Supports only mapper 0 roms.

Ohh, my mistake... 😂
I try another mapper 0 rom and it works!