retrograph 0.5-x86-mswin32

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.
Files changed (42) hide show
  1. data/COPYING +19 -0
  2. data/README +264 -0
  3. data/Rakefile +71 -0
  4. data/ext/retrograph/extconf.rb +6 -0
  5. data/ext/retrograph/retrograph.c +324 -0
  6. data/lib/retrograph/sdl.rb +26 -0
  7. data/lib/retrograph.rb +29 -0
  8. data/lib/retrograph.so +0 -0
  9. data/spec/image-specs/color-blue-bits.case +2 -0
  10. data/spec/image-specs/color-blue-bits.png +0 -0
  11. data/spec/image-specs/color-green-bits.case +2 -0
  12. data/spec/image-specs/color-green-bits.png +0 -0
  13. data/spec/image-specs/color-red-bits.case +2 -0
  14. data/spec/image-specs/color-red-bits.png +0 -0
  15. data/spec/image-specs/default-screen-black.case +1 -0
  16. data/spec/image-specs/default-screen-black.png +0 -0
  17. data/spec/image-specs/default-screen-color-0.case +2 -0
  18. data/spec/image-specs/default-screen-color-0.png +0 -0
  19. data/spec/image-specs/scroll-mode1.case +7 -0
  20. data/spec/image-specs/scroll-mode1.png +0 -0
  21. data/spec/image-specs/scroll-mode2.case +10 -0
  22. data/spec/image-specs/scroll-mode2.png +0 -0
  23. data/spec/image-specs/scroll-mode3.case +10 -0
  24. data/spec/image-specs/scroll-mode3.png +0 -0
  25. data/spec/image-specs/sprites-doubling.case +5 -0
  26. data/spec/image-specs/sprites-doubling.png +0 -0
  27. data/spec/image-specs/sprites-mode2.case +8 -0
  28. data/spec/image-specs/sprites-mode2.png +0 -0
  29. data/spec/image-specs/sprites-mode3.case +8 -0
  30. data/spec/image-specs/sprites-mode3.png +0 -0
  31. data/spec/image-specs/sprites-ordering.case +5 -0
  32. data/spec/image-specs/sprites-ordering.png +0 -0
  33. data/spec/image-specs/text-colors.case +5 -0
  34. data/spec/image-specs/text-colors.png +0 -0
  35. data/spec/image-specs/tile-attributes-mode2.case +9 -0
  36. data/spec/image-specs/tile-attributes-mode2.png +0 -0
  37. data/spec/image-specs/tile-attributes-mode3.case +9 -0
  38. data/spec/image-specs/tile-attributes-mode3.png +0 -0
  39. data/spec/retrograph_spec.rb +134 -0
  40. data/src/retrograph.c +697 -0
  41. data/src/retrograph.h +67 -0
  42. metadata +99 -0
