From 237aeb8fbdb204948d611830565d4a00c6b0ab70 Mon Sep 17 00:00:00 2001 From: xCrystal Date: Sat, 30 Dec 2017 01:54:27 +0100 Subject: Add space between arguments in assembly instructions and remove redundant a in instructions like add a, x --- engine/palettes.asm | 48 ++++++++++++++++++++++++------------------------ 1 file changed, 24 insertions(+), 24 deletions(-) (limited to 'engine/palettes.asm') diff --git a/engine/palettes.asm b/engine/palettes.asm index 1ac5e56a..4808776e 100755 --- a/engine/palettes.asm +++ b/engine/palettes.asm @@ -325,11 +325,11 @@ UpdatePartyMenuBlkPacket: SendSGBPacket: ;check number of packets - ld a,[hl] - and a,$07 + ld a, [hl] + and $07 ret z ; store number of packets in B - ld b,a + ld b, a .loop2 ; save B for later use push bc @@ -338,46 +338,46 @@ SendSGBPacket: ld [hDisableJoypadPolling], a ; send RESET signal (P14=LOW, P15=LOW) xor a - ld [rJOYP],a + ld [rJOYP], a ; set P14=HIGH, P15=HIGH - ld a,$30 - ld [rJOYP],a + ld a, $30 + ld [rJOYP], a ;load length of packets (16 bytes) - ld b,$10 + ld b, $10 .nextByte ;set bit counter (8 bits per byte) - ld e,$08 + ld e, $08 ; get next byte in the packet - ld a,[hli] - ld d,a + ld a, [hli] + ld d, a .nextBit0 - bit 0,d + bit 0, d ; if 0th bit is not zero set P14=HIGH,P15=LOW (send bit 1) - ld a,$10 - jr nz,.next0 + ld a, $10 + jr nz, .next0 ; else (if 0th bit is zero) set P14=LOW,P15=HIGH (send bit 0) - ld a,$20 + ld a, $20 .next0 - ld [rJOYP],a + ld [rJOYP], a ; must set P14=HIGH,P15=HIGH between each "pulse" - ld a,$30 - ld [rJOYP],a + ld a, $30 + ld [rJOYP], a ; rotation will put next bit in 0th position (so we can always use command ; "bit 0,d" to fetch the bit that has to be sent) rr d ; decrease bit counter so we know when we have sent all 8 bits of current byte dec e - jr nz,.nextBit0 + jr nz, .nextBit0 dec b - jr nz,.nextByte + jr nz, .nextByte ; send bit 1 as a "stop bit" (end of parameter data) - ld a,$20 - ld [rJOYP],a + ld a, $20 + ld [rJOYP], a ; set P14=HIGH,P15=HIGH - ld a,$30 - ld [rJOYP],a + ld a, $30 + ld [rJOYP], a xor a - ld [hDisableJoypadPolling],a + ld [hDisableJoypadPolling], a ; wait for about 70000 cycles call Wait7000 ; restore (previously pushed) number of packets -- cgit v1.3.1-sl0p