?login_element?
?pathlinks? – Rev 437
Rev 435 |
Blame |
Compare with Previous |
Last modification |
View Log
| Download
genscalers
IF customscales
LD HL,tscales
LD B,64
LD DE,64
DeCust PUSH BC
LD C,(HL)
LD (HL),E
INC HL
LD B,(HL)
LD (HL),D
INC HL
EXD
ADD HL,BC
EXD
POP BC
DJNZ DeCust
ENDIF ;customscales
LD IY,tscaljps;tjp
LD HL,0xc000;prog
LD DE,tscales
LD B,64
GENATM0 ;
LD (IY),0xC3
LD (IY+1),L
LD (IY+2),H
;LD (IY+3),0
PUSH BC
EXD
LD C,(HL)
INC HL
PUSH HL
LD B,(HL) ;BC=scale
EXD
CALL GENATMPP
POP DE
INC DE
ld bc,4
add iy,bc
POP BC
DJNZ GENATM0
RET
;перед этим генерим ld hl,walltop или scrtop
tgenatmhead
jr NC,$+4
SET 5,H ;todo LD H,
ADD A,L ;todo skip if L<=-40
LD L,A
jr NC,$+3 ;todo skip if L<=-40
INC H ;todo skip if L<=-40
lgenatmhead=$-tgenatmhead
GENATMPP
;BC=scale
;HL=prog
LD A,C
LD (genC),A
LD A,B
LD (genB),A
EXD
call scale2ytop
;DE = Y
;LX = y
PUSH DE ;Y
LD A,D
OR A
jr NZ,GENTOP
LD A,E
CP Ytop
jr C,GENTOP
CALL YtoADDR
JR GENnTOP
GENTOP LD DE,scrtop
GENnTOP
LD A,0x80
LD (genpix0),A ;первый раз
IF addhlbc
LD (HL),0x21 ;ld hl,NN
INC HL
LD (HL),E
INC HL
LD (HL),D
INC HL
PUSH BC
push DE
EXD
LD HL,tgenatmhead
LD BC,lgenatmhead
LDIR
EXD
POP DE
pop BC
ELSE
LD A,D
OR E
LD (HL),0xEB ;exd
jr Z,GENTOPH
LD (HL),0x21 ;ld hl,NN
INC HL
LD (HL),E
INC HL
LD (HL),D
INC HL
LD (HL),0x19 ;add hl,de
GENTOPH INC HL
ENDIF
IF addhlbc == 0
LD A,D
LD (curH),A
LD (HL),0xD1 ;pop de
INC HL
ENDIF
POP DE ;Y
LD HX,0 ;V
GENATMPP0
;Y+=scale
LD A,LX
genC=$+1
ADD A,0
LD LX,A ;y
LD A,0
genB=$+1
ADC A,0 ;A=dY
jr Z,GENATMnPIX
LD B,A
GENATMPIX0
CALL GENATMPIX
INC DE
LD A,D
OR A
jr NZ,$+7
LD A,E
CP Ybottom
jr NC,GENATMPPQ
DJNZ GENATMPIX0
GENATMnPIX
INC HX
LD A,HX
CP 64
jr Z,GENATMPPQ
RRA
jr C,$+5
LD (HL),0xD1 ;pop de
INC HL
JR GENATMPP0
GENATMPPQ
IF addhlbc == 0
LD A,0xD1 ;skip pop de's
DEC HL
CP (HL)
jr Z,$-2
LD A,(HL)
CP 0x72 ;ld (hl),d
ELSE
genatmend=$+1
LD HL,0
ENDIF
LD (HL),0xDD
IF addhlbc == 0
jr NZ,$+5
INC HL
LD (HL),0xFD
ENDIF
INC HL
LD (HL),0xE9 ;jp (ix) ;(iy) for ld (hl),d
INC HL
RET
GENATMPIX
LD A,D
OR A
RET NZ
LD A,E
CP Ytop
RET C
PUSH DE ;Y
CALL YtoADDR
genpix0=$+1
LD A,0x80
ADD A,A
LD (genpix0),A
IF addhlbc
jr C,$+5 ;первый раз
LD (HL),0x09 ;add hl,bc
INC HL
ELSE
jr C,GENPIXQ ;первый раз
curH=$+1
LD A,0
INC A
CP D
LD A,D
LD (curH),A
jr NZ,GENPIXnH
;LD (HL),#24 ;inc h
LD (HL),0x09 ;add hl,bc
INC HL
JR GENPIXQ
GENPIXnH
LD A,E
;OR A
;LD (HL),#68 ;ld l,b
;JZ GENPIXL
;CP 40 ;только для каждого 8-го столба
;LD (HL),#69 ;ld l,c
;JZ GENPIXL
CP 0xB8
LD (HL),0x6F ;ld l,a
jr Z,GENPIXL
LD (HL),0x2E ;ld l,N
INC HL
LD (HL),E
GENPIXL INC HL
GENPIXQ
ENDIF ;~addhlbc
LD A,HX ;V
RRA
LD (HL),0x73 ;ld (hl),e
jr NC,$+3;4
dec (hl);LD (HL),0x72 ;ld (hl),d
INC HL
IF addhlbc
LD (genatmend),HL
ENDIF
POP DE ;Y
RET