Prev: A98E Up: Map Next: AC13
A992: Blit an object (from object data node), correctly on screen adjusting for compass and position.
Input
IX Address of object data node
Output
ObjNode_BlitShft A992 PUSH IX
A994 LD (ObjNode_BlitType),A
A997 CP $01
A999 JR Z,ObjNode_BlitShft_0
A99B LD L,(IX+$0C)
A99E CALL Bitmap_CopyFrame
A9A1 LD HL,(Bitmap_InfoCache)
A9A4 LD (TempAl),HL
ObjNode_BlitShft_0 A9A7 LD L,(IX+$0B) Cache the bitmap info
A9AA CALL Bitmap_CopyFrame
A9AD LD A,(HL) Get the width
A9AE AND $7F
A9B0 LD (TempBh),A
A9B3 LD E,A
A9B4 LD D,$00
A9B6 LD (_a98e),DE
A9BA DEC HL Get the height in pixels and convert into cells.
A9BB LD A,(HL)
A9BC AND $7F
A9BE RLA
A9BF RLA
A9C0 RLA
A9C1 LD (TempBl),A
A9C4 LD HL,(Bitmap_InfoCache) Get the bitmap address.
A9C7 PUSH HL
Calculate position on screen.
A9C8 LD A,(Camera_Compass)
A9CB BIT 0,A Test for E/W facing camera.
A9CD JR Z,ObjNode_BlitShft_1
A9CF LD HL,(Coords_NS) Based on players position N/S
A9D2 LD E,(IX+$05)
A9D5 LD D,(IX+$06)
A9D8 JR ObjNode_BlitShft_2
ObjNode_BlitShft_1 A9DA LD HL,(Coords_EW) Based on players position E/W
A9DD LD E,(IX+$07)
A9E0 LD D,(IX+$08)
ObjNode_BlitShft_2 A9E3 BIT 1,A Test for E/S facing camera.
A9E5 JR NZ,ObjNode_BlitShft_3
A9E7 EX DE,HL Swap around values for calculating difference.
ObjNode_BlitShft_3 A9E8 AND A
A9E9 SBC HL,DE Difference will give offset, left or right, of camera.
A9EB LD DE,$0020
A9EE ADD HL,DE
A9EF LD DE,(_a98e)
A9F3 AND A
A9F4 SBC HL,DE
A9F6 JP P,ObjNode_BlitShft_4
A9F9 LD A,$01
A9FB LD ($A990),A
A9FE LD E,L
A9FF LD D,H
AA00 LD A,L
AA01 CPL
AA02 LD C,A
AA03 LD A,H
AA04 CPL
AA05 LD B,A
AA06 INC BC
AA07 INC BC
AA08 SRA B
AA0A RR C
AA0C LD HL,(TempAl)
AA0F ADD HL,BC
AA10 LD (TempAl),HL
AA13 POP HL
AA14 ADD HL,BC
AA15 PUSH HL
AA16 LD A,(TempBh)
AA19 SUB C
AA1A LD (TempBh),A
AA1D XOR A
AA1E JR ObjNode_BlitShft_6
ObjNode_BlitShft_4 AA20 XOR A
AA21 LD ($A990),A
AA24 LD E,L
AA25 LD D,H
AA26 SRA H
AA28 RR L
AA2A LD BC,$0020
AA2D AND A
AA2E SBC HL,BC
AA30 LD BC,(_a98e)
AA34 AND A
AA35 ADC HL,BC
AA37 JP M,ObjNode_BlitShft_5
AA3A LD A,(TempBh)
AA3D SUB L
AA3E LD (TempBh),A
AA41 LD A,$02
AA43 LD ($A990),A
ObjNode_BlitShft_5 AA46 LD A,E
AA47 AND $FE
AA49 RRA
ObjNode_BlitShft_6 AA4A LD L,(IX+$09)
AA4D LD H,$00
AA4F ADD HL,HL
AA50 LD C,L
AA51 LD B,H
AA52 ADD HL,HL
AA53 ADD HL,HL
AA54 ADD HL,HL
AA55 ADD HL,HL
AA56 ADD HL,BC
AA57 LD C,A
AA58 LD B,$00
AA5A ADD HL,BC
AA5B LD BC,Offscreen_TopLine
AA5E ADD HL,BC
AA5F LD A,(ObjNode_BlitType)
AA62 AND A
AA63 JR NZ,ObjNode_BlitShft_12
AA65 PUSH DE
AA66 PUSH HL
AA67 LD A,(TempBh)
AA6A LD C,A
AA6B BIT 0,E
AA6D JR Z,ObjNode_BlitShft_7
AA6F LD A,($A990)
AA72 BIT 1,A
AA74 JR NZ,ObjNode_BlitShft_7
AA76 INC C
ObjNode_BlitShft_7 AA77 PUSH IX
AA79 LD IX,Actors_background
ObjNode_BlitShft_8 AA7D LD A,(IX+$00)
AA80 OR (IX+$01)
AA83 JR Z,ObjNode_BlitShft_10
AA85 LD E,(IX+$03)
AA88 LD D,$00
AA8A LD B,(IX+$02)
ObjNode_BlitShft_9 AA8D ADD IX,DE
AA8F DJNZ ObjNode_BlitShft_9
AA91 LD DE,$0004
AA94 ADD IX,DE
AA96 JR ObjNode_BlitShft_8
ObjNode_BlitShft_10 AA98 LD (IX+$00),L
AA9B LD (IX+$01),H
AA9E LD (IX+$02),C
AAA1 LD A,(TempBl)
AAA4 LD (IX+$03),A
AAA7 LD DE,$0004
AAAA ADD IX,DE
AAAC PUSH IX
AAAE POP DE
AAAF LD B,$00
ObjNode_BlitShft_11 AAB1 PUSH BC
AAB2 PUSH HL
AAB3 LDIR
AAB5 POP HL
AAB6 LD BC,$0022
AAB9 ADD HL,BC
AABA POP BC
AABB DEC A
AABC JR NZ,ObjNode_BlitShft_11
AABE LD (DE),A
AABF INC DE
AAC0 LD (DE),A
AAC1 POP IX
AAC3 POP HL
AAC4 POP DE
ObjNode_BlitShft_12 AAC5 BIT 0,E
AAC7 JR NZ,ObjNode_BlitShft_13
AAC9 LD A,(ObjNode_BlitType)
AACC AND A
AACD JR Z,ObjNode_BlitShft_14
AACF CP $01
AAD1 JP Z,ObjNode_BlitShft_23
AAD4 CP $02
AAD6 JP Z,ObjNode_BlitShft_30
AAD9 POP IX
AADB RET
ObjNode_BlitShft_13 AADC LD A,(ObjNode_BlitType)
AADF AND A
AAE0 JR Z,ObjNode_BlitShft_17
AAE2 CP $01
AAE4 JP Z,ObjNode_BlitShft_25
AAE7 CP $02
AAE9 JP Z,ObjNode_BlitShft_30
AAEC POP IX
AAEE RET
ObjNode_BlitShft_14 AAEF LD BC,(TempBl)
AAF3 LD DE,(TempAl)
AAF7 POP IX
ObjNode_BlitShft_15 AAF9 PUSH BC
AAFA PUSH HL
AAFB PUSH DE
AAFC PUSH IX
ObjNode_BlitShft_16 AAFE LD A,(DE)
AAFF AND (HL)
AB00 OR (IX+$00)
AB03 LD (HL),A
AB04 INC DE
AB05 INC HL
AB06 INC IX
AB08 DJNZ ObjNode_BlitShft_16
AB0A LD DE,(_a98e)
AB0E POP IX
AB10 ADD IX,DE
AB12 POP HL
AB13 ADD HL,DE
AB14 EX DE,HL
AB15 POP HL
AB16 LD BC,$0022
AB19 ADD HL,BC
AB1A POP BC
AB1B DEC C
AB1C JR NZ,ObjNode_BlitShft_15
AB1E POP IX
AB20 RET
ObjNode_BlitShft_17 AB21 LD BC,(TempBl)
AB25 EX DE,HL
AB26 EXX
AB27 POP HL
AB28 EXX
AB29 LD HL,(TempAl)
ObjNode_BlitShft_18 AB2C PUSH BC
AB2D PUSH HL
AB2E PUSH DE
AB2F LD A,($A990)
AB32 AND $01
AB34 EXX
AB35 PUSH HL
AB36 LD C,$00
AB38 JR Z,ObjNode_BlitShft_19
AB3A DEC HL
AB3B LD C,(HL)
AB3C INC HL
ObjNode_BlitShft_19 AB3D EXX
AB3E LD C,$0F
AB40 JR Z,ObjNode_BlitShft_20
AB42 DEC HL
AB43 LD C,(HL)
AB44 INC HL
AB45 LD A,B
AB46 AND A
AB47 JR Z,ObjNode_BlitShft_21
ObjNode_BlitShft_20 AB49 LD A,C
AB4A RRD
AB4C LD C,A
AB4D LD A,(DE)
AB4E AND (HL)
AB4F EX AF,AF'
AB50 LD A,C
AB51 RLD
AB53 INC HL
AB54 EXX
AB55 LD A,C
AB56 RRD
AB58 LD C,A
AB59 EX AF,AF'
AB5A OR (HL)
AB5B EX AF,AF'
AB5C RLD
AB5E INC HL
AB5F EXX
AB60 EX AF,AF'
AB61 LD (DE),A
AB62 INC DE
AB63 DJNZ ObjNode_BlitShft_20
AB65 LD A,($A990)
AB68 BIT 1,A
AB6A JR NZ,ObjNode_BlitShft_22
ObjNode_BlitShft_21 AB6C LD A,C
AB6D RLA
AB6E RLA
AB6F RLA
AB70 RLA
AB71 OR $0F
AB73 LD C,A
AB74 LD A,(DE)
AB75 AND C
AB76 EXX
AB77 SLA C
AB79 SLA C
AB7B SLA C
AB7D SLA C
AB7F OR C
AB80 EXX
AB81 LD (DE),A
ObjNode_BlitShft_22 AB82 EXX
AB83 POP HL
AB84 LD BC,(_a98e)
AB88 ADD HL,BC
AB89 EXX
AB8A POP DE
AB8B LD HL,$0022
AB8E ADD HL,DE
AB8F EX DE,HL
AB90 POP BC
AB91 LD HL,(_a98e)
AB94 ADD HL,BC
AB95 POP BC
AB96 DEC C
AB97 JR NZ,ObjNode_BlitShft_18
AB99 POP IX
AB9B RET
ObjNode_BlitShft_23 AB9C LD A,(TempBh)
AB9F LD C,A
ABA0 LD A,(TempBl)
ABA3 LD B,A
ABA4 POP DE
ABA5 EX DE,HL
ObjNode_BlitShft_24 ABA6 PUSH BC
ABA7 PUSH HL
ABA8 PUSH DE
ABA9 LD B,$00
ABAB LDIR
ABAD POP DE
ABAE LD HL,$0022
ABB1 ADD HL,DE
ABB2 EX DE,HL
ABB3 POP BC
ABB4 LD HL,(_a98e)
ABB7 ADD HL,BC
ABB8 POP BC
ABB9 DJNZ ObjNode_BlitShft_24
ABBB POP IX
ABBD RET
ObjNode_BlitShft_25 ABBE LD BC,(TempBl)
ABC2 EX DE,HL
ABC3 POP HL
ObjNode_BlitShft_26 ABC4 PUSH BC
ABC5 PUSH HL
ABC6 PUSH DE
ABC7 LD A,(DE)
ABC8 RRA
ABC9 RRA
ABCA RRA
ABCB RRA
ABCC AND $0F
ABCE LD C,A
ABCF LD A,($A990)
ABD2 AND $01
ABD4 JR Z,ObjNode_BlitShft_27
ABD6 DEC HL
ABD7 LD C,(HL)
ABD8 INC HL
ABD9 LD A,B
ABDA AND A
ABDB JR Z,ObjNode_BlitShft_28
ObjNode_BlitShft_27 ABDD LD A,C
ABDE RRD
ABE0 LD C,A
ABE1 LD A,(HL)
ABE2 LD (DE),A
ABE3 LD A,C
ABE4 RLD
ABE6 INC HL
ABE7 INC DE
ABE8 DJNZ ObjNode_BlitShft_27
ABEA LD A,($A990)
ABED BIT 1,A
ABEF JR NZ,ObjNode_BlitShft_29
ObjNode_BlitShft_28 ABF1 LD A,C
ABF2 RLA
ABF3 RLA
ABF4 RLA
ABF5 RLA
ABF6 AND $F0
ABF8 LD C,A
ABF9 LD A,(DE)
ABFA AND $0F
ABFC OR C
ABFD LD (DE),A
ObjNode_BlitShft_29 ABFE POP DE
ABFF LD HL,$0022
AC02 ADD HL,DE
AC03 EX DE,HL
AC04 POP BC
AC05 LD HL,(_a98e)
AC08 ADD HL,BC
AC09 POP BC
AC0A DEC C
AC0B JR NZ,ObjNode_BlitShft_26
AC0D POP IX
AC0F RET
ObjNode_BlitShft_30 AC10 POP IX
AC12 RET
Prev: A98E Up: Map Next: AC13