rubyboy 1.6.0 → 1.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +13 -0
- data/README.md +40 -84
- data/exe/rubyboy +5 -7
- data/exe/rubyboy-bench +9 -20
- data/lib/bench.rb +17 -46
- data/lib/executor.rb +19 -10
- data/lib/rubyboy/apu_channels/channel1.rb +4 -4
- data/lib/rubyboy/apu_channels/channel2.rb +4 -4
- data/lib/rubyboy/apu_channels/channel3.rb +2 -9
- data/lib/rubyboy/apu_channels/channel4.rb +0 -7
- data/lib/rubyboy/audio.rb +7 -2
- data/lib/rubyboy/emulator.rb +7 -23
- data/lib/rubyboy/emulator_headless.rb +1 -1
- data/lib/rubyboy/emulator_wasm.rb +30 -7
- data/lib/rubyboy/hardware_state.rb +1 -0
- data/lib/rubyboy/lcd.rb +2 -10
- data/lib/rubyboy/rom.rb +3 -0
- data/lib/rubyboy/sdl.rb +1 -1
- data/lib/rubyboy/state_file.rb +1 -2
- data/lib/rubyboy/version.rb +1 -1
- metadata +4 -60
- data/.rspec +0 -3
- data/.rubocop.yml +0 -54
- data/CODE_OF_CONDUCT.md +0 -84
- data/Rakefile +0 -12
- data/docs/favicon.png +0 -0
- data/docs/index.html +0 -75
- data/docs/index.js +0 -113
- data/docs/logo-light-23.svg +0 -1
- data/docs/ogp.png +0 -0
- data/docs/styles.css +0 -245
- data/docs/worker.js +0 -115
- data/exe/rubyboy-wasm +0 -26
- data/lib/opcodes.json +0 -11657
- data/lib/roms/bgbtest.gb +0 -0
- data/lib/roms/cpu_instrs/cpu_instrs.gb +0 -0
- data/lib/roms/cpu_instrs/individual/01-special.gb +0 -0
- data/lib/roms/cpu_instrs/individual/02-interrupts.gb +0 -0
- data/lib/roms/cpu_instrs/individual/03-op sp,hl.gb +0 -0
- data/lib/roms/cpu_instrs/individual/04-op r,imm.gb +0 -0
- data/lib/roms/cpu_instrs/individual/05-op rp.gb +0 -0
- data/lib/roms/cpu_instrs/individual/06-ld r,r.gb +0 -0
- data/lib/roms/cpu_instrs/individual/07-jr,jp,call,ret,rst.gb +0 -0
- data/lib/roms/cpu_instrs/individual/08-misc instrs.gb +0 -0
- data/lib/roms/cpu_instrs/individual/09-op r,r.gb +0 -0
- data/lib/roms/cpu_instrs/individual/10-bit ops.gb +0 -0
- data/lib/roms/cpu_instrs/individual/11-op a,(hl).gb +0 -0
- data/lib/roms/cpu_instrs/readme.txt +0 -119
- data/lib/roms/dmg-acid2.gb +0 -0
- data/lib/roms/hello-world.gb +0 -0
- data/lib/roms/instr_timing/instr_timing.gb +0 -0
- data/lib/roms/instr_timing/readme.txt +0 -139
- data/lib/rubyboy/raylib/audio.rb +0 -32
- data/lib/rubyboy/raylib/lcd.rb +0 -40
- data/lib/rubyboy/raylib/raylib_loader.rb +0 -36
- data/lib/stackprof.rb +0 -14
- data/resource/logo/logo.png +0 -0
- data/resource/logo/logo.svg +0 -1
- data/resource/logo/rubyboy.png +0 -0
- data/resource/screenshots/pokemon.png +0 -0
- data/resource/screenshots/puyopuyo.png +0 -0
- data/sig/rubyboy.rbs +0 -4
data/lib/roms/bgbtest.gb
DELETED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -1,119 +0,0 @@
|
|
|
1
|
-
Game Boy CPU Instruction Behavior Test
|
|
2
|
-
--------------------------------------
|
|
3
|
-
This ROM tests the behavior of all CPU instructions except STOP and the
|
|
4
|
-
11 illegal opcodes. The tests are fairly thorough, running instructions
|
|
5
|
-
with boundary data and verifying both the result and that other
|
|
6
|
-
registers are not modified. Instructions which perform the same
|
|
7
|
-
operation on different registers are each tested just as thoroughly, in
|
|
8
|
-
case an emulator implements each independently. Some sub-tests take half
|
|
9
|
-
minute to complete.
|
|
10
|
-
|
|
11
|
-
Failed instructions are listed as
|
|
12
|
-
|
|
13
|
-
[CB] opcode
|
|
14
|
-
|
|
15
|
-
Some errors cannot of course be diagnosed properly, since the test
|
|
16
|
-
framework itself relies on basic instruction behavior being correct.
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
Internal operation
|
|
20
|
-
------------------
|
|
21
|
-
The main tests use a framework that runs each instruction in a loop,
|
|
22
|
-
varying the register values on input and examining them on output.
|
|
23
|
-
Rather than keep a table of correct values, it simply calculates a
|
|
24
|
-
CRC-32 checksum of all the output, then compares this with the correct
|
|
25
|
-
value. Instructions are divided into several groups, each with a
|
|
26
|
-
different set of input values suited for their behavior; for example,
|
|
27
|
-
the bit test instructions are fed $01, $02, $04 ... $40, $80, to ensure
|
|
28
|
-
each bit is handled properly, while the arithmetic instructions are fed
|
|
29
|
-
$01, $0F, $10, $7F, $FF, to exercise carry and half-carry. A few
|
|
30
|
-
instructions require a custom test due to their uniqueness.
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
Multi-ROM
|
|
34
|
-
---------
|
|
35
|
-
In the main directory is a single ROM which runs all the tests. It
|
|
36
|
-
prints a test's number, runs the test, then "ok" if it passes, otherwise
|
|
37
|
-
a failure code. Once all tests have completed it either reports that all
|
|
38
|
-
tests passed, or prints the number of failed tests. Finally, it makes
|
|
39
|
-
several beeps. If a test fails, it can be run on its own by finding the
|
|
40
|
-
corresponding ROM in individual/.
|
|
41
|
-
|
|
42
|
-
Ths compact format on screen is to avoid having the results scroll off
|
|
43
|
-
the top, so the test can be started and allowed to run without having to
|
|
44
|
-
constantly monitor the display.
|
|
45
|
-
|
|
46
|
-
Currently there is no well-defined way for an emulator test rig to
|
|
47
|
-
programatically find the result of the test; contact me if you're trying
|
|
48
|
-
to do completely automated testing of your emulator. One simple approach
|
|
49
|
-
is to take a screenshot after all tests have run, or even just a
|
|
50
|
-
checksum of one, and compare this with a previous run.
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
Failure codes
|
|
54
|
-
-------------
|
|
55
|
-
Failed tests may print a failure code, and also short description of the
|
|
56
|
-
problem. For more information about a failure code, look in the
|
|
57
|
-
corresponding source file in source/; the point in the code where
|
|
58
|
-
"set_test n" occurs is where that failure code will be generated.
|
|
59
|
-
Failure code 1 is a general failure of the test; any further information
|
|
60
|
-
will be printed.
|
|
61
|
-
|
|
62
|
-
Note that once a sub-test fails, no further tests for that file are run.
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
Console output
|
|
66
|
-
--------------
|
|
67
|
-
Information is printed on screen in a way that needs only minimum LCD
|
|
68
|
-
support, and won't hang if LCD output isn't supported at all.
|
|
69
|
-
Specifically, while polling LY to wait for vblank, it will time out if
|
|
70
|
-
it takes too long, so LY always reading back as the same value won't
|
|
71
|
-
hang the test. It's also OK if scrolling isn't supported; in this case,
|
|
72
|
-
text will appear starting at the top of the screen.
|
|
73
|
-
|
|
74
|
-
Everything printed on screen is also sent to the game link port by
|
|
75
|
-
writing the character to SB, then writing $81 to SC. This is useful for
|
|
76
|
-
tests which print lots of information that scrolls off screen.
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
Source code
|
|
80
|
-
-----------
|
|
81
|
-
Source code is included for all tests, in source/. It can be used to
|
|
82
|
-
build the individual test ROMs. Code for the multi test isn't included
|
|
83
|
-
due to the complexity of putting everything together.
|
|
84
|
-
|
|
85
|
-
Code is written for the wla-dx assembler. To assemble a particular test,
|
|
86
|
-
execute
|
|
87
|
-
|
|
88
|
-
wla -o "source_filename.s" test.o
|
|
89
|
-
wlalink linkfile test.gb
|
|
90
|
-
|
|
91
|
-
Test code uses a common shell framework contained in common/.
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
Internal framework operation
|
|
95
|
-
----------------------------
|
|
96
|
-
Tests use a common framework for setting things up, reporting results,
|
|
97
|
-
and ending. All files first include "shell.inc", which sets up the ROM
|
|
98
|
-
header and shell code, and includes other commonly-used modules.
|
|
99
|
-
|
|
100
|
-
One oddity is that test code is first copied to internal RAM at $D000,
|
|
101
|
-
then executed there. This allows self-modification, and ensures the code
|
|
102
|
-
is executed the same way it is on my devcart, which doesn't have a
|
|
103
|
-
rewritable ROM as most do.
|
|
104
|
-
|
|
105
|
-
Some macros are used to simplify common tasks:
|
|
106
|
-
|
|
107
|
-
Macro Behavior
|
|
108
|
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
|
109
|
-
wreg addr,data Writes data to addr using LDH
|
|
110
|
-
lda addr Loads byte from addr into A using LDH
|
|
111
|
-
sta addr Stores A at addr using LDH
|
|
112
|
-
delay n Delays n cycles, where NOP = 1 cycle
|
|
113
|
-
delay_msec n Delays n milliseconds
|
|
114
|
-
set_test n,"Cause" Sets failure code and optional string
|
|
115
|
-
|
|
116
|
-
Routines and macros are documented where they are defined.
|
|
117
|
-
|
|
118
|
-
--
|
|
119
|
-
Shay Green <gblargg@gmail.com>
|
data/lib/roms/dmg-acid2.gb
DELETED
|
Binary file
|
data/lib/roms/hello-world.gb
DELETED
|
Binary file
|
|
Binary file
|
|
@@ -1,139 +0,0 @@
|
|
|
1
|
-
Game Boy CPU Instruction Timing Test
|
|
2
|
-
------------------------------------
|
|
3
|
-
This ROM tests the timings of all CPU instructions except HALT, STOP,
|
|
4
|
-
and the 11 illegal opcodes. For conditional instructions, it tests taken
|
|
5
|
-
and not taken timings. This test requires proper timer operation (TAC,
|
|
6
|
-
TIMA, TMA).
|
|
7
|
-
|
|
8
|
-
Failed instructions are listed as
|
|
9
|
-
|
|
10
|
-
[CB] opcode:measured time-correct time
|
|
11
|
-
|
|
12
|
-
Times are in terms of instruction cycles, where NOP takes one cycle.
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
Verified cycle timing tables
|
|
16
|
-
----------------------------
|
|
17
|
-
The test internally uses a table of proper cycle times, which can be
|
|
18
|
-
used in an emulator to ensure proper timing. The only changes below are
|
|
19
|
-
removal of the .byte prefixes, and addition of commas at the ends, so
|
|
20
|
-
that they can be used without changes in most programming languages. For
|
|
21
|
-
added correctness assurance, the original tables can be found at the end
|
|
22
|
-
of the source code.
|
|
23
|
-
|
|
24
|
-
Normal instructions:
|
|
25
|
-
|
|
26
|
-
1,3,2,2,1,1,2,1,5,2,2,2,1,1,2,1,
|
|
27
|
-
0,3,2,2,1,1,2,1,3,2,2,2,1,1,2,1,
|
|
28
|
-
2,3,2,2,1,1,2,1,2,2,2,2,1,1,2,1,
|
|
29
|
-
2,3,2,2,3,3,3,1,2,2,2,2,1,1,2,1,
|
|
30
|
-
1,1,1,1,1,1,2,1,1,1,1,1,1,1,2,1,
|
|
31
|
-
1,1,1,1,1,1,2,1,1,1,1,1,1,1,2,1,
|
|
32
|
-
1,1,1,1,1,1,2,1,1,1,1,1,1,1,2,1,
|
|
33
|
-
2,2,2,2,2,2,0,2,1,1,1,1,1,1,2,1,
|
|
34
|
-
1,1,1,1,1,1,2,1,1,1,1,1,1,1,2,1,
|
|
35
|
-
1,1,1,1,1,1,2,1,1,1,1,1,1,1,2,1,
|
|
36
|
-
1,1,1,1,1,1,2,1,1,1,1,1,1,1,2,1,
|
|
37
|
-
1,1,1,1,1,1,2,1,1,1,1,1,1,1,2,1,
|
|
38
|
-
2,3,3,4,3,4,2,4,2,4,3,0,3,6,2,4,
|
|
39
|
-
2,3,3,0,3,4,2,4,2,4,3,0,3,0,2,4,
|
|
40
|
-
3,3,2,0,0,4,2,4,4,1,4,0,0,0,2,4,
|
|
41
|
-
3,3,2,1,0,4,2,4,3,2,4,1,0,0,2,4
|
|
42
|
-
|
|
43
|
-
CB-prefixed instructions:
|
|
44
|
-
|
|
45
|
-
2,2,2,2,2,2,4,2,2,2,2,2,2,2,4,2,
|
|
46
|
-
2,2,2,2,2,2,4,2,2,2,2,2,2,2,4,2,
|
|
47
|
-
2,2,2,2,2,2,4,2,2,2,2,2,2,2,4,2,
|
|
48
|
-
2,2,2,2,2,2,4,2,2,2,2,2,2,2,4,2,
|
|
49
|
-
2,2,2,2,2,2,3,2,2,2,2,2,2,2,3,2,
|
|
50
|
-
2,2,2,2,2,2,3,2,2,2,2,2,2,2,3,2,
|
|
51
|
-
2,2,2,2,2,2,3,2,2,2,2,2,2,2,3,2,
|
|
52
|
-
2,2,2,2,2,2,3,2,2,2,2,2,2,2,3,2,
|
|
53
|
-
2,2,2,2,2,2,4,2,2,2,2,2,2,2,4,2,
|
|
54
|
-
2,2,2,2,2,2,4,2,2,2,2,2,2,2,4,2,
|
|
55
|
-
2,2,2,2,2,2,4,2,2,2,2,2,2,2,4,2,
|
|
56
|
-
2,2,2,2,2,2,4,2,2,2,2,2,2,2,4,2,
|
|
57
|
-
2,2,2,2,2,2,4,2,2,2,2,2,2,2,4,2,
|
|
58
|
-
2,2,2,2,2,2,4,2,2,2,2,2,2,2,4,2,
|
|
59
|
-
2,2,2,2,2,2,4,2,2,2,2,2,2,2,4,2,
|
|
60
|
-
2,2,2,2,2,2,4,2,2,2,2,2,2,2,4,2
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
Internal operation
|
|
64
|
-
------------------
|
|
65
|
-
Before each instruction is executed, the test sets up registers and
|
|
66
|
-
memory in such a way that the instruction will cleanly execute and then
|
|
67
|
-
end up at a common destination, without trashing anything important. The
|
|
68
|
-
timing itself is done by first synchronizing to the timer via a loop,
|
|
69
|
-
executing the instruction, then using a similar loop to determine how
|
|
70
|
-
many clocks elapsed.
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
Failure codes
|
|
74
|
-
-------------
|
|
75
|
-
Failed tests may print a failure code, and also short description of the
|
|
76
|
-
problem. For more information about a failure code, look in the
|
|
77
|
-
corresponding source file in source/; the point in the code where
|
|
78
|
-
"set_test n" occurs is where that failure code will be generated.
|
|
79
|
-
Failure code 1 is a general failure of the test; any further information
|
|
80
|
-
will be printed.
|
|
81
|
-
|
|
82
|
-
Note that once a sub-test fails, no further tests for that file are run.
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
Console output
|
|
86
|
-
--------------
|
|
87
|
-
Information is printed on screen in a way that needs only minimum LCD
|
|
88
|
-
support, and won't hang if LCD output isn't supported at all.
|
|
89
|
-
Specifically, while polling LY to wait for vblank, it will time out if
|
|
90
|
-
it takes too long, so LY always reading back as the same value won't
|
|
91
|
-
hang the test. It's also OK if scrolling isn't supported; in this case,
|
|
92
|
-
text will appear starting at the top of the screen.
|
|
93
|
-
|
|
94
|
-
Everything printed on screen is also sent to the game link port by
|
|
95
|
-
writing the character to SB, then writing $81 to SC. This is useful for
|
|
96
|
-
tests which print lots of information that scrolls off screen.
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
Source code
|
|
100
|
-
-----------
|
|
101
|
-
Source code is included for all tests, in source/. It can be used to
|
|
102
|
-
build the individual test ROMs. Code for the multi test isn't included
|
|
103
|
-
due to the complexity of putting everything together.
|
|
104
|
-
|
|
105
|
-
Code is written for the wla-dx assembler. To assemble a particular test,
|
|
106
|
-
execute
|
|
107
|
-
|
|
108
|
-
wla -o "source_filename.s" test.o
|
|
109
|
-
wlalink linkfile test.gb
|
|
110
|
-
|
|
111
|
-
Test code uses a common shell framework contained in common/.
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
Internal framework operation
|
|
115
|
-
----------------------------
|
|
116
|
-
Tests use a common framework for setting things up, reporting results,
|
|
117
|
-
and ending. All files first include "shell.inc", which sets up the ROM
|
|
118
|
-
header and shell code, and includes other commonly-used modules.
|
|
119
|
-
|
|
120
|
-
One oddity is that test code is first copied to internal RAM at $D000,
|
|
121
|
-
then executed there. This allows self-modification, and ensures the code
|
|
122
|
-
is executed the same way it is on my devcart, which doesn't have a
|
|
123
|
-
rewritable ROM as most do.
|
|
124
|
-
|
|
125
|
-
Some macros are used to simplify common tasks:
|
|
126
|
-
|
|
127
|
-
Macro Behavior
|
|
128
|
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
|
129
|
-
wreg addr,data Writes data to addr using LDH
|
|
130
|
-
lda addr Loads byte from addr into A using LDH
|
|
131
|
-
sta addr Stores A at addr using LDH
|
|
132
|
-
delay n Delays n cycles, where NOP = 1 cycle
|
|
133
|
-
delay_msec n Delays n milliseconds
|
|
134
|
-
set_test n,"Cause" Sets failure code and optional string
|
|
135
|
-
|
|
136
|
-
Routines and macros are documented where they are defined.
|
|
137
|
-
|
|
138
|
-
--
|
|
139
|
-
Shay Green <gblargg@gmail.com>
|
data/lib/rubyboy/raylib/audio.rb
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
require 'raylib'
|
|
4
|
-
|
|
5
|
-
module Rubyboy
|
|
6
|
-
module Raylib
|
|
7
|
-
class Audio
|
|
8
|
-
include Raylib
|
|
9
|
-
|
|
10
|
-
MAX_SAMPLES = 512
|
|
11
|
-
|
|
12
|
-
def initialize
|
|
13
|
-
InitAudioDevice()
|
|
14
|
-
SetAudioStreamBufferSizeDefault(MAX_SAMPLES * 2)
|
|
15
|
-
@stream = LoadAudioStream(48000, 32, 2)
|
|
16
|
-
PlayAudioStream(@stream)
|
|
17
|
-
end
|
|
18
|
-
|
|
19
|
-
def play(samples)
|
|
20
|
-
samples_pointer = FFI::MemoryPointer.new(:float, samples.size)
|
|
21
|
-
samples_pointer.put_array_of_float(0, samples)
|
|
22
|
-
|
|
23
|
-
UpdateAudioStream(@stream, samples_pointer, samples.size)
|
|
24
|
-
end
|
|
25
|
-
|
|
26
|
-
def close
|
|
27
|
-
UnloadAudioStream(@stream)
|
|
28
|
-
CloseAudioDevice()
|
|
29
|
-
end
|
|
30
|
-
end
|
|
31
|
-
end
|
|
32
|
-
end
|
data/lib/rubyboy/raylib/lcd.rb
DELETED
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
require 'raylib'
|
|
4
|
-
|
|
5
|
-
module Rubyboy
|
|
6
|
-
module Raylib
|
|
7
|
-
class Lcd
|
|
8
|
-
include Raylib
|
|
9
|
-
|
|
10
|
-
WIDTH = 160
|
|
11
|
-
HEIGHT = 144
|
|
12
|
-
SCALE = 4
|
|
13
|
-
|
|
14
|
-
def initialize
|
|
15
|
-
InitWindow(WIDTH * SCALE, HEIGHT * SCALE, 'Ruby Boy')
|
|
16
|
-
image = GenImageColor(WIDTH, HEIGHT, BLACK)
|
|
17
|
-
image.format = PIXELFORMAT_UNCOMPRESSED_R8G8B8
|
|
18
|
-
@texture = LoadTextureFromImage(image)
|
|
19
|
-
@vector = Vector2.create(0, 0)
|
|
20
|
-
end
|
|
21
|
-
|
|
22
|
-
def draw(pixel_data)
|
|
23
|
-
UpdateTexture(@texture, pixel_data.pack('C*'))
|
|
24
|
-
|
|
25
|
-
BeginDrawing()
|
|
26
|
-
ClearBackground(BLACK)
|
|
27
|
-
DrawTextureEx(@texture, @vector, 0.0, SCALE, WHITE)
|
|
28
|
-
EndDrawing()
|
|
29
|
-
end
|
|
30
|
-
|
|
31
|
-
def window_should_close?
|
|
32
|
-
WindowShouldClose()
|
|
33
|
-
end
|
|
34
|
-
|
|
35
|
-
def close_window
|
|
36
|
-
CloseWindow()
|
|
37
|
-
end
|
|
38
|
-
end
|
|
39
|
-
end
|
|
40
|
-
end
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
require 'raylib'
|
|
4
|
-
|
|
5
|
-
module Rubyboy
|
|
6
|
-
module Raylib
|
|
7
|
-
class RaylibLoader
|
|
8
|
-
include Raylib
|
|
9
|
-
|
|
10
|
-
def load_raylib
|
|
11
|
-
shared_lib_path = "#{Gem::Specification.find_by_name('raylib-bindings').full_gem_path}/lib/"
|
|
12
|
-
case RUBY_PLATFORM
|
|
13
|
-
when /mswin|msys|mingw/ # Windows
|
|
14
|
-
Raylib.load_lib("#{shared_lib_path}libraylib.dll")
|
|
15
|
-
when /darwin/ # macOS
|
|
16
|
-
arch = RUBY_PLATFORM.split('-')[0]
|
|
17
|
-
Raylib.load_lib(shared_lib_path + "libraylib.#{arch}.dylib")
|
|
18
|
-
when /linux/ # Ubuntu Linux (x86_64 or aarch64)
|
|
19
|
-
arch = RUBY_PLATFORM.split('-')[0]
|
|
20
|
-
Raylib.load_lib(shared_lib_path + "libraylib.#{arch}.so")
|
|
21
|
-
else
|
|
22
|
-
raise "Unknown system: #{RUBY_PLATFORM}"
|
|
23
|
-
end
|
|
24
|
-
|
|
25
|
-
SetTraceLogLevel(LOG_ERROR)
|
|
26
|
-
end
|
|
27
|
-
|
|
28
|
-
def key_input_check
|
|
29
|
-
direction = (IsKeyUp(KEY_D) && 1 || 0) | ((IsKeyUp(KEY_A) && 1 || 0) << 1) | ((IsKeyUp(KEY_W) && 1 || 0) << 2) | ((IsKeyUp(KEY_S) && 1 || 0) << 3)
|
|
30
|
-
action = (IsKeyUp(KEY_K) && 1 || 0) | ((IsKeyUp(KEY_J) && 1 || 0) << 1) | ((IsKeyUp(KEY_U) && 1 || 0) << 2) | ((IsKeyUp(KEY_I) && 1 || 0) << 3)
|
|
31
|
-
@joypad.direction_button(direction)
|
|
32
|
-
@joypad.action_button(action)
|
|
33
|
-
end
|
|
34
|
-
end
|
|
35
|
-
end
|
|
36
|
-
end
|
data/lib/stackprof.rb
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
require 'stackprof'
|
|
4
|
-
require_relative 'rubyboy/emulator'
|
|
5
|
-
|
|
6
|
-
module Rubyboy
|
|
7
|
-
class Stackprof
|
|
8
|
-
def run
|
|
9
|
-
StackProf.run(mode: :cpu, out: 'stackprof-cpu-myapp.dump', raw: true) do
|
|
10
|
-
Rubyboy::Emulator.new('lib/roms/tobu.gb').bench
|
|
11
|
-
end
|
|
12
|
-
end
|
|
13
|
-
end
|
|
14
|
-
end
|
data/resource/logo/logo.png
DELETED
|
Binary file
|
data/resource/logo/logo.svg
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
<svg xmlns="http://www.w3.org/2000/svg" width="467" height="75" viewBox="0 0 467 75"><path fill="#cc342d" d="M25.40 46.45L21.75 46.45L18.40 73.65L2.20 73.65L11.10 0.80L33.20 0.80Q39.90 0.80 44.63 2.23Q49.35 3.65 52.35 6.15Q55.35 8.65 56.73 12.08Q58.10 15.50 58.10 19.50L58.10 19.50Q58.10 23.55 57.03 27.15Q55.95 30.75 53.90 33.78Q51.85 36.80 48.88 39.13Q45.90 41.45 42.10 42.95L42.10 42.95Q43.60 43.80 44.93 45Q46.25 46.20 47 48L47 48L57.60 73.65L42.90 73.65Q40.85 73.65 39.45 72.85Q38.05 72.05 37.50 70.55L37.50 70.55L29.60 49Q29.05 47.60 28.13 47.03Q27.20 46.45 25.40 46.45L25.40 46.45ZM31.70 12.95L25.90 12.95L23.15 35.20L29.10 35.20Q32.60 35.20 35.05 34.13Q37.50 33.05 39.03 31.25Q40.55 29.45 41.23 27.05Q41.90 24.65 41.90 22L41.90 22Q41.90 19.95 41.30 18.28Q40.70 16.60 39.43 15.43Q38.15 14.25 36.23 13.60Q34.30 12.95 31.70 12.95L31.70 12.95ZM90.40 60.85L90.40 60.85Q93.45 60.85 95.95 59.68Q98.45 58.50 100.35 56.33Q102.25 54.15 103.50 51.05Q104.75 47.95 105.20 44.10L105.20 44.10L110.50 0.80L126.80 0.80L121.50 44.10Q120.65 50.75 117.98 56.33Q115.30 61.90 111.03 65.93Q106.75 69.95 101.10 72.20Q95.45 74.45 88.70 74.45L88.70 74.45Q82.60 74.45 77.83 72.60Q73.05 70.75 69.78 67.38Q66.50 64 64.80 59.30Q63.10 54.60 63.10 48.95L63.10 48.95Q63.10 46.60 63.40 44.10L63.40 44.10L68.60 0.80L84.90 0.80L79.60 44.10Q79.50 45 79.45 45.88Q79.40 46.75 79.40 47.60L79.40 47.60Q79.40 53.80 82.23 57.33Q85.05 60.85 90.40 60.85ZM154.50 73.65L127.30 73.65L136.30 0.80L161.30 0.80Q167.65 0.80 172.18 2Q176.70 3.20 179.58 5.42Q182.45 7.65 183.78 10.78Q185.10 13.90 185.10 17.70L185.10 17.70Q185.10 20.70 184.33 23.48Q183.55 26.25 181.88 28.60Q180.20 30.95 177.55 32.88Q174.90 34.80 171.15 36.10L171.15 36.10Q177.05 37.70 179.88 41.08Q182.70 44.45 182.70 49.60L182.70 49.60Q182.70 54.65 180.78 59.03Q178.85 63.40 175.20 66.65Q171.55 69.90 166.33 71.78Q161.10 73.65 154.50 73.65L154.50 73.65ZM157.90 42.55L147.40 42.55L145.10 61.40L155.80 61.40Q158.80 61.40 160.85 60.53Q162.90 59.65 164.18 58.08Q165.45 56.50 166.03 54.40Q166.60 52.30 166.60 49.80L166.60 49.80Q166.60 48.15 166.18 46.80Q165.75 45.45 164.73 44.53Q163.70 43.60 162.03 43.08Q160.35 42.55 157.90 42.55L157.90 42.55ZM151 12.95L148.70 31.75L156.50 31.75Q159.25 31.75 161.45 31.20Q163.65 30.65 165.23 29.33Q166.80 28 167.65 25.80Q168.50 23.60 168.50 20.35L168.50 20.35Q168.50 16.30 166.38 14.63Q164.25 12.95 159.80 12.95L159.80 12.95L151 12.95ZM255.30 0.80L225.45 45.75L222 73.65L205.70 73.65L209.15 45.90L190.40 0.80L204.90 0.80Q207 0.80 208.18 1.78Q209.35 2.75 209.90 4.35L209.90 4.35L216.90 26.40Q217.60 28.60 218.18 30.65Q218.75 32.70 219.15 34.60L219.15 34.60Q220.10 32.70 221.25 30.68Q222.40 28.65 223.70 26.40L223.70 26.40L236.10 4.35Q236.85 3 238.30 1.90Q239.75 0.80 241.80 0.80L241.80 0.80L255.30 0.80ZM297 73.65L269.80 73.65L278.80 0.80L303.80 0.80Q310.15 0.80 314.68 2Q319.20 3.20 322.08 5.42Q324.95 7.65 326.28 10.78Q327.60 13.90 327.60 17.70L327.60 17.70Q327.60 20.70 326.83 23.48Q326.05 26.25 324.38 28.60Q322.70 30.95 320.05 32.88Q317.40 34.80 313.65 36.10L313.65 36.10Q319.55 37.70 322.38 41.08Q325.20 44.45 325.20 49.60L325.20 49.60Q325.20 54.65 323.28 59.03Q321.35 63.40 317.70 66.65Q314.05 69.90 308.83 71.78Q303.60 73.65 297 73.65L297 73.65ZM300.40 42.55L289.90 42.55L287.60 61.40L298.30 61.40Q301.30 61.40 303.35 60.53Q305.40 59.65 306.68 58.08Q307.95 56.50 308.53 54.40Q309.10 52.30 309.10 49.80L309.10 49.80Q309.10 48.15 308.68 46.80Q308.25 45.45 307.23 44.53Q306.20 43.60 304.53 43.08Q302.85 42.55 300.40 42.55L300.40 42.55ZM293.50 12.95L291.20 31.75L299 31.75Q301.75 31.75 303.95 31.20Q306.15 30.65 307.73 29.33Q309.30 28 310.15 25.80Q311 23.60 311 20.35L311 20.35Q311 16.30 308.88 14.63Q306.75 12.95 302.30 12.95L302.30 12.95L293.50 12.95ZM401.40 32.55L401.40 32.55Q401.40 38.45 400.02 43.85Q398.65 49.25 396.13 53.90Q393.60 58.55 390.02 62.35Q386.45 66.15 382 68.83Q377.55 71.50 372.35 72.98Q367.15 74.45 361.40 74.45L361.40 74.45Q354.20 74.45 348.48 71.93Q342.75 69.40 338.75 65.03Q334.75 60.65 332.63 54.73Q330.50 48.80 330.50 41.95L330.50 41.95Q330.50 36.05 331.88 30.63Q333.25 25.20 335.77 20.55Q338.30 15.90 341.90 12.10Q345.50 8.30 349.95 5.63Q354.40 2.95 359.60 1.48Q364.80 0 370.60 0L370.60 0Q377.75 0 383.48 2.53Q389.20 5.05 393.18 9.45Q397.15 13.85 399.27 19.80Q401.40 25.75 401.40 32.55ZM384.70 32.95L384.70 32.95Q384.70 28.45 383.63 24.78Q382.55 21.10 380.48 18.48Q378.40 15.85 375.40 14.43Q372.40 13 368.60 13L368.60 13Q363.60 13 359.65 15.08Q355.70 17.15 352.93 20.90Q350.15 24.65 348.68 29.93Q347.20 35.20 347.20 41.60L347.20 41.60Q347.20 46.10 348.25 49.75Q349.30 53.40 351.32 56Q353.35 58.60 356.35 60.03Q359.35 61.45 363.20 61.45L363.20 61.45Q368.20 61.45 372.18 59.40Q376.15 57.35 378.93 53.60Q381.70 49.85 383.20 44.60Q384.70 39.35 384.70 32.95ZM467 0.80L437.15 45.75L433.70 73.65L417.40 73.65L420.85 45.90L402.10 0.80L416.60 0.80Q418.70 0.80 419.88 1.78Q421.05 2.75 421.60 4.35L421.60 4.35L428.60 26.40Q429.30 28.60 429.88 30.65Q430.45 32.70 430.85 34.60L430.85 34.60Q431.80 32.70 432.95 30.68Q434.10 28.65 435.40 26.40L435.40 26.40L447.80 4.35Q448.55 3 450 1.90Q451.45 0.80 453.50 0.80L453.50 0.80L467 0.80Z"></path></svg>
|
data/resource/logo/rubyboy.png
DELETED
|
Binary file
|
|
Binary file
|
|
Binary file
|
data/sig/rubyboy.rbs
DELETED