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 di
; Attempt to detect console model ; Attempt to detect console model
cp $ff ld c, console_agb
jr z, .console_mgb
cp $11 cp $11
jr z, .console_cgb jr z, .console_cgb
dec c
ld a, console_dmg dec c ; console_mgb
jr .console_end cp $ff
jr z, .console_end
.console_mgb dec c ; console_dmg
ld a, console_mgb
jr .console_end jr .console_end
.console_cgb .console_cgb
dec b dec b
jr z, .console_agb jr z, .console_agb
ld a, console_cgb dec c ; console_cgb
jr .console_end
.console_agb
ld a, console_agb
.console_end .console_end
ld a, c
ldh [h_console], a ldh [h_console], a
xor a xor a

Loading…
Cancel
Save