Skip to content

Commit ea902ef

Browse files
rawr51919evie-calicoISSOtmavivace
authored
Update README.md to add intentions and revision policy (#30)
Co-authored-by: Eievui <[email protected]> Co-authored-by: Eldred Habert <[email protected]> Co-authored-by: Antonio Vivace <[email protected]>
1 parent 98729d0 commit ea902ef

File tree

2 files changed

+29
-7
lines changed

2 files changed

+29
-7
lines changed

README.md

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,28 @@
11
# `hardware.inc`
22
### Gameboy Hardware definitions
3-
`hardware.inc` has been the standard include file containing Game Boy hardware definitions for use in [rgbds](https://github.com/gbdev/rgbds) projects for over 20 years.
3+
`hardware.inc` has been the standard include file containing Game Boy hardware definitions for use in [RGBDS](https://rgbds.gbdev.io) projects for over 20 years.
44

55
The file was originally created by Jeff Frohwein in 1997, who still hosts [his latest version (2.3)](http://www.devrs.com/gb/files/hardware.zip) on his great [Dev'rs](http://devrs.com) website.
66

77
Although Jeff tried to version control the file with a rudimentary change log at the top of the file, people have added small changes throughout the years, often without bumping the version number.
88

9-
This repo is an attempt at version control, using [@AntonioND](http://github.com/AntonioND) fork as baseline.
9+
This repo has become the new official reference for `hardware.inc`, using [@AntonioND](http://github.com/AntonioND)'s fork as the baseline.
10+
11+
## Contributing
12+
13+
This repository's `master` branch should be considered production;
14+
Each commit represents a new release, requiring the embedded version number to be bumped (and an entry to be added to the changelog at the beginning of the file).
15+
16+
We follow [semantic versioning](https://semver.org);
17+
Breaking changes (such as those in [72ec03f](https://github.com/gbdev/hardware.inc/commit/72ec03f835e72be83a1ef189a4a9eac0fbdf39e2)) increase the major version, backwards-compatible changes (typically additions) only increase the minor version, and bugfixes only increase the patch level.
18+
19+
Changes to the comments should be considered a bugfix.
1020

1121
## Contributors
1222

1323
* Jones (created the original `hardware.inc`, now lost)
1424
* Carsten Sørensen (whose ideas Jeff based his file on)
1525
* Jeff Frohwein
1626
* AntonioND
17-
* BlitterObjectBob, tobiasvl, ISSOtm, avivace, GreenAndEievui, QuinnPainter, rondnelson99, daid, Hacktix, sukus21, alvaro-cuesta, basxto
27+
* BlitterObjectBob, tobiasvl, ISSOtm, avivace, Eievui, QuinnPainter, rondnelson99, daid, Hacktix, sukus21, alvaro-cuesta, basxto
1828
* Probably lots of other people who have added to the file throughout the years

hardware.inc

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@
3333
;* Rev 4.5 - 03-Mar-22 : Added bit number definitions for OCPS, BCPS and LCDC (sukus)
3434
;* Rev 4.6 - 15-Jun-22 : Added MBC3 registers and special values
3535

36+
; NOTE: REVISION NUMBER CHANGES MUST BE REFLECTED
37+
; IN `rev_Check_hardware_inc` BELOW!
38+
3639
IF __RGBDS_MAJOR__ == 0 && __RGBDS_MINOR__ < 5
3740
FAIL "This version of 'hardware.inc' requires RGBDS version 0.5.0 or later."
3841
ENDC
@@ -42,12 +45,21 @@ ENDC
4245
IF !DEF(HARDWARE_INC)
4346
DEF HARDWARE_INC EQU 1
4447

48+
; Usage: rev_Check_hardware_inc <min_ver>
49+
; Examples: rev_Check_hardware_inc 4.1.2
50+
; rev_Check_hardware_inc 4.1 (equivalent to 4.1.0)
51+
; rev_Check_hardware_inc 4 (equivalent to 4.0.0)
4552
MACRO rev_Check_hardware_inc
46-
;NOTE: REVISION NUMBER CHANGES MUST BE ADDED
47-
;TO SECOND PARAMETER IN FOLLOWING LINE.
48-
IF \1 > 4.6 ;PUT REVISION NUMBER HERE
49-
WARN "Version \1 or later of 'hardware.inc' is required."
53+
DEF CUR_VER equs "4,6,0" ; ** UPDATE THIS LINE WHEN CHANGING THE REVISION NUMBER **
54+
DEF MIN_VER equs STRRPL("\1", ".", ",")
55+
DEF INTERNAL_CHK equs """MACRO ___internal
56+
IF \\1 != \\4 || \\2 < \\5 || (\\2 == \\5 && \\3 < \\6)
57+
FAIL "Version \\1.\\2.\\3 of 'hardware.inc' is incompatible with requested version \\4.\\5.\\6"
5058
ENDC
59+
\nENDM"""
60+
INTERNAL_CHK
61+
___internal {CUR_VER}, {MIN_VER},0,0
62+
PURGE CUR_VER, MIN_VER, INTERNAL_CHK, ___internal
5163
ENDM
5264

5365

0 commit comments

Comments
 (0)