mirror of
https://github.com/colby-swandale/waterfoul
synced 2024-11-15 19:47:58 +01:00
Merge pull request #6 from eregon/initialize-cpu-ivars
This commit is contained in:
commit
795370916c
1 changed files with 4 additions and 3 deletions
|
@ -43,7 +43,7 @@ module Waterfoul
|
||||||
include Instructions::Prefix
|
include Instructions::Prefix
|
||||||
|
|
||||||
# 8 bit registers
|
# 8 bit registers
|
||||||
attr_reader :a, :b, :c, :d, :e, :f, :h, :l, :f
|
attr_reader :a, :b, :c, :d, :e, :f, :h, :l
|
||||||
# CPU instruction cycle count
|
# CPU instruction cycle count
|
||||||
attr_reader :m
|
attr_reader :m
|
||||||
# 16 bit registers
|
# 16 bit registers
|
||||||
|
@ -55,10 +55,11 @@ module Waterfoul
|
||||||
def initialize(options = {})
|
def initialize(options = {})
|
||||||
@pc = 0x0000
|
@pc = 0x0000
|
||||||
@sp = 0x0000
|
@sp = 0x0000
|
||||||
@a = @b = @c = @d = @e = @f = @h = @l = @f = 0x00
|
@a = @b = @c = @d = @e = @f = @h = @l = 0x00
|
||||||
@m = 0
|
|
||||||
@timer = Timer.new
|
@timer = Timer.new
|
||||||
@ime = false
|
@ime = false
|
||||||
|
@halt = false
|
||||||
|
reset_tick
|
||||||
end
|
end
|
||||||
|
|
||||||
# This method emulates the CPU cycle process. Each instruction is
|
# This method emulates the CPU cycle process. Each instruction is
|
||||||
|
|
Loading…
Reference in a new issue