rubyboy 0.3.0 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 75741c0c0044a7a9985e38c81e7756ed155481f39a8ced6620842ad09590a631
4
- data.tar.gz: 6ca44b4cf8b11111eaaae44876b1d303f7d9baf20ee6e2132b61c61bf5d93486
3
+ metadata.gz: '08c5c68c0375707dcc850da2776897f0fd9d5d185b917f50215dcea7bbfcd70c'
4
+ data.tar.gz: 23e385a235a8179006ac286b31e737c205854eb8564204d220fc7a867c637ac4
5
5
  SHA512:
6
- metadata.gz: 0ef6237619ea02791de321e13645a694cdf715bdcd3f958d4116e739e4d6734309d7da66c03d829ffacec3e231310ea5d70ede2daf8c53b2bd93d7d1d483df19
7
- data.tar.gz: ff8fd7354154f5f62b16ce5139a3c689d3e01f4e2dabe95e48350fe8573ddb490dc576a533c06d826974b20f3fcd7e245b5ada766cad2212a513d50ef632b59b
6
+ metadata.gz: 7cf0e5a59a76982a5bbff640d555a0f240ff980b4706a943cb8566cc3d4974b33dfdb2502499d457c66a2165bd5ace339bf68e69cb762f7ee9b4b9a5ba54186d
7
+ data.tar.gz: 9f96dc6441947295ec6fbc28e55dd9066de2a82de3ec1dc0c6ea82cac5aa956024bc0f3e8f3cc2038aef3b7def0dc363404d8dbec8224bbb3d70cd6ca8f3e3d2
data/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
  ## [Unreleased]
2
2
 
3
+ ## [1.0.0] - 2023-12-04
4
+
5
+ - Fix halt and timer
6
+ - Add executable command
7
+ - Refactoring
8
+ - tobu.gb works at 30fps
9
+
10
+ ## [0.4.0] - 2023-11-20
11
+
12
+ - Fix interrupt
13
+ - Fix sprite priority
14
+ - Implement joypad
15
+ - Pass bgbtest
16
+
3
17
  ## [0.3.0] - 2023-11-19
4
18
 
5
19
  - Fix bg rendering
data/README.md CHANGED
@@ -1,34 +1,26 @@
1
1
  # Rubyboy
2
2
 
3
- TODO: Delete this and the text below, and describe your gem
4
-
5
- Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/rubyboy`. To experiment with that code, run `bin/console` for an interactive prompt.
3
+ A Game Boy emulator written in Ruby
6
4
 
7
5
  ## Installation
8
6
 
9
- TODO: Replace `UPDATE_WITH_YOUR_GEM_NAME_PRIOR_TO_RELEASE_TO_RUBYGEMS_ORG` with your gem name right after releasing it to RubyGems.org. Please do not do it earlier due to security reasons. Alternatively, replace this section with instructions to install your gem from git if you don't plan to release to RubyGems.org.
7
+ This project requires Ruby 3.2.0 or higher.
10
8
 
11
9
  Install the gem and add to the application's Gemfile by executing:
12
10
 
13
- $ bundle add UPDATE_WITH_YOUR_GEM_NAME_PRIOR_TO_RELEASE_TO_RUBYGEMS_ORG
11
+ $ bundle add rubyboy
14
12
 
15
13
  If bundler is not being used to manage dependencies, install the gem by executing:
16
14
 
17
- $ gem install UPDATE_WITH_YOUR_GEM_NAME_PRIOR_TO_RELEASE_TO_RUBYGEMS_ORG
15
+ $ gem install rubyboy
18
16
 
19
17
  ## Usage
20
18
 
21
- TODO: Write usage instructions here
22
-
23
- ## Development
24
-
25
- After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
26
-
27
- To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).
19
+ $ rubyboy <rom_path>
28
20
 
29
21
  ## Contributing
30
22
 
31
- Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/rubyboy. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/[USERNAME]/rubyboy/blob/main/CODE_OF_CONDUCT.md).
23
+ Bug reports and pull requests are welcome on GitHub at https://github.com/sacckey/rubyboy. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/sacckey/rubyboy/blob/main/CODE_OF_CONDUCT.md).
32
24
 
33
25
  ## License
34
26
 
@@ -36,4 +28,4 @@ The gem is available as open source under the terms of the [MIT License](https:/
36
28
 
37
29
  ## Code of Conduct
38
30
 
39
- Everyone interacting in the Rubyboy project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/[USERNAME]/rubyboy/blob/main/CODE_OF_CONDUCT.md).
31
+ Everyone interacting in the Rubyboy project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/sacckey/rubyboy/blob/main/CODE_OF_CONDUCT.md).
data/exe/rubyboy ADDED
@@ -0,0 +1,7 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
4
+ require 'rubyboy'
5
+
6
+ rom_path = ARGV[0]
7
+ Rubyboy::Console.new(rom_path).start
data/lib/rubyboy/bus.rb CHANGED
@@ -1,24 +1,18 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require_relative 'cartridge/factory'
4
- require_relative 'interrupt'
5
- require_relative 'timer'
6
4
 
7
5
  module Rubyboy
8
6
  class Bus
9
- attr_accessor :ppu, :rom, :interrupt
10
-
11
- def initialize(ppu, rom, timer, interrupt)
7
+ def initialize(ppu, rom, timer, interrupt, joypad)
12
8
  @ppu = ppu
13
9
  @rom = rom
14
10
  @ram = Ram.new
15
- @mbc = Cartridge::Factory.create(rom, @ram)
16
-
11
+ @mbc = Cartridge::Factory.create(@rom, @ram)
12
+ @joypad = joypad
17
13
  @interrupt = interrupt
18
14
  @timer = timer
19
15
 
20
- @oam = Array.new(0xa0, 0)
21
-
22
16
  @tmp = {}
23
17
  end
24
18
 
@@ -42,8 +36,7 @@ module Rubyboy
42
36
  # unused
43
37
  0xff
44
38
  when 0xff00
45
- # joypad
46
- @tmp[addr] ||= 0
39
+ @joypad.read_byte(addr)
47
40
  when 0xff01..0xff02
48
41
  # serial
49
42
  @tmp[addr] ||= 0
@@ -102,8 +95,7 @@ module Rubyboy
102
95
  when 0xfea0..0xfeff
103
96
  # unused
104
97
  when 0xff00
105
- # joypad
106
- @tmp[addr] = value
98
+ @joypad.write_byte(addr, value)
107
99
  when 0xff01..0xff02
108
100
  # serial
109
101
  @tmp[addr] = value