diff options
author | PikalaxALT <PikalaxALT@gmail.com> | 2016-01-29 18:36:31 -0500 |
---|---|---|
committer | PikalaxALT <PikalaxALT@gmail.com> | 2016-01-29 18:36:31 -0500 |
commit | 2bf93c5905319e9181f87b3f83cd3bce7b9feeca (patch) | |
tree | 3ebf17c8879e5d6243d81aac8f1c36eb226fac26 /home/double_speed.asm | |
parent | ed3f9395f6d45f6554ed9d9c49c41ea86a8e2447 (diff) |
Import stuff from pokecrystal; diff gold and silver
Diffstat (limited to 'home/double_speed.asm')
-rw-r--r-- | home/double_speed.asm | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/home/double_speed.asm b/home/double_speed.asm new file mode 100644 index 00000000..c07dc9ce --- /dev/null +++ b/home/double_speed.asm @@ -0,0 +1,30 @@ +; The CGB hardware introduces Double Speed Mode. +; While active, the clock speed is doubled. + +; The hardware can switch between normal speed +; and double speed at any time, but LCD output +; collapses during the switch. + +DoubleSpeed:: ; 2fef + ld hl, rKEY1 + bit 7, [hl] + jr z, SwitchSpeed + ret +; 2ff7 + +NormalSpeed:: ; 2ff7 + ld hl, rKEY1 + bit 7, [hl] + ret z +; 2ffd + +SwitchSpeed:: ; 2ffd + set 0, [hl] + xor a + ld [rIF], a + ld [rIE], a + ld a, $30 + ld [rJOYP], a + stop ; rgbasm adds a nop after this instruction by default + ret +; 300b |