renamed GPU to PPU

This commit is contained in:
Colby Swandale 2016-09-25 17:36:23 +10:00
parent ca36ba9bfd
commit 432f869c4e
4 changed files with 8 additions and 12 deletions

View file

@ -9,7 +9,7 @@ require "waterfoul/cpu"
require "waterfoul/errors"
require "waterfoul/sdl"
require "waterfoul/screen"
require "waterfoul/gpu"
require "waterfoul/ppu"
require "waterfoul/cartridge"
require "waterfoul/emulator"
require "waterfoul/input"

View file

@ -10,7 +10,7 @@ module Waterfoul
@cartridge = Cartridge.new rom
@cpu = CPU.new
@cpu = SkipBoot.set_state(@cpu) if options.has_key?('skip_boot')
@gpu = GPU.new
@ppu = PPU.new
@screen = Screen.new
end
@ -18,8 +18,8 @@ module Waterfoul
$mmu.cartridge = @cartridge
loop do
@cpu.step
@gpu.step @cpu.m
@screen.render @gpu.framebuffer if @gpu.vblank?
@ppu.step @cpu.m
@screen.render @ppu.framebuffer if @ppu.vblank?
end
end
end

View file

@ -1,14 +1,10 @@
module Waterfoul
module Helper
def pop_from_stack(word = true)
if word
lower = $mmu.read_byte @sp
@sp += 1
upper = $mmu.read_byte @sp
@sp += 1
(upper << 8) | lower
val = $mmu.read_word @sp
@sp += 2
val
else
val = $mmu.read_byte @sp
@sp += 1

View file

@ -1,7 +1,7 @@
require 'waterfoul/io/lcd_control'
module Waterfoul
class GPU
class PPU
include Helper
attr_accessor :mode