File tree Expand file tree Collapse file tree 4 files changed +46
-2
lines changed
Expand file tree Collapse file tree 4 files changed +46
-2
lines changed Original file line number Diff line number Diff line change 11EmuScreenPtrVRAM EQU $9842
22GameTitlePtrVRAM EQU $99AA
3+ NonCGBPtrVRAM EQU $98A2
34
45CursorTileNo EQU $AB
56
Original file line number Diff line number Diff line change @@ -27,6 +27,9 @@ SECTION "Entry Point", ROM0[$100]
2727
2828SECTION "Main" , ROM0 [ $ 150 ]
2929Main::
30+ ; Store initial value of L in RAM
31+ ld [ wInitialRegA ], a
32+
3033 ; Wait for VBlank, disable LCD
3134 ldh a , [ rLY ]
3235 cp SCRN_Y
@@ -47,5 +50,42 @@ Main::
4750 call InitPalettes
4851 call InitFont
4952
53+ ; Check if running in CGB mode
54+ ld a , [ wInitialRegA ]
55+ cp BOOTUP_A_CGB
56+ jp nz , ScreenNonCGB
57+
5058 ; Jump to Selection Menu Initialization
51- jp StartSelectionMenu
59+ jp StartSelectionMenu
60+
61+ ScreenNonCGB::
62+ ; Initialize DMG Palette
63+ ld a , % 11010100
64+ ld [ rBGP ], a
65+
66+ ; Print CGB-only text to screen
67+ ld hl , (NonCGBPtrVRAM)
68+ ld de , strNonCGB1
69+ call PrintString
70+ ld hl , (NonCGBPtrVRAM + $ 40 )
71+ ld de , strNonCGB2
72+ call PrintString
73+ ld hl , (NonCGBPtrVRAM + $ 80 )
74+ ld de , strNonCGB3
75+ call PrintString
76+
77+ ; Initialize LCD and clear IF/IE
78+ xor a
79+ ldh [ rIF ], a
80+ ldh [ rIE ], a
81+ ld a , LCDCF_ON | LCDCF_BGON | LCDCF_BG8000
82+ ldh [ rLCDC ], a
83+ ei
84+ nop
85+
86+ ; HALT infinitely
87+ halt
88+
89+ strNonCGB1: db "THIS SOFTWARE IS" , 0
90+ strNonCGB2: db "INTENDED FOR USE" , 0
91+ strNonCGB3: db "ON GAMEBOY COLOR" , 0
Original file line number Diff line number Diff line change @@ -37,4 +37,7 @@ wSelectionPage:: db
3737wSelectionCursorPos:: db
3838wInputCooldown:: db
3939wPageTitles:: db
40- wAllowInput:: db
40+ wAllowInput:: db
41+
42+ SECTION "Other Variables" , WRAM0
43+ wInitialRegA:: db
You can’t perform that action at this time.
0 commit comments