rubygb 0.2.0 → 0.2.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a877dc8d5031406712a6a929162ba7628435134b
4
- data.tar.gz: 2fb36c1a69f7b6ee63879a957865945ab733faec
3
+ metadata.gz: 51adaa33b942a27b10da81c0a8ee49d6a5e73e59
4
+ data.tar.gz: ff96146f72ea74d55179233987f79712202647c6
5
5
  SHA512:
6
- metadata.gz: 5c7facde8265ed86e9d18a1de766c1bc27019a3eb06435a791b935fa232925c2ed720dbe64f18c3c8b7f0e78b943793990f24f625a468489c2c793c5310489c8
7
- data.tar.gz: d6dee2a3b3dc6ed2666337d87d1c6059a8ccf4e9f29413f7db9de11929bb300780b1e95d040b46ac095f1e52d051d9f16875897399c743d619b3e8311b8c66ed
6
+ metadata.gz: 221b56cd9948b6331b4d062c73502aec3f2dceb30d9357e00805302019d890aca571283bd68d384ebdf083256068044d035377b3e822855155bb5d7403c8febb
7
+ data.tar.gz: c79feda555e8915bc59de821b3d9c9d3ac4c7169b86ff920e5a1dd53014457aaa486182e852bf60a3f5660266de53922bfb682ca226b4aa5b14c7d274a95dfdb
data/README.md CHANGED
@@ -13,9 +13,27 @@ gem install rubygb
13
13
 
14
14
  ## Usage
15
15
 
16
- ```ruby
17
- rubygb build FILENAME
18
16
  ```
17
+ $ rubygb init you
18
+ Creating new project at /Users/cooldev/you
19
+ Copying gbhw.inc...
20
+ Copying ibmpx1.inc...
21
+ Copying memory.inc...
22
+ Generating you/you.s...
23
+ Done!
24
+
25
+ $ cd you
26
+
27
+ $ rubygb build you.s
28
+ Assembling you.s
29
+ Pass 1...
30
+ Pass 2...
31
+ Success! 3283 lines in 0.01 seconds (13894335 lines/minute)
32
+
33
+ $ gameboyemulator --open you.gb
34
+ ```
35
+
36
+ ![despite everything, it's still you](wiki-images/you.gif)
19
37
 
20
38
  ## Awesomeness
21
39
 
data/lib/rubygb/cli.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  require 'thor'
2
2
  require 'fileutils'
3
- require 'pry-byebug'
3
+
4
4
  module Rubygb
5
5
  class CLI < Thor
6
6
  desc 'build FILENAME', 'attempt to assemble, link + fix FILENAME and create a gb rom from it'
data/lib/rubygb/rubygb.rb CHANGED
@@ -5,11 +5,14 @@ module Rubygb
5
5
  end
6
6
 
7
7
  base = File.basename(filename, ".*")
8
-
9
8
  exe_path = File.expand_path(File.join(File.dirname(__FILE__),"..","rgbds"))
10
- puts `#{exe_path}/rgbasm -v -o#{base}.obj #{filename}`
11
- puts `#{exe_path}/rgblink -m#{base}.map -n#{base}.sym -o#{base}.gb #{base}.obj`
12
- puts `#{exe_path}/rgbfix -p0 -v #{base}.gb` unless options[:no_fix]
9
+
10
+ raise "Assembly failed!" unless system("#{exe_path}/rgbasm -v -o#{base}.obj #{filename}")
11
+ raise "Link failed!" unless system("#{exe_path}/rgblink -m#{base}.map -n#{base}.sym -o#{base}.gb #{base}.obj")
12
+
13
+ unless options[:no_fix]
14
+ raise "Header fix failed!" unless system("#{exe_path}/rgbfix -p0 -v #{base}.gb")
15
+ end
13
16
  end
14
17
  end
15
18
 
@@ -1,4 +1,4 @@
1
1
  module Rubygb
2
- VERSION = "0.2.0".freeze
2
+ VERSION = "0.2.1".freeze
3
3
  end
4
4
 
@@ -4,19 +4,19 @@ ROM Bank #0 (HOME):
4
4
  SECTION: $0050-$0050 ($0001 bytes)
5
5
  SECTION: $0058-$0058 ($0001 bytes)
6
6
  SECTION: $0060-$0060 ($0001 bytes)
7
- SECTION: $0100-$09AE ($08AF bytes)
7
+ SECTION: $0100-$09B0 ($08B1 bytes)
8
8
  $0952 = begin
9
- $099E = StopLCD
9
+ $09A0 = StopLCD
10
10
  $0150 = TileData
11
11
  $0990 = Title
12
- $099E = TitleEnd
12
+ $09A0 = TitleEnd
13
13
  SECTION: $0061-$00B6 ($0056 bytes)
14
14
  $007B = mem_CopyMono
15
15
  $008B = mem_SetVRAM
16
16
  $00A1 = mem_CopyVRAM
17
17
  $0061 = mem_Set
18
18
  $006D = mem_Copy
19
- SLACK: $36F6 bytes
19
+ SLACK: $36F4 bytes
20
20
 
21
21
  WRAM Bank #0:
22
22
  EMPTY
