26
26
;* Rev 2.9 - 28-Feb-20 : Added utility rP1 constants
27
27
;* Rev 3.0 - 27-Aug-20 : Register ordering, byte-based sizes, OAM additions, general cleanup (Blitter Object)
28
28
;* Rev 4.0 - 03-May-21 : Updated to use RGBDS 0.5.0 syntax, changed IEF_LCDC to IEF_STAT (Eievui)
29
+ ;* Rev 4.1 - 16-Aug-21 : Added more flags, bit number defines, and offset constants for OAM and window positions (rondnelson99)
29
30
30
31
IF __RGBDS_MAJOR__ == 0 && __RGBDS_MINOR__ < 5
31
32
FAIL "This version of 'hardware.inc' requires RGBDS version 0.5.0 or later."
@@ -39,7 +40,7 @@ DEF HARDWARE_INC EQU 1
39
40
MACRO rev_Check_hardware_inc
40
41
;NOTE: REVISION NUMBER CHANGES MUST BE ADDED
41
42
;TO SECOND PARAMETER IN FOLLOWING LINE.
42
- IF \1 > 4 .0 ;PUT REVISION NUMBER HERE
43
+ IF \1 > 4 .1 ;PUT REVISION NUMBER HERE
43
44
WARN "Version \1 or later of 'hardware.inc' is required."
44
45
ENDC
45
46
ENDM
@@ -103,6 +104,13 @@ DEF rSB EQU $FF01
103
104
; --
104
105
DEF rSC EQU $FF02
105
106
107
+ DEF SCF_START EQU %10000000 ;Transfer Start Flag (1=Transfer in progress, or requested)
108
+ DEF SCF_SPEED EQU %00000010 ;Clock Speed (0=Normal, 1=Fast) ** CGB Mode Only **
109
+ DEF SCF_SOURCE EQU %00000001 ;Shift Clock (0=External Clock, 1=Internal Clock)
110
+
111
+ DEF SCB_START EQU 7
112
+ DEF SCB_SPEED EQU 1
113
+ DEF SCB_SOURCE EQU 0
106
114
107
115
; --
108
116
; -- DIV ($FF04)
@@ -452,6 +460,12 @@ DEF STATF_OAM EQU %00000010 ; OAM-RAM is used by system
452
460
DEF STATF_LCD EQU %00000011 ; Both OAM and VRAM used by system
453
461
DEF STATF_BUSY EQU %00000010 ; When set, VRAM access is unsafe
454
462
463
+ DEF STATB_LYC EQU 6
464
+ DEF STATB_MODE10 EQU 5
465
+ DEF STATB_MODE01 EQU 4
466
+ DEF STATB_MODE00 EQU 3
467
+ DEF STATB_LYCF EQU 2
468
+ DEF STATB_BUSY EQU 1
455
469
456
470
; --
457
471
; -- SCY ($FF42)
@@ -542,6 +556,8 @@ DEF rWY EQU $FF4A
542
556
; --
543
557
DEF rWX EQU $FF4B
544
558
559
+ DEF WX_OFS EQU 7 ; add this to a screen position to get a WX position
560
+
545
561
546
562
; --
547
563
; -- SPEED ($FF4D)
@@ -696,6 +712,12 @@ DEF IEF_TIMER EQU %00000100 ; Timer Overflow
696
712
DEF IEF_STAT EQU %00000010 ; STAT
697
713
DEF IEF_VBLANK EQU %00000001 ; V-Blank
698
714
715
+ DEF IEB_HILO EQU 4
716
+ DEF IEB_SERIAL EQU 3
717
+ DEF IEB_TIMER EQU 2
718
+ DEF IEB_STAT EQU 1
719
+ DEF IEB_VBLANK EQU 0
720
+
699
721
700
722
;***************************************************************************
701
723
;*
@@ -879,12 +901,15 @@ DEF SCRN_VY_B EQU 32 ; Virtual height of screen in bytes
879
901
; OAM attributes
880
902
; each entry in OAM RAM is 4 bytes (sizeof_OAM_ATTRS)
881
903
RSRESET
882
- DEF OAMA_Y RB 1 ; y pos
883
- DEF OAMA_X RB 1 ; x pos
904
+ DEF OAMA_Y RB 1 ; y pos plus 16
905
+ DEF OAMA_X RB 1 ; x pos plus 8
884
906
DEF OAMA_TILEID RB 1 ; tile id
885
907
DEF OAMA_FLAGS RB 1 ; flags (see below)
886
908
DEF sizeof_OAM_ATTRS RB 0
887
909
910
+ DEF OAM_Y_OFS EQU 16 ; add this to a screen-relative Y position to get an OAM Y position
911
+ DEF OAM_X_OFS EQU 8 ; add this to a screen-relative X position to get an OAM X position
912
+
888
913
DEF OAM_COUNT EQU 40 ; number of OAM entries in OAM RAM
889
914
890
915
; flags
919
944
920
945
DEF IEF_LCDC EQU %00000010 ; LCDC (see STAT)
921
946
922
- ENDC ;HARDWARE_INC
947
+ ENDC ;HARDWARE_INC
0 commit comments