Fix usage of rIE and rSC constants
This commit is contained in:
@@ -50,17 +50,17 @@ Gen2ToGen1LinkComms:
|
||||
call DelayFrames
|
||||
xor a
|
||||
ldh [hSerialSend], a
|
||||
ld a, (0 << rSC_ON) | 1
|
||||
ld a, (0 << rSC_ON) | (1 << rSC_CLOCK)
|
||||
ldh [rSC], a
|
||||
ld a, (1 << rSC_ON) | 1
|
||||
ld a, (1 << rSC_ON) | (1 << rSC_CLOCK)
|
||||
ldh [rSC], a
|
||||
|
||||
call DelayFrame
|
||||
xor a
|
||||
ldh [hSerialSend], a
|
||||
ld a, (0 << rSC_ON) | 1
|
||||
ld a, (0 << rSC_ON) | (1 << rSC_CLOCK)
|
||||
ldh [rSC], a
|
||||
ld a, (1 << rSC_ON) | 1
|
||||
ld a, (1 << rSC_ON) | (1 << rSC_CLOCK)
|
||||
ldh [rSC], a
|
||||
|
||||
.player_1
|
||||
@@ -70,7 +70,7 @@ Gen2ToGen1LinkComms:
|
||||
call DelayFrames
|
||||
xor a
|
||||
ldh [rIF], a
|
||||
ld a, $8
|
||||
ld a, 1 << SERIAL
|
||||
ldh [rIE], a
|
||||
ld hl, wd1f3
|
||||
ld de, wEnemyMonSpecies
|
||||
@@ -90,7 +90,7 @@ Gen2ToGen1LinkComms:
|
||||
call Serial_ExchangeBytes
|
||||
xor a
|
||||
ldh [rIF], a
|
||||
ld a, $1d
|
||||
ld a, (1 << JOYPAD) | (1 << SERIAL) | (1 << TIMER) | (1 << VBLANK)
|
||||
ldh [rIE], a
|
||||
call Link_CopyRandomNumbers
|
||||
ld hl, wOTPlayerName
|
||||
@@ -194,17 +194,17 @@ Gen2ToGen2LinkComms:
|
||||
call DelayFrames
|
||||
xor a
|
||||
ldh [hSerialSend], a
|
||||
ld a, (0 << rSC_ON) | 1
|
||||
ld a, (0 << rSC_ON) | (1 << rSC_CLOCK)
|
||||
ldh [rSC], a
|
||||
ld a, (1 << rSC_ON) | 1
|
||||
ld a, (1 << rSC_ON) | (1 << rSC_CLOCK)
|
||||
ldh [rSC], a
|
||||
|
||||
call DelayFrame
|
||||
xor a
|
||||
ldh [hSerialSend], a
|
||||
ld a, (0 << rSC_ON) | 1
|
||||
ld a, (0 << rSC_ON) | (1 << rSC_CLOCK)
|
||||
ldh [rSC], a
|
||||
ld a, (1 << rSC_ON) | 1
|
||||
ld a, (1 << rSC_ON) | (1 << rSC_CLOCK)
|
||||
ldh [rSC], a
|
||||
|
||||
.Player1:
|
||||
@@ -214,7 +214,7 @@ Gen2ToGen2LinkComms:
|
||||
call DelayFrames
|
||||
xor a
|
||||
ldh [rIF], a
|
||||
ld a, $8
|
||||
ld a, 1 << SERIAL
|
||||
ldh [rIE], a
|
||||
ld hl, wd1f3
|
||||
ld de, wEnemyMonSpecies
|
||||
@@ -243,7 +243,7 @@ Gen2ToGen2LinkComms:
|
||||
.not_trading
|
||||
xor a
|
||||
ldh [rIF], a
|
||||
ld a, $1d
|
||||
ld a, (1 << JOYPAD) | (1 << SERIAL) | (1 << TIMER) | (1 << VBLANK)
|
||||
ldh [rIE], a
|
||||
ld de, MUSIC_NONE
|
||||
call PlayMusic
|
||||
@@ -447,7 +447,7 @@ Gen2ToGen2LinkComms:
|
||||
xor a
|
||||
ldh [rIF], a
|
||||
ldh a, [rIE]
|
||||
set 1, a
|
||||
set LCD_STAT, a
|
||||
ldh [rIE], a
|
||||
pop af
|
||||
ldh [rIF], a
|
||||
@@ -1558,9 +1558,9 @@ Function28b22:
|
||||
xor a
|
||||
ldh [rSB], a
|
||||
ldh [hSerialSend], a
|
||||
ld a, (0 << rSC_ON) | 1
|
||||
ld a, (0 << rSC_ON) | (1 << rSC_CLOCK)
|
||||
ldh [rSC], a
|
||||
ld a, (1 << rSC_ON) | 1
|
||||
ld a, (1 << rSC_ON) | (1 << rSC_CLOCK)
|
||||
ldh [rSC], a
|
||||
ret
|
||||
|
||||
@@ -2104,18 +2104,18 @@ WaitForOtherPlayerToExit:
|
||||
xor a
|
||||
ldh [rSB], a
|
||||
ldh [hSerialReceive], a
|
||||
ld a, (0 << rSC_ON) | 1
|
||||
ld a, (0 << rSC_ON) | (1 << rSC_CLOCK)
|
||||
ldh [rSC], a
|
||||
ld a, (1 << rSC_ON) | 1
|
||||
ld a, (1 << rSC_ON) | (1 << rSC_CLOCK)
|
||||
ldh [rSC], a
|
||||
ld c, 3
|
||||
call DelayFrames
|
||||
xor a
|
||||
ldh [rSB], a
|
||||
ldh [hSerialReceive], a
|
||||
ld a, (0 << rSC_ON) | 0
|
||||
ld a, (0 << rSC_ON) | (0 << rSC_CLOCK)
|
||||
ldh [rSC], a
|
||||
ld a, (1 << rSC_ON) | 0
|
||||
ld a, (1 << rSC_ON) | (0 << rSC_CLOCK)
|
||||
ldh [rSC], a
|
||||
ld c, 3
|
||||
call DelayFrames
|
||||
@@ -2131,7 +2131,7 @@ WaitForOtherPlayerToExit:
|
||||
push af
|
||||
xor a
|
||||
ldh [rIF], a
|
||||
ld a, $f
|
||||
ld a, IE_DEFAULT
|
||||
ldh [rIE], a
|
||||
pop af
|
||||
ldh [rIF], a
|
||||
@@ -2160,9 +2160,9 @@ SetBitsForTimeCapsuleRequest:
|
||||
ldh [rSB], a
|
||||
xor a
|
||||
ldh [hSerialReceive], a
|
||||
ld a, (0 << rSC_ON) | 0
|
||||
ld a, (0 << rSC_ON) | (0 << rSC_CLOCK)
|
||||
ldh [rSC], a
|
||||
ld a, (1 << rSC_ON) | 0
|
||||
ld a, (1 << rSC_ON) | (0 << rSC_CLOCK)
|
||||
ldh [rSC], a
|
||||
xor a ; LINK_TIMECAPSULE - 1
|
||||
ld [wPlayerLinkAction], a
|
||||
@@ -2177,9 +2177,9 @@ WaitForLinkedFriend:
|
||||
ldh [rSB], a
|
||||
xor a
|
||||
ldh [hSerialReceive], a
|
||||
ld a, (0 << rSC_ON) | 0
|
||||
ld a, (0 << rSC_ON) | (0 << rSC_CLOCK)
|
||||
ldh [rSC], a
|
||||
ld a, (1 << rSC_ON) | 0
|
||||
ld a, (1 << rSC_ON) | (0 << rSC_CLOCK)
|
||||
ldh [rSC], a
|
||||
call DelayFrame
|
||||
call DelayFrame
|
||||
@@ -2202,9 +2202,9 @@ WaitForLinkedFriend:
|
||||
ldh [rSB], a
|
||||
xor a
|
||||
ldh [hSerialReceive], a
|
||||
ld a, (0 << rSC_ON) | 0
|
||||
ld a, (0 << rSC_ON) | (0 << rSC_CLOCK)
|
||||
ldh [rSC], a
|
||||
ld a, (1 << rSC_ON) | 0
|
||||
ld a, (1 << rSC_ON) | (0 << rSC_CLOCK)
|
||||
ldh [rSC], a
|
||||
ld a, [wLinkTimeoutFrames]
|
||||
dec a
|
||||
@@ -2218,9 +2218,9 @@ WaitForLinkedFriend:
|
||||
.not_done
|
||||
ld a, $1
|
||||
ldh [rSB], a
|
||||
ld a, (0 << rSC_ON) | 1
|
||||
ld a, (0 << rSC_ON) | (1 << rSC_CLOCK)
|
||||
ldh [rSC], a
|
||||
ld a, (1 << rSC_ON) | 1
|
||||
ld a, (1 << rSC_ON) | (1 << rSC_CLOCK)
|
||||
ldh [rSC], a
|
||||
call DelayFrame
|
||||
jr .loop
|
||||
|
@@ -434,7 +434,7 @@ Function104bd0:
|
||||
xor a
|
||||
ldh [rIF], a
|
||||
ldh a, [rIE]
|
||||
or $1
|
||||
or 1 << VBLANK
|
||||
ldh [rIE], a
|
||||
ei
|
||||
call DelayFrame
|
||||
@@ -559,7 +559,7 @@ Function104d1c:
|
||||
xor a
|
||||
ldh [rIF], a
|
||||
ldh a, [rIE]
|
||||
or $1
|
||||
or 1 << VBLANK
|
||||
ldh [rIE], a
|
||||
ei
|
||||
call DelayFrame
|
||||
@@ -600,7 +600,7 @@ Function104d56:
|
||||
|
||||
Function104d5e:
|
||||
call Function104d74
|
||||
ld a, $4
|
||||
ld a, 1 << TIMER
|
||||
ldh [rIE], a
|
||||
xor a
|
||||
ldh [rIF], a
|
||||
|
@@ -56,7 +56,7 @@ PrintDexEntry:
|
||||
push af
|
||||
xor a
|
||||
ldh [rIF], a
|
||||
ld a, $9
|
||||
ld a, (1 << SERIAL) | (1 << VBLANK)
|
||||
ldh [rIE], a
|
||||
|
||||
call Printer_StartTransmission
|
||||
@@ -140,13 +140,13 @@ PrintPCBox:
|
||||
push af
|
||||
xor a
|
||||
ldh [rIF], a
|
||||
ld a, %1001
|
||||
ld a, (1 << SERIAL) | (1 << VBLANK)
|
||||
ldh [rIE], a
|
||||
|
||||
ld hl, hVBlank
|
||||
ld a, [hl]
|
||||
push af
|
||||
ld [hl], %0100
|
||||
ld [hl], 4
|
||||
|
||||
xor a
|
||||
ldh [hBGMapMode], a
|
||||
@@ -219,7 +219,7 @@ PrintUnownStamp:
|
||||
push af
|
||||
xor a
|
||||
ldh [rIF], a
|
||||
ld a, $9
|
||||
ld a, (1 << SERIAL) | (1 << VBLANK)
|
||||
ldh [rIE], a
|
||||
ld hl, hVBlank
|
||||
ld a, [hl]
|
||||
@@ -284,7 +284,7 @@ PrintMail:
|
||||
push af
|
||||
xor a
|
||||
ldh [rIF], a
|
||||
ld a, %1001
|
||||
ld a, (1 << SERIAL) | (1 << VBLANK)
|
||||
ldh [rIE], a
|
||||
|
||||
xor a
|
||||
@@ -326,7 +326,7 @@ PrintPartymon:
|
||||
push af
|
||||
xor a
|
||||
ldh [rIF], a
|
||||
ld a, %1001
|
||||
ld a, (1 << SERIAL) | (1 << VBLANK)
|
||||
ldh [rIE], a
|
||||
|
||||
xor a
|
||||
@@ -390,7 +390,7 @@ _PrintDiploma:
|
||||
push af
|
||||
xor a
|
||||
ldh [rIF], a
|
||||
ld a, %1001
|
||||
ld a, (1 << SERIAL) | (1 << VBLANK)
|
||||
ldh [rIE], a
|
||||
|
||||
ld hl, hVBlank
|
||||
@@ -458,9 +458,9 @@ CheckCancelPrint:
|
||||
ld [wPrinterOpcode], a
|
||||
ld a, $88
|
||||
ldh [rSB], a
|
||||
ld a, $1
|
||||
ld a, (0 << rSC_ON) | (1 << rSC_CLOCK)
|
||||
ldh [rSC], a
|
||||
ld a, $81
|
||||
ld a, (1 << rSC_ON) | (1 << rSC_CLOCK)
|
||||
ldh [rSC], a
|
||||
.loop2
|
||||
ld a, [wPrinterOpcode]
|
||||
|
@@ -279,9 +279,9 @@ Printer_WaitHandshake:
|
||||
ld [wPrinterOpcode], a
|
||||
ld a, $88
|
||||
ldh [rSB], a
|
||||
ld a, $1
|
||||
ld a, (0 << rSC_ON) | (1 << rSC_CLOCK)
|
||||
ldh [rSC], a
|
||||
ld a, $81
|
||||
ld a, (1 << rSC_ON) | (1 << rSC_CLOCK)
|
||||
ldh [rSC], a
|
||||
ret
|
||||
|
||||
@@ -622,9 +622,9 @@ Printer_Send0x08:
|
||||
|
||||
Printer_SerialSend:
|
||||
ldh [rSB], a
|
||||
ld a, $1 ; switch to internal clock
|
||||
ld a, (0 << rSC_ON) | (1 << rSC_CLOCK)
|
||||
ldh [rSC], a
|
||||
ld a, $81 ; start transfer
|
||||
ld a, (1 << rSC_ON) | (1 << rSC_CLOCK)
|
||||
ldh [rSC], a
|
||||
ret
|
||||
|
||||
|
Reference in New Issue
Block a user