data/src/retrograph.h ADDED
@@ -0,0 +1,67 @@
1
+ /* retrograph
2
+ *
3
+ * Copyright (c) 2009 MenTaLguY <mental@rydia.net>
4
+ *
5
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ * of this software and associated documentation files (the "Software"), to deal
7
+ * in the Software without restriction, including without limitation the rights
8
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ * copies of the Software, and to permit persons to whom the Software is
10
+ * furnished to do so, subject to the following conditions:
11
+ *
12
+ * The above copyright notice and this permission notice shall be included in
13
+ * all copies or substantial portions of the Software.
14
+ *
15
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ * THE SOFTWARE.
22
+ */
23
+ #ifndef SEEN_RETROGRAPH_H
24
+ #define SEEN_RETROGRAPH_H
25
+
26
+ #include <stdlib.h>
27
+ #include <stdint.h>
28
+
29
+ #define RETROGRAPH_DISPLAY_WIDTH 256
30
+ #define RETROGRAPH_DISPLAY_HEIGHT 224
31
+
32
+ typedef uint32_t retrograph_pixel_t;
33
+ #define RETROGRAPH_BYTES_PER_PIXEL sizeof(retrograph_pixel_t)
34
+ #define RETROGRAPH_BITS_PER_PIXEL (RETROGRAPH_BYTES_PER_PIXEL * 8)
35
+
36
+ #define RETROGRAPH_RED_SHIFT 16
37
+ #define RETROGRAPH_GREEN_SHIFT 8
38
+ #define RETROGRAPH_BLUE_SHIFT 0
39
+
40
+ #define RETROGRAPH_RED_MASK (0xff << RETROGRAPH_RED_SHIFT)
41
+ #define RETROGRAPH_GREEN_MASK (0xff << RETROGRAPH_GREEN_SHIFT)
42
+ #define RETROGRAPH_BLUE_MASK (0xff << RETROGRAPH_BLUE_SHIFT)
43
+ #define RETROGRAPH_ALPHA_MASK 0x00
44
+
45
+ typedef struct retrograph_vdu_tag *retrograph_vdu_t;
46
+
47
+ typedef uint16_t retrograph_addr_t;
48
+
49
+ typedef enum {
50
+ RETROGRAPH_OK=0,
51
+ RETROGRAPH_NO_MEMORY,
52
+ RETROGRAPH_INVALID_ARGUMENT
53
+ } retrograph_error_t;
54
+
55
+ retrograph_vdu_t retrograph_new(void);
56
+ void retrograph_ref(retrograph_vdu_t vdu);
57
+ void retrograph_destroy(retrograph_vdu_t vdu);
58
+
59
+ retrograph_error_t retrograph_get_error(retrograph_vdu_t vdu);
60
+
61
+ void retrograph_write(retrograph_vdu_t vdu, retrograph_addr_t start_address,
62
+ void const *data, size_t n_bytes);
63
+ void retrograph_begin_frame(retrograph_vdu_t vdu);
64
+ void retrograph_render_scanline(retrograph_vdu_t vdu, void *dest,
65
+ size_t dest_size);
66
+
67
+ #endif
metadata ADDED
@@ -0,0 +1,99 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: retrograph
3
+ version: !ruby/object:Gem::Version
4
+ version: "0.5"
5
+ platform: x86-mswin32
6
+ authors:
7
+ - MenTaLguY <mental@rydia.net>
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+
12
+ date: 2009-07-24 00:00:00 -04:00
13
+ default_executable:
14
+ dependencies: []
15
+
16
+ description: |
17
+ Retrograph is a software scanline renderer which simulates a late-era 8-bit
18
+ display. Its graphical capabilities are similar to those of the Sega Master
19
+ System.
20
+
21
+ email: mental@rydia.net
22
+ executables: []
23
+
24
+ extensions: []
25
+
26
+ extra_rdoc_files: []
27
+
28
+ files:
29
+ - Rakefile
30
+ - README
31
+ - COPYING
32
+ - src/retrograph.h
33
+ - src/retrograph.c
34
+ - lib/retrograph.rb
35
+ - lib/retrograph/sdl.rb
36
+ - ext/retrograph/extconf.rb
37
+ - ext/retrograph/retrograph.c
38
+ - spec/retrograph_spec.rb
39
+ - spec/image-specs/sprites-doubling.case
40
+ - spec/image-specs/text-colors.case
41
+ - spec/image-specs/scroll-mode3.case
42
+ - spec/image-specs/scroll-mode1.case
43
+ - spec/image-specs/color-blue-bits.case
44
+ - spec/image-specs/sprites-mode3.case
45
+ - spec/image-specs/scroll-mode2.case
46
+ - spec/image-specs/default-screen-black.case
47
+ - spec/image-specs/color-red-bits.case
48
+ - spec/image-specs/default-screen-color-0.case
49
+ - spec/image-specs/tile-attributes-mode3.case
50
+ - spec/image-specs/color-green-bits.case
51
+ - spec/image-specs/tile-attributes-mode2.case
52
+ - spec/image-specs/sprites-ordering.case
53
+ - spec/image-specs/sprites-mode2.case
54
+ - spec/image-specs/tile-attributes-mode2.png
55
+ - spec/image-specs/text-colors.png
56
+ - spec/image-specs/color-red-bits.png
57
+ - spec/image-specs/default-screen-black.png
58
+ - spec/image-specs/color-blue-bits.png
59
+ - spec/image-specs/sprites-ordering.png
60
+ - spec/image-specs/scroll-mode1.png
61
+ - spec/image-specs/default-screen-color-0.png
62
+ - spec/image-specs/sprites-doubling.png
63
+ - spec/image-specs/scroll-mode3.png
64
+ - spec/image-specs/color-green-bits.png
65
+ - spec/image-specs/sprites-mode3.png
66
+ - spec/image-specs/sprites-mode2.png
67
+ - spec/image-specs/tile-attributes-mode3.png
68
+ - spec/image-specs/scroll-mode2.png
69
+ - lib/retrograph.so
70
+ has_rdoc: true
71
+ homepage: http://rubyforge.org/projects/retrograph
72
+ licenses: []
73
+
74
+ post_install_message:
75
+ rdoc_options: []
76
+
77
+ require_paths:
78
+ - lib
79
+ required_ruby_version: !ruby/object:Gem::Requirement
80
+ requirements:
81
+ - - ~>
82
+ - !ruby/object:Gem::Version
83
+ version: 1.8.6
84
+ version:
85
+ required_rubygems_version: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - ">="
88
+ - !ruby/object:Gem::Version
89
+ version: "0"
90
+ version:
91
+ requirements: []
92
+
93
+ rubyforge_project: retrograph
94
+ rubygems_version: 1.3.4
95
+ signing_key:
96
+ specification_version: 3
97
+ summary: Retrograph, a retrodisplay.
98
+ test_files: []
99
+