Binary file
@@ -0,0 +1,90 @@
1
+ ; tester.s
2
+ ;
3
+ ; TODO: summary
4
+
5
+ INCLUDE "lib/gbhw.inc" ; gameboy hardware definitions
6
+ INCLUDE "lib/ibmpx1.inc" ; ibm ascii font macros
7
+
8
+
9
+ ; interrupts
10
+ SECTION "Vblank",HOME[$0040]
11
+ reti
12
+ SECTION "LCDC",HOME[$0048]
13
+ reti
14
+ SECTION "Timer_Overflow",HOME[$0050]
15
+ reti
16
+ SECTION "Serial",HOME[$0058]
17
+ reti
18
+ SECTION "p1thru4",HOME[$0060]
19
+ reti
20
+
21
+ ; jump to start of user code at `begin`
22
+
23
+ SECTION "start",HOME[$0100]
24
+ nop
25
+ jp begin
26
+
27
+ ; rom header - no memory bank controller, 32k rom, 0; ram
28
+ ROM_HEADER ROM_NOMBC, ROM_SIZE_32KBYTE, RAM_SIZE_0KBYTE
29
+
30
+
31
+ INCLUDE "lib/memory.inc"; memory copying macros
32
+
33
+ TileData:
34
+ chr_IBMPC1 1,8 ; LOAD ENTIRE CHARACTER SET
35
+
36
+ ; initialization
37
+ begin:
38
+ nop
39
+ di
40
+ ld sp, $ffff ; set the stack pointer to highest mem location + 1
41
+ init:
42
+ ld a, %11100100 ; Window palette colors, from darkest to lightest
43
+ ld [rBGP], a ; CLEAR THE SCREEN
44
+
45
+ ld a,0 ; SET SCREEN TO TO UPPER RIGHT HAND CORNER
46
+ ld [rSCX], a
47
+ ld [rSCY], a
48
+ call StopLCD ; YOU CAN NOT LOAD $8000 WITH LCD ON
49
+ ld hl, TileData
50
+ ld de, _VRAM ; $8000
51
+ ld bc, 8*256 ; the ASCII character set: 256 characters, each with 8 bytes of display data
52
+ call mem_CopyMono ; load tile data
53
+ ld a, LCDCF_ON|LCDCF_BG8000|LCDCF_BG9800|LCDCF_BGON|LCDCF_OBJ16|LCDCF_OBJOFF
54
+ ld [rLCDC], a
55
+ ld a, 32 ; ASCII FOR BLANK SPACE
56
+ ld hl, _SCRN0
57
+ ld bc, SCRN_VX_B * SCRN_VY_B
58
+ call mem_SetVRAM
59
+
60
+ ; main
61
+ ld hl,Title
62
+ ld de, _SCRN0+3+(SCRN_VY_B*7) ;
63
+ ld bc, TitleEnd-Title
64
+ call mem_CopyVRAM
65
+
66
+ wait:
67
+ halt
68
+ nop
69
+ jr wait
70
+
71
+ Title:
72
+ DB "tester + rubygb!"
73
+ TitleEnd:
74
+
75
+ StopLCD:
76
+ ld a,[rLCDC]
77
+ rlca
78
+ ret nc
79
+
80
+ .wait:
81
+ ld a,[rLY]
82
+ cp 145
83
+ jr nz,.wait
84
+
85
+
86
+ ld a,[rLCDC]
87
+ res 7,a
88
+ ld [rLCDC],a
89
+
90
+ ret
@@ -1,10 +1,10 @@
1
1
  ;File generated by rgblink
2
2
 
3
3
  00:0952 begin
4
- 00:099E StopLCD
4
+ 00:09A0 StopLCD
5
5
  00:0150 TileData
6
6
  00:0990 Title
7
- 00:099E TitleEnd
7
+ 00:09A0 TitleEnd
8
8
  00:007B mem_CopyMono
9
9
  00:008B mem_SetVRAM
10
10
  00:00A1 mem_CopyVRAM
@@ -0,0 +1,34 @@
1
+ [Gearboy]
2
+ ForceDMG=false
3
+ FullScreen=false
4
+ ScreenSize=2
5
+
6
+ [Input]
7
+ KeyA=83
8
+ KeyB=65
9
+ KeyDOWN=16777237
10
+ KeyLEFT=16777234
11
+ KeyNameA=S
12
+ KeyNameB=A
13
+ KeyNameDOWN=DOWN
14
+ KeyNameLEFT=LEFT
15
+ KeyNameRIGHT=RIGHT
16
+ KeyNameSELECT=SPACE
17
+ KeyNameSTART=RETURN
18
+ KeyNameUP=UP
19
+ KeyRIGHT=16777236
20
+ KeySELECT=32
21
+ KeySTART=16777220
22
+ KeyUP=16777235
23
+
24
+ [Sound]
25
+ SampleRate=1
26
+ SoundEnabled=true
27
+
28
+ [Video]
29
+ BilinearFiltering=false
30
+ DMGColor1=12108390
31
+ DMGColor2=8096306
32
+ DMGColor3=4413725
33
+ DMGColor4=1256467
34
+ MixFrames=true