Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

들어가며

https://en.wikipedia.org/wiki/Nintendo_Entertainment_System

  • NES(Nintendo Entertainment System)/ 현대 컴보이 / Famicom / 패밀리컴퓨터
  • 1983년 7월 15일 출시
  • 8비트 시대/ 십자키(D-Pad) 도입

구성

  • RP2A03
    • CPU - Central Processing Unit - W-RAM(2kb) work ram
    • APU - Audio Processing Unit
  • RP2C02
    • PPU - Picture Processing Unit - V-RAM(2kb) video ram
  • 카트리지
  • 컨트롤러

구현할 만 한가?

  • 화면이 보인다

    • NES에는 재미있는 게임들 있다.
  • 적당한 수(최대 256)의 opcode

  • 2D라 디버깅 비교적 쉬움.

  • 레퍼런스가 많다

  • 파고들 구석이 있다

    • 비공식 opcode들
    • 여러가지 Mapper 구현.
      • Mapper별로 가능한 게임이 다르다
    • Cpu cycle과 ppu 타이밍 맞춘다던가
    • 단순 화면만 아닌 디버그 뷰
  • Programming the NES - Everything you need to know

    • https://github.com/InkboxSoftware/NESGuide

  • NES Homebrew Game - Alter Ego
    • https://shiru.untergrund.net/
    • http://shiru.untergrund.net/files/nes/alter_ego.zip
    • https://shiru.untergrund.net/files/src/alter_ego_src.zip
    • NES Homebrew Game - Alter Ego https://www.youtube.com/watch?v=XN-Z8S_MIH4
    • https://forums.nesdev.org/viewtopic.php?t=7999

https://www.nesdev.org/obelisk-6502-guide/reference.html

https://skilldrick.github.io/easy6502/ https://6502.org/tools/emu/ https://6502.org/tutorials/

cpp - https://github.com/gabriel88766/NESEmulator/ lisp - https://github.com/samanthadoran/potential-disco

test

  • https://github.com/SingleStepTests/ProcessorTests/nes6502
  • https://github.com/SingleStepTests/65x02
  • https://www.nesdev.org/wiki/Emulator_tests
    • https://github.com/christopherpow/nes-test-roms

NES Emulator From Scratch https://github.com/OneLoneCoder/olcNES

https://nesmaker.nerdboard.nl/2022/03/21/the-cpu-memory-map/

  • https://llvm-mos.org/
    • zig
      • https://llvm-mos.org/wiki/Zig
      • https://github.com/kassane/zig-mos-bootstrap
      • https://kassane.github.io/blog/zig_mos_6502/

https://github.com/enusbaum/ADNES/ https://github.com/BotRandomness/NET-NES/

https://github.com/BotRandomness/CODE-DMG - gameboy

https://github.com/enusbaum/XamariNES

https://medium.com/happyprogrammer-in-jeju/rust를-업무용-언어로-쓰다-7723cd2c0a59 https://www.inflearn.com/course/%EC%B0%A8%EC%84%B8%EB%8C%80-%EA%B3%A0%EC%84%B1%EB%8A%A5-%EC%96%B8%EC%96%B4-rust-%EC%8B%A4%EC%9A%A9-%EC%9E%85%EB%AC%B8?cid=331813&inst=458c9aa9&utm_campaign=inflearn_%ED%8A%B8%EB%9E%98%ED%94%BD_promotion-link&utm_medium=referral&utm_source=instructor https://github.com/hatemogi/rust-course

I Am Error: The Nintendo Family Computer / Entertainment System Platform The Elements Of Computing Systems: Building A Modern Computer From First Principles

https://nerdy-nights.nes.science/

$0000-$00FF: 제로 페이지는 다른 주소보다 더 적은 바이트와 사이클로 접근할 수 있습니다. $0100-$01FF: 스택이 포함된 페이지로, 이 영역 내 어디에든 위치할 수 있지만 일반적으로 $01FF에서 시작하여 아래쪽으로 갈수록 커집니다.

그러면 벡터는 다음과 같습니다. FFFA-FFFB - NMI(Non-Maskable Interrupt). The PPU finished drawing a frame FFFC-FFFD - 리셋 벡터 - 콘솔 시작 혹은 재시작 - 코드 실행이 여기서 시작 FFFE-FFFF - IRQ 벡터 - Software interrupt (BRK) or hardware interrupt (IRQ)

$FFFA: $00 $80 => NMI handler at $8000 $FFFC: $00 $C0 => RESET: start at $C000 $FFFE: $50 $80 => IRQ/BRK handler at $8050

https://github.com/taylus/nes-dev

에뮬레이터

카트리지ChrRom -> 패턴테이블

패턴테이블 $0000-$0FFF $1000-$1FFF

  • https://www.nesdev.org/wiki/PPU_OAM
  • https://www.nesdev.org/wiki/DMA

https://github.com/nesdev-org/MesenCE/ https://www.retroreversing.com/nes https://www.copetti.org/ko/writings/consoles/nes/

https://people.ece.cornell.edu/land/courses/ece4760/FinalProjects/s2009/bhp7_teg25/bhp7_teg25/index.html

https://www.zophar.net/pdroms/nes.html

https://github.com/nkane/nessy

  • https://github.com/nkane/chippy

Ref

  • https://www.nesdev.org/
  • https://www.reddit.com/r/EmuDev/search/?q=nes
  • https://hn.algolia.com/?q=nes

기타

https://pikuma.com/courses/nes-game-programming-tutorial

참고 소스

  • https://github.com/LeeTeng2001/go-nes-emulator
  • https://github.com/analog-hors/pones/blob/main/pones-6502/src/cpu.rs
  • https://github.com/erspicu/AprNes
  • https://github.com/jakehffn/zig-nes
  • https://github.com/mikai233/nesium

https://ltriant.github.io/2019/11/22/nes-emulator.html https://github.com/ltriant/nes

https://github.com/emu-russia/breaks

  • nesicide

    • https://github.com/christopherpow/nesicide
    • https://www.romhacking.net/utilities/603/
  • https://nesdir.github.io/

How I Made a Handheld NES on a $1 CPU