Browse Source

Spiffy up console detection

master
mid-kid 4 years ago
parent
commit
998363c01f
  1. 5
      .gitignore
  2. 7
      .tags
  3. 21
      source/home/start.asm

5
.gitignore

@ -0,0 +1,5 @@
/*.gb
/*.map
/*.sym
/build
/.tags

7
.tags

@ -1,7 +0,0 @@
!_TAG_FILE_FORMAT 2 /extended format; --format=1 will not append ;" to lines/
!_TAG_FILE_SORTED 1 /0=unsorted, 1=sorted, 2=foldcase/
!_TAG_OUTPUT_MODE u-ctags /u-ctags or e-ctags/
!_TAG_PROGRAM_AUTHOR Universal Ctags Team //
!_TAG_PROGRAM_NAME Universal Ctags /Derived from Exuberant Ctags/
!_TAG_PROGRAM_URL https://ctags.io/ /official site/
!_TAG_PROGRAM_VERSION 0.0.0 //

21
source/home/start.asm

@ -24,28 +24,23 @@ _start:
di
; Attempt to detect console model
cp $ff
jr z, .console_mgb
ld c, console_agb
cp $11
jr z, .console_cgb
ld a, console_dmg
jr .console_end
.console_mgb
ld a, console_mgb
dec c
dec c ; console_mgb
cp $ff
jr z, .console_end
dec c ; console_dmg
jr .console_end
.console_cgb
dec b
jr z, .console_agb
ld a, console_cgb
jr .console_end
.console_agb
ld a, console_agb
dec c ; console_cgb
.console_end
ld a, c
ldh [h_console], a
xor a

Loading…
Cancel
Save