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/errors"
require "waterfoul/sdl" require "waterfoul/sdl"
require "waterfoul/screen" require "waterfoul/screen"
require "waterfoul/gpu" require "waterfoul/ppu"
require "waterfoul/cartridge" require "waterfoul/cartridge"
require "waterfoul/emulator" require "waterfoul/emulator"
require "waterfoul/input" require "waterfoul/input"

View file

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

View file

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

View file

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