Skip to content

suzukiplan/vgs8

Repository files navigation

SUZUKI PLAN - Video Game System - 8bit (WIP)

※まだ開発途中です(絶賛テスト中なので, まだバグが結構沢山ある筈 & 仕様はモリモリ破壊的変更されます)

後述のWIP statusに全部チェックが付いた頃にようやくテスト完了でstableになります(stableになった後は破壊的変更はしない予定)

  • SUZUKI PLAN - Video Game System - 8bit (VGS8) is a newly designed 8 bit game machine with current technologies.
  • This repository provides VGS8 emulator core module, SDK tools, HAL examples and example programs.
  • The base architecture design of VGS8 is inspired by NES (;Nintendo Entertaiment System), but it does not have a compatibility.

WIP status

以下, やるかやらないかまだ分からないextra (やるとしても恐らくWIP外した後)

  • Windows用HALを作成
  • Linux用HALを作成
  • iOS用HALを作成
  • Android用HALを作成
  • 6502マシン語ゲームプログラミング(VGS8版)の本を執筆

Setup

Pre requests

  • GNU make
  • CLANG
  • cc65

Windows

(略)

macOS

  • GNU make, CLANG are installed via XCODE Command Line Tools
  • cc65 is installable with HomeBrew
brew install cc65

Linux

(略)

Setup

git clone https://github.com/suzukiplan/vgs8
cd vgs8
git submodule update --init --recursive
make

make command will build the following modules:

  • ROM linkage tool(romlink)
  • ROM debugger tool (vgsrun)
  • example ROMs

Please copy src/* files to your project, if you make an original VGS8 emulator.

Execute VGS8 emulator on macOS

Please execute following command after setup.

cd hal/mac
open EmuBoard.xcodeproj

Specification

  • CPU: MOS6502 8MHz
    • program 0: $8000 ~ $BFFF (16KB)
    • program 1: $C000 ~ $FFFF (16KB)
    • switchable 255 banks (PRG bank)
  • PPU
    • character data: 8bit color, 128x128px x 2 pages
    • switchable 255 banks (CHR bank)
    • 1 character: 8x8 or 16x16 *16x16 is sprite only
    • max sprites: 256 (no holizontal limit)
    • BG (back of sprite) & FG (front of sprite)
    • BG/FG nametable size: 512x512px (64x64 characters)
    • screen size: 256x256px *the top, bottom, left, and right ends 8px are masks)
  • APU
  • No battery backup features (SAVE/LOAD features are usable as hardware function)

Memory map

Address Usage
$0000〜$00FF Zero page
$0100〜$01FF Stack
$0200〜$4FFF RAM
$5000〜$53FF Sprite OAM (4x256)
$5400〜$5BFF I/O ports
$5C00〜$5FFF Palette
$6000〜$6FFF BG nametable (64x64)
$7000〜$7FFF FG nametable (64x64)
$8000〜$BFFF Program 0
$C000〜$FFFF Program 1

I/O map

Address Usage
$5400 CPU I/O port (RW): PRG Bank of $8000〜$BFFF
$5401 CPU I/O port (RW): PRG Bank of $C000〜$FFFF
$5402 PPU I/O port (RW): CHR Bank of 0
$5403 PPU I/O port (RW): CHR Bank of 1
$5404 PPU I/O port (RW): CMAP register -----FBS
$5405 PPU I/O port (RW): Background Color
$5406〜$5409 PPU I/O port (RW): FG/BG window positions
$540A〜$540D PPU I/O port (W): FG/BG scroll
$5500 APU I/O port (W): play EFF
$5501 APU I/O port (W): stop EFF
$5502 APU I/O port (W): pause all EFFs
$5503 APU I/O port (W): resume all EFFs
$5504 APU I/O port (RW): all EFFs master volume down rate
$5600 APU I/O port (W): play BGM
$5601 APU I/O port (W): pause BGM
$5602 APU I/O port (W): resume BGM
$5603 APU I/O port (R): BGM playing status
$5604 APU I/O port (RW): BGM master volume down rate
$5700 JoyPad I/O port (R): read 1P JoyPad status
$5701 JoyPad I/O port (R): read 2P JoyPad status
$5800 Mouse/TouchPannel I/O port (R): touching status
$5801 Mouse/TouchPannel I/O port (R): last touched position X
$5802 Mouse/TouchPannel I/O port (R): last touched position Y
$5A00 DMA I/O port (RW): Set base page
$5A01 DMA I/O port (W): execute memset
$5A02 DMA I/O port (W): execute memcpy
$5A10 DEGREE I/O port (RW): x1
$5A11 DEGREE I/O port (RW): y1
$5A12 DEGREE I/O port (RW): x2
$5A13 DEGREE I/O port (RW): y2
$5A14 DEGREE I/O port (R): calculate degree of (x1, y1) and (x2, y2)*1
$5BFF CPU I/O port (R): update VRAM request

*1: VGS8 degree calculation:

x1=100, y1=100, x2=100, y2=  0: degree=0
x1=100, y1=100, x2=200, y2=  0: degree=32
x1=100, y1=100, x2=200, y2=100: degree=64
x1=100, y1=100, x2=200, y2=200: degree=96
x1=100, y1=100, x2=100, y2=200: degree=128
x1=100, y1=100, x2=  0, y2=200: degree=160
x1=100, y1=100, x2=  0, y2=100: degree=192
x1=100, y1=100, x2=  0, y2=  0: degree=224

Manual

see the MANUAL.md

License

MIT

About

[WIP] SUZUKI PLAN - Video Game System - 8bit

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published