Dead cycle divisor
+public T_Start: rb 1 // Startup info cycle delay
+public T_Reload: rb 1 // Reload cycle delay
+public T_Laser: rb 1 // Laser firing
+public T_Delay: rb 1 // Inter-Laser delay
+public T_First: rb 1 // Additional series start delay period
+public T_LED4: rb 1 // 1 of RY-LED switch period
+public T_Scroll: rb 1 // Scroll of one letter
+public T_ScrollF: rb 1 // Scroll of 1st two letters
+public T_Dead: rb 1 // 4LED-Dead (and Dead) cycle delay
+public T_TimedD: rb 1 // TimedDisp delay (temporary, non-scrolling)
+public AddrSpace equ $-DataStart // +1 of remote configurable address space
+LoadPartS equ $-LoadPart
+ MagicRAM: rw 1 // Contains MagicRAMw for RAM-check
+public RxBufSiz equ 0x80+DataStart-$-StackSiz51 // Receive buffer size
+RxBuf: rb RxBufSiz // Receive buffer
+StackBtm: // Start of stack
+
+/******************************/
+ seg code
+
+ org 0x0 // Reset, SUsage=6
+Reset:
+ jb BPI_Fire,BadRAM
+ mov a,#high MagicRAMw
+ xrl a,MagicRAM
+ jnz BadRAM
+ sjmp ResCont
+
+ org 0xB // T0, SUsage=4
+T0Int: push psw
+ push acc
+ inc Timer
+ dec WDogCnt
+ mov a,WDogCnt
+ jnz NWDogFail
+ inc WDogsCnt // Failing!
+WarmBoot: mov r0,#ClearTop-1 // Mustn't reset RAM
+ sjmp ContBoot
+
+NWDogFail: pop acc
+ pop psw
+ reti
+
+ org 0x23 // Ser, SUsage=14
+SerInt: ajmp SerICont
+
+SwRConfig: inc RSwChgs
+ sjmp WarmBoot
+
+ResCont: mov a,#low MagicRAMw
+ xrl a,MagicRAM+1
+ jz SwRConfig
+BadRAM: mov MagicRAM,#high MagicRAMw
+ mov MagicRAM+1,#low MagicRAMw
+ mov r0,#LoadPart
+ mov dptr,#LoadContn
+ mov r2,#LoadPartS
+FillMem: clr a
+ movc a,@a+dptr
+ mov @r0,a
+ inc r0
+ inc dptr
+ djnz r2,FillMem
+ColdBoot: mov r0,#LoadPart-1
+
+ContBoot: clr a
+ mov IE,a
+ mov TCON,a
+ mov sp,#StackBtm-1
+
+ClearMem: mov @r0,a
+ djnz r0,ClearMem
+
+ mov SwConfigX,SwitchP
+ mov SysFlagsX,a
+
+ mov Timer,#1
+ mov CurPktS,#RxBuf
+ mov UserPktS,#RxBuf
+
+ mov DispP,a
+ jb BPI_Fire,0f
+ mov MiscP,#~(BMM_DispL|BMM_DispR)
+ jnb BPI_Fire,$
+ mov a,SwitchP
+ xch a,SwConfigX
+ xrl a,SwConfigX
+ jz 0f
+ mov Phase,#Ph_Test
+ setb DispDotTR
+0: mov MiscP,#~BMM_DispR
+
+ mov UsrFlagsX,#0x03 //DEBUG!!!
+
+ clr a
+ mov IP,#0x10 // Pri: Ser=1
+ mov TCON,a
+ mov TL1,#-BauDiv
+ mov TH1,#-BauDiv
+ mov TL0,a
+ mov TH0,a
+ mov TMOD,#0x20 // T1=m2, T0=m0
+ mov PCON,a // SerSpd=normal
+ mov SCON,#0x50 // 8N1, T1, clr
+ mov TCON,#0x50 // T1+T0=run, clr
+
+ mov IE,#0x92 // Int: Ser+T0
+
+ mov r0,#TimPhase
+ acall StartTim
+ acall InitLED4
+MainLoop: mov WDogCnt,#0 // Reset WatchDog
+// Check run-time change of configuration
+ jb DisRSwChg,1f
+ mov a,SwConfigX
+ xrl a,SwitchP
+ jz 1f
+ ajmp SwRConfig
+1:
+// Display refresh
+ mov DispP,#0xFF
+ xrl MiscP,#BMM_DispL|BMM_DispR
+ mov a,Phase
+ jnb BPM_DispR,0f
+ jnb DispDotTR,6f
+ jb Xmitting,7f
+6: jnb DispDotRD,1f
+ xrl a,#Ph_Reload
+ jnz 1f
+7: clr BBD_DOT
+1: mov a,ScrollPtr
+ jnz 4f
+ mov a,DispL
+ jnb TimedDisp,2f
+ mov a,TimedL
+ sjmp 2f
+
+0: jnb DispDotTR,8f
+ jb PktRcvng,9f
+8: jnb DispDotRD,3f
+ xrl a,#Ph_Dead
+ jnz 3f
+9: clr BBD_DOT
+3: mov a,ScrollPtr
+ jz 5f
+ inc a
+4: mov dptr,#ScrBase
+ movc a,@a+dptr
+ sjmp 2f
+
+5: mov a,DispR
+ jnb TimedDisp,2f
+ mov a,TimedR
+2: anl DispP,a
+// 4-LED cycle
+ jb BBS_QuietL,NoLED4Fr
+ mov a,Phase
+ xrl a,#Ph_Dead
+ jz NoLED4Fr
+ mov r0,#TimLED4
+ acall QueryTim
+ jnc NoLED4Fr
+ jnb BBS_IsTeam,1f
+ mov a,#BMM_LED0|BMM_LED2
+ jnb BBS_TeamN,5f
+ mov a,#BMM_LED1|BMM_LED3
+5: xrl MiscP,a
+ sjmp 2f
+
+1: mov a,#~BMM_LEDM
+ orl a,MiscP
+ rl a
+ jb acc.(BNM_LED3+1),4f
+ mov a,#~BMM_LED0
+4: orl MiscP,#BMM_LEDM
+ anl MiscP,a
+2: mov r0,#TimLED4
+ mov a,T_LED4
+ acall StartTim
+NoLED4Fr:
+// Fire series maintenance
+ jnb BPI_Fire,0f
+ mov SeriCnt,#0
+0:
+/*** Here end mandatory MainLoop routines ***/
+ mov r0,#TimPhase
+ acall QueryTim
+ jnc NoPhases
+ mov dptr,#PhaseTab
+ mov r1,#Phase1
+ mov a,Phase
+ acall JmpByTab
+NoPhases:
+// Fire check
+ mov a,Phase
+ jz 1f
+ dec a
+ jnz 2f
+1: jb BPI_Status,0f
+ clr a
+ mov Phase,a
+ mov Phase1,a
+ mov r0,#TimPhase
+ acall StartTim
+ sjmp CantFire
+
+2: cjne a,#Ph_First-Ph_Ammo,CantFire
+ mov a,SeriCnt
+ dec a
+ jz CantFire
+0: jb BPI_Fire,CantFire
+ mov a,SeriCnt
+ subb a,SeriC_Max
+ jnc CantFire
+ mov a,Ammo
+ jz CantFire
+ jb XMitting,CantFire
+// Fire one shot NOW!
+ inc SeriCnt
+ mov Phase,#Ph_Laser
+ dec Ammo
+ clr BPM_Laser
+ mov c,BBS_QuietS
+ mov BPM_Sound,c
+ inc TotShotsW+1
+ mov a,TotShotsW+1
+ jnz 1f
+ inc TotShotsW
+1: mov a,#PktN_Fire
+ acall StartXMiX
+ mov ScrollPtr,#0
+ acall DispAmmo
+ mov a,T_Laser
+ mov r0,#TimPhase
+ acall StartTim
+CantFire:
+// Scroll Update
+ mov r0,#TimScroll
+ acall QueryTim
+ jnc 6f
+ clr TimedDisp
+ mov a,ScrollPtr
+ jz 6f
+ mov dptr,#ScrBase+2
+ movc a,@a+dptr
+ jnz 0f
+ mov ScrollPtr,a
+ sjmp 6f
+
+0: inc ScrollPtr
+ mov a,ScrollPtr
+ movc a,@a+dptr
+ jnz 1f
+ mov a,T_ScrollF
+ sjmp 2f
+
+1: mov a,T_Scroll
+2: acall StartTim
+6:
+// Packet received?
+ mov a,UserPktS
+ mov r0,a
+ xrl a,CurPktS
+ jnz 0f
+GotNoSerS: ajmp GotNoSer
+
+ShortPkt: mov a,r0
+ acall RxBufInc
+ push 0 //r0
+ mov r0,a
+ sjmp ProcSPkt
+
+0: mov a,@r0
+; jb acc.7,ShortPkt
+ jb XMitting,GotNoSerS
+ inc a
+ add a,r0
+ subb a,#RxBuf+RxBufSiz
+ jnc 1f
+ add a,#RxBufSiz
+1: add a,#RxBuf
+ push acc
+ mov a,@r0
+ clr c
+ subb a,#3
+ jc FailRPktN
+ mov @r0,a
+ push 0 //r0
+ inc a
+ mov r2,a
+ acall RxBufInc
+ mov r1,#RxChkXSumW+1
+ mov @r1,#low XSum_Base
+ dec r1
+ mov @r1,#high XSum_Base
+0: mov a,@r0
+ acall AddXSum
+ acall RxBufInc
+ djnz r2,0b
+ pop 2 //r2
+ mov a,@r0
+ xrl a,@r1
+FailRPktN: jnz FailRPktS
+ acall RxBufInc
+ mov a,@r0
+ inc r1
+ xrl a,@r1
+ jnz FailRPktS
+// XSum is correct
+ mov a,r2
+ mov r0,a
+ mov a,@r0
+ mov r2,a
+ acall RxBufInc
+ mov a,@r0
+ mov r3,a
+ acall RxBufInc
+ cjne r3,#PktN_Fire,NoPFire
+ cjne r2,#1,FailRPktS
+// Fire packet received, @R0=remote SwConfigX
+ProcSPkt: mov a,@r0
+ jnb BBS_IsTeam,ShotDown // We're anarchy
+ jnb acc.BNS_IsTeam,ShotDown // From anarchy one
+ xrl a,SwConfigX
+ jnb acc.BNS_TeamN,FriendS // One of our team
+ mov a,@r0
+ShotDown: xrl a,SwConfigX
+ anl a,#BMS_IdentM
+ jz FriendS
+// Really shot by enemy
+ mov TimedL,#Font_E
+ mov a,Phase
+ xrl a,#Ph_Dead
+ jz PrintIDR
+ mov a,@r0
+ anl a,#0x0F
+ rl a
+ add a,#GraveW+1
+ mov r1,a
+ inc @r1
+ mov a,@r1
+ jnz 0f
+ dec r1
+ inc @r1
+0: mov TimedL,#Font_S
+ mov Phase,#Ph_Dead
+ mov Phase1,DeadN
+ anl MiscP,#~BMM_LEDM
+ push 0 //r0
+ acall NxtDead
+ pop 0 //r0
+ sjmp PrintIDR
+
+FriendS: mov TimedL,#Font_F
+PrintIDR: mov a,@r0
+ anl a,#0x0F
+ mov dptr,#FontHex
+ movc a,@a+dptr
+ mov TimedR,a
+ setb TimedDisp
+ mov ScrollPtr,#0
+ mov a,T_TimedD
+ mov r0,#TimScroll
+ acall StartTim
+FailRPktS: sjmp FailRPkt
+
+NoPFire: cjne r3,#PktN_CfgR,NoPCfgR
+ jnb XMitting,0f
+ dec sp
+ sjmp GotNoSer
+
+0: mov a,@r0
+ xrl a,SwConfigX
+ anl a,#BMS_IdentM
+ jnz FailRPkt
+ acall RxBufInc2
+CfgNBlock: mov a,r2
+ jz FailRPkt
+ mov a,@r0
+ acall RxBufInc2
+ jz CRRepRes
+ mov r3,a
+ mov a,r2
+ jz FailRPkt
+ mov a,@r0
+ acall RxBufInc2
+ mov r1,a
+CfgBlock: mov a,r2
+ jz FailRPkt
+ mov a,@r0
+ acall RxBufInc2
+ push acc
+ mov a,r1
+ clr c
+ subb a,#AddrSpace
+ pop acc
+ jnc SkipWrite
+ jb UnConfig,SkipWrite
+ mov @r1,a
+SkipWrite: inc r1
+ djnz r3,CfgBlock
+ sjmp CfgNBlock
+
+CRRepRes: pop acc
+ clr c
+ subb a,#RxBuf+2
+ jnc 0f
+ add a,#RxBufSiz
+0: add a,#RxBuf
+ mov CAPktEnd,a
+ mov a,r0
+ mov UserPktS,a
+ mov a,#CfgRS-ScrBase
+ acall DoScroll
+ mov a,#PktN_CfgA
+ acall StartXMiX
+ sjmp GotNoSer
+
+NoPCfgR: cjne r3,#PktN_CfgA,FailRPkt
+ mov a,#CfgAS-ScrBase
+ScrRPkt: acall DoScroll
+FailRPkt: pop UserPktS
+
+GotNoSer:
+
+ ajmp MainLoop
+
+/******************************/
+PhaseTab:
+ db PhCfgDump-PhaseTab
+ db PhAmmo -PhaseTab
+ db PhLaser -PhaseTab
+ db PhDelay -PhaseTab
+ db PhFirst -PhaseTab
+ db PhReload -PhaseTab
+ db PhDead -PhaseTab
+ db PhTest -PhaseTab
+
+PhCfgDump: mov a,T_TimedD
+ acall StartTim
+SkpCDump: inc @r1
+ mov dptr,#CfgDTab
+ mov a,@r1
+ clr c
+ subb a,#CD_Grave0
+ jnc CDGrave
+ mov a,@r1
+JmpByTab: movc a,@a+dptr
+ jmp @a+dptr
+
+PhLaser: orl MiscP,#BMM_Laser|BMM_Sound
+ inc Phase
+ mov a,T_Delay
+ sjmp StartTimS
+
+PhDelay: inc Phase
+ mov a,Ammo
+ jz PD_Reload // Do Reload
+ mov a,T_First
+ sjmp StartTimS
+
+PhTest: jb XMitting,PT_WaitTI
+ mov a,#TestChar
+ acall StartXMiX
+PT_WaitTI:
+ mov a,SwConfigX
+ swap a
+ rr a
+ anl a,#0x78
+ sjmp StartTimS
+
+PD_Reload: inc Phase
+ mov Phase1,ReloadN
+ mov Ammo,Ammo_Max
+ mov a,#ReloadS-ScrBase
+ acall DoScroll
+PhReload: dec Phase1
+ mov a,Phase1
+ jz NormAmmo
+ mov DispL,#Font_L
+ mov a,Phase1
+ acall PutHexFnR
+ mov a,T_Reload
+ sjmp StartTimP
+
+PhDead: xrl MiscP,#BMM_LEDM
+ dec Phase1
+ mov a,Phase1
+ jz RAmmonLED
+NxtDead: mov B,DeadDivN
+ div aB
+ xch a,B
+ jnz 0f
+ mov DispL,#Font_D
+ mov a,B
+ acall PutHexFnR
+0: mov a,T_Dead
+StartTimP: mov r0,#TimPhase
+StartTimS: ajmp StartTim
+
+RAmmonLED: acall InitLED4
+PhFirst:
+NormAmmo: mov Phase,#Ph_Ammo
+PhAmmo: // PhAmmo shouldn't happen <= no timer
+ ajmp DispAmmo
+
+CDGrave: cjne a,#CD_Last-CD_Grave0,1f
+ sjmp NormAmmo
+
+1: mov B,#3
+ div aB
+ mov r2,a
+ rl a
+ add a,#GraveW
+ mov r0,a
+ mov a,@r0
+ inc r0
+ orl a,@r0
+ jz SkpCDump2
+ mov a,B
+ cjne a,#0,0f
+ mov DispL,#Font_D
+ mov a,r2
+PutHexFnR: mov dptr,#FontHex
+ ajmp PutFontR
+
+0: dec r0
+ mov r3,a
+ acall ConvDecW
+ cjne r3,#1,DispHexS
+ mov a,@r0
+ sjmp DispHexS
+
+CfgDTab equ $-1
+ db CDPNum -CfgDTab
+ db CDGMode -CfgDTab
+ db CDLEDs -CfgDTab
+ db CDSound -CfgDTab
+ db CDWDogs -CfgDTab
+ db CDWDogsN -CfgDTab
+ db CDRSwChg -CfgDTab
+ db CDRSwChgN-CfgDTab
+ db CDTotSh -CfgDTab
+ db CDTotShM -CfgDTab
+ db CDTotShN -CfgDTab
+
+CDPNum: mov DispL,#Font_P
+ mov a,SwConfigX
+ anl a,#0x0F
+ sjmp PutHexFnR
+
+CDGMode: mov DispL,#Font_G
+ mov a,#Font_A
+ jnb BBS_IsTeam,DoGaMode
+ mov a,#Font_R
+ jnb BBS_TeamN,DoGaMode
+ mov a,#Font_G
+DoGaMode: mov DispR,a
+ ret
+
+CDLEDs: jnb BBS_QuietL,SkpCDumpS
+ mov DispL,#Font_L
+ mov DispR,#Font_D
+ ret
+
+CDSound: jnb BBS_QuietS,SkpCDumpS
+ mov DispL,#Font_S
+ mov DispR,#Font_D
+ ret
+
+CDWDogs: mov a,WDogsCnt
+ jz SkpCDump1
+ mov DispL,#Font_D
+ mov DispR,#Font_R
+ ret
+
+SkpCDump2: inc @r1
+SkpCDump1: inc @r1
+SkpCDumpS: ajmp SkpCDump
+
+CDWDogsN: mov a,WDogsCnt
+ sjmp DispDecS
+
+CDRSwChg: mov a,RSwChgs
+ jz SkpCDump1
+ mov DispL,#Font_S
+ mov DispR,#Font_C
+ ret
+
+CDRSwChgN: mov a,RSwChgs
+DispDecS: ajmp DispDec
+
+CDTotSh: mov a,TotShotsW
+ orl a,TotShotsW+1
+ jz SkpCDump2
+ mov DispL,#Font_F
+ mov DispR,#Font_S
+ ret
+
+CDTotShM: mov r0,#TotShotsW
+ acall ConvDecW
+ mov a,@r0
+ sjmp DispHexS
+
+CDTotShN: mov r0,#TotShotsW
+ acall ConvDecW
+DispHexS: ajmp DispHex
+/******************************/
+SerICont: push psw
+ push acc
+ push 0 //r0
+ push 2 //r2
+RetryRI: jbc RI,GotRI
+RetryTI: jbc TI,GotTI
+ pop 2 //r2
+ pop 0 //r0
+ pop acc
+ pop psw
+ reti
+/******************************/
+GotRI: mov a,SBUF
+ jnb acc.7,5f
+ jb FastFireRD,ScratchRI
+ jb acc.6,ScratchRI
+ mov r0,CurPktS
+ mov @r0,a
+ acall RxBufInc
+ mov a,r0
+ xrl a,UserPktS
+ jz ScratchRI
+ mov a,r0
+ mov CurPktS,a
+ sjmp ScratchRI
+
+5: cjne a,#Mark_Start,0f
+ mov r0,CurPktS
+ acall RxBufInc
+ mov a,r0
+ xrl a,UserPktS
+ jz ScratchRI
+ mov CurPktE,r0
+ setb PktRcvng
+ clr PktGotNib
+ sjmp RetryRI
+
+0: cjne a,#Mark_End,1f
+ jnb PktRcvng,RetryRI
+ jb PktGotNib,ScratchRI
+ clr PktRcvng
+ mov a,CurPktE
+ mov r0,CurPktS
+ clr c
+ subb a,r0
+ jnc 3f
+ add a,#RxBufSiz
+3: dec a
+ jz RetryRI
+ mov @r0,a
+ mov a,CurPktE
+ mov CurPktS,a
+// Successfuly received packet
+ sjmp RetryRI
+
+1: jnb PktRcvng,RetryRI
+ clr c
+ subb a,#'0'
+ jc ScratchRI
+ subb a,#10
+ jc GotRITen
+ subb a,#'A'-('9'+1)
+ jc ScratchRI
+ subb a,#6
+ jc GotRISix
+ScratchRI: clr PktRcvng
+RetryRIS: sjmp RetryRI
+/******************************/
+GotTI: jnb XMitting,RetryTI
+ clr XMittedN
+ jnb XMitHaveP,PrepXMit
+ mov a,XMitNib
+SendPrepd: jb XMittedN,RetryTIS
+ jbc XMitByte,XMitByteC
+ jnb XMit1stNib,Have2ndN
+ swap a
+Have2ndN: anl a,#0x0F
+ add a,#'0'
+ mov r2,a
+ clr c
+ subb a,#'9'+1
+ mov a,r2
+ jc XMitByteC
+ add a,#'A'-('9'+1)
+XMitByteC: mov SBUF,a
+ setb XMittedN
+ mov c,XMit1stNib
+ clr XMit1stNib
+ mov XMitHaveP,c
+ jnc PrepXMit
+RetryTIS: ajmp RetryTI
+/******************************/
+GotRISix: add a,#6
+GotRITen: add a,#10
+ jb PktGotNib,2f
+ swap a
+ mov PktNibble,a
+ sjmp DoneFNRI
+
+2: orl a,PktNibble
+ mov r2,a
+ mov r0,CurPktE
+ acall RxBufInc
+ mov a,UserPktS
+ xrl a,r0
+ jz ScratchRI
+ mov a,r0
+ xch a,CurPktE
+ mov r0,a
+ mov a,r2
+ mov @r0,a
+DoneFNRI: cpl PktGotNib
+ sjmp RetryRIS
+/******************************/
+PrepXMit: mov a,XMitPhase
+ mov dptr,#PhXMitTab
+ movc a,@a+dptr
+ jmp @a+dptr
+
+PhXMitTab: db XPStart -PhXMitTab
+ db XPType -PhXMitTab
+ db XPSwCfg -PhXMitTab
+ db XPData -PhXMitTab
+ db XPXSumH -PhXMitTab
+ db XPXSumL -PhXMitTab
+ db XPEnd -PhXMitTab
+ db XPFinish-PhXMitTab
+
+InvalCR: mov CAPktEnd,a
+XPFinish: clr XMitting
+ sjmp RetryTIS
+
+XPStart: mov a,XMitType
+ xrl a,#TestChar
+ jnz 1f
+ mov a,#TestChar
+ sjmp 2f
+
+1: xrl a,#TestChar^PktN_Fire
+ jnz 0f
+ jb FullFireT,0f
+ mov a,SwConfigX
+ clr acc.6
+ setb acc.7
+2: mov XMitPhase,#6 //XPFinish-1
+ sjmp ContXMitB
+
+0: mov a,#Mark_Start
+ContXMitB: setb XMitByte
+ inc XMitPhase
+ clr XMit1stNib
+ContXMit: setb XMitHaveP
+ mov XMitNib,a
+ ajmp SendPrepd
+
+XPType: mov XMitXSumW ,#high XSum_Base
+ mov XMitXSumW+1,#low XSum_Base
+ mov a,XMitType
+XMitXHexP: inc XMitPhase
+XMitXHex: push 1 //r1
+ push 3 //r3
+ push B
+ mov r1,#XMitXSumW
+ push acc
+ acall AddXSum
+ pop acc
+ pop B
+ pop 3 //r3
+ pop 1 //r1
+XMitHex: clr XMitByte
+ setb XMit1stNib
+ sjmp ContXMit
+
+XPSwCfg: mov a,SwConfigX
+ sjmp XMitXHexP
+
+XPData: mov a,XMitType
+ xrl a,#PktN_CfgA
+ jnz XPDatDone
+ mov r0,UserPktS
+NxtBlock: mov a,r0
+ xrl a,CAPktEnd
+ jz DoneAns
+ mov a,@r0
+ dec @r0
+ mov r2,a
+ acall RxBufInc
+ mov a,r0
+ xrl a,CAPktEnd
+ jz InvalCR // Invalid CfgReq
+ mov a,r2
+ jz DoneBlock
+ mov a,@r0
+ inc @r0
+ mov r0,a
+ mov a,@r0
+ sjmp XMitXHex
+
+DoneBlock: acall RxBufInc
+ mov UserPktS,r0
+ mov a,r0
+ xrl a,CAPktEnd
+ jnz NxtBlock
+DoneAns: mov CAPktEnd,a // Cancel CfgA pending alert
+ acall RxBufInc
+ acall RxBufInc
+ mov UserPktS,r0
+XPDatDone: inc XMitPhase
+XPXSumH: mov a,XMitXSumW
+XMitHexP: inc XMitPhase
+ sjmp XMitHex
+
+XPXSumL: mov a,XMitXSumW+1
+ sjmp XMitHexP
+
+XPEnd: mov a,#Mark_End
+ sjmp ContXMitB
+
+/******************************/
+StartXMiX: mov XMitType,a
+ clr a
+ mov XMitPhase,a
+ clr XMitHaveP
+ setb XMitting
+ setb TI // Start XMit now!
+ ret
+/******************************/
+// I: A=text offset, O: Filled DispL+DispR, D: A,R0,R2
+DoScroll: mov ScrollPtr,a
+ mov r0,#TimScroll
+ mov a,T_ScrollF
+ sjmp StartTim
+/******************************/
+// O: Filled DispL+DispR, D: A,B,R2
+DispAmmo: mov a,Ammo
+// I: A=decimal, O: Filled DispL+DispR, D: A,B,R2
+DispDec: mov R2,a
+ clr c
+ subb a,#100
+ jnc 0f
+ mov a,MaxDecimal
+0: mov a,R2
+ mov B,#10
+ div aB
+ swap a
+ orl a,B
+// I: A=hexadecimal, O: Filled DispL+DispR, D: A,R2
+DispHex: mov dptr,#FontHex
+ mov R2,a
+ swap a
+ anl a,#0x0F
+ movc a,@a+dptr
+ mov DispL,a
+ mov a,R2
+ anl a,#0x0F
+PutFontR: movc a,@a+dptr
+ mov DispR,a
+Ret1: ret
+/******************************/
+InitLED4: orl MiscP,#BMM_LEDM
+ jb BBS_QuietL,Ret1
+ anl MiscP,#~BMM_LED0
+ jnb BBS_IsTeam,0f
+ jnb BBS_TeamN,0f
+ xrl MiscP,#BMM_LED0|BMM_LED1
+0: mov r0,#TimLED4
+ mov a,T_LED4
+/******************************/
+// I: R0=addr of byte, A=min time, O: @R0!=0, D:A
+StartTim: add a,Timer
+ jnz 0f
+ inc a
+0: mov @R0,a
+ ret
+/******************************/
+// I: R0=addr of byte, C=1->success, D:A
+QueryTim: mov a,@R0
+ clr c
+ jz 0f
+ subb a,Timer
+ mov c,acc.7
+ jnc 0f
+ clr a
+ mov @R0,a
+0: ret
+/******************************/
+RxBufInc2: dec r2
+// I: R0=RxAddr, O: R0=RxAddr+1
+RxBufInc: inc r0
+ cjne r0,#RxBuf+RxBufSiz,0f
+ mov r0,#RxBuf
+0: ret
+/******************************/
+// I: @R1/W=xsum, A=Byte, O: @R1/W=xsum+Byte, D:A,B,R3
+AddXSum: push 2 //r2
+ push acc
+ inc r1
+ inc @r1
+ mov a,@r1
+ dec r1
+ jnz 0f
+ inc @r1
+0: mov B,#XSum_Mul
+ mul aB
+ mov r2,a
+ mov r3,B
+ mov a,@r1
+ mov B,#XSum_Mul
+ mul aB
+ add a,r3
+ mov r3,a
+ pop acc
+ add a,r2
+ inc r1
+ mov @r1,a
+ dec r1
+ mov a,r3
+ addc a,#0
+ mov @r1,a
+ pop 2 //r2
+ ret
+// I: R0=SrcWord, O: R0=ConvDecW1, A=LOW [R0/W], D:R1,R2
+ConvDecW:
+ inc sp
+ mov r1,sp
+ inc sp
+ mov a,@r0
+ mov @r1,a
+ inc r0
+ inc r1
+ mov a,@r0
+ mov @r1,a
+ mov dptr,#CDW_Tab
+ mov r2,#4
+ mov r0,#ConvDecW1
+3: xchd a,@r0
+ swap a
+ mov @r0,a
+ inc r0
+ clr a
+ xchd a,@r0
+ swap a
+ mov @r0,a
+2: mov a,#1
+ movc a,@a+dptr
+ mov B,a
+ mov a,@r1
+ clr c
+ subb a,B
+ push acc
+ dec r1
+ clr a
+ movc a,@a+dptr
+ mov B,a
+ mov a,@r1
+ subb a,B
+ jc 1f
+ mov @r1,a
+ pop acc
+ inc r1
+ mov @r1,a
+ inc @r0
+ sjmp 2b
+
+1: dec sp
+ inc dptr
+ inc dptr
+ inc r1
+ mov a,@r0
+ dec r0
+ djnz r2,3b
+ dec sp
+ dec sp
+ ret
+/******************************/
+
+ScrBase: // Every text offset must >0 !!!
+FontHex: db Font_0,Font_1,Font_2,Font_3,Font_4,Font_5,Font_6,Font_7
+ db Font_8,Font_9,Font_A,Font_B,Font_C,Font_D,Font_E,Font_F
+ReloadS: db Font_R,Font_E,Font_L,Font_O,Font_A,Font_D,0
+CfgAS: db Font_C,Font_O,Font_N,Font_F,Font_I,Font_G
+ db Font_A,Font_N,Font_S,0
+CfgRS: db Font_C,Font_O,Font_N,Font_F,Font_I,Font_G
+ db Font_U,Font_R,Font_E,Font_D,0
+ if ($-ScrBase>=0x100) ScrBase equ 0
+/******************************/
+CDW_Tab: dw 1000,100,10,1
+
+LoadContn:
+ db 12 // Reload countdown
+ db 40 // Dead state countdown
+ db 15 // Maximum # of shots per one series
+ db 40 // Ammo # in one clip
+ db 40 // Remaining ammo in the current clip
+ db 4 // 4LED-Dead -> Dead cycle divisor
+ db 100 // Startup info cycle delay
+ db 48 // Reload cycle delay
+ db 8 // Laser firing
+ db 2 // Inter-Laser delay
+ db 24 // Additional series start delay period
+ db 32 // 1 of RY-LED switch period
+ db 25 // Scroll of one letter
+ db 50 // Scroll of 1st two letters
+ db 24 // 4LED-Dead (and Dead) cycle delay
+ db 110 // TimedDisp delay (temporary, non-scrolling)
+ if ($-LoadContn!=LoadPartS) LoadPartS equ 0
diff --git a/project/LaserGame/ListItem.pm b/project/LaserGame/ListItem.pm
index a3c9e1e..0484dc3 100755
--- a/project/LaserGame/ListItem.pm
+++ b/project/LaserGame/ListItem.pm
@@ -32,11 +32,12 @@ our @ListItem=(
"name"=>"LaserGame",
"platform"=>"amiga",
"priority"=>4,
+ "icon"=>"hw-icon.jpeg",
"download"=>"LaserGame.lha",
- "link-source file"=>"LaserGame.asm",
- "summary"=>"Firmware and config tool for shooting gun and its detectors",
+ "link-Intel 8051 source file"=>"LaserGun.a51",
+ "summary"=>"Firmware and config tool for shooting gun",
"license"=>"PD",
- "maintenance"=>"obsolete-Communication is written for discontinued Amiga platform.",
+ "maintenance"=>"obsolete-Config tool is written for the discontinued Amiga platform.",
"language"=>"i8051 asm, 680x0 asm",
"description"=><<"HERE",
LaserGame is a clone of commercial shoot'n'run game. Each player has its
diff --git a/project/LaserGame/hw-icon.jpeg b/project/LaserGame/hw-icon.jpeg
new file mode 100644
index 0000000..b893746
Binary files /dev/null and b/project/LaserGame/hw-icon.jpeg differ
diff --git a/project/LaserGame/hw.jpeg b/project/LaserGame/hw.jpeg
new file mode 100644
index 0000000..75c8405
Binary files /dev/null and b/project/LaserGame/hw.jpeg differ
diff --git a/project/Nokia61/Index.html.pl b/project/Nokia61/Index.html.pl
index e3ea5f1..82b1953 100755
--- a/project/Nokia61/Index.html.pl
+++ b/project/Nokia61/Index.html.pl
@@ -36,11 +36,20 @@ My::Project->init_project(
"ListItem"=>\@project::Nokia61::ListItem::ListItem,
);
-do { My::Web::make("make -s $_" if ! -f $_; } for ("./Nokia61");
-print <<'HERE';
-
@{[ a_href 'http://www.reactos.com/','ReactOS' ]}
code base made a big asset for this functionality.
- @{[ a_href 'http://www.reactos.com/',img('reactos','ReactOS') ]} |
+ @{[ img 'reactos','ReactOS',"a_href"=>'http://www.reactos.com/' ]} |
diff --git a/project/captive/doc/Macros.pm b/project/captive/doc/Macros.pm
index 4197b60..42cc840 100755
--- a/project/captive/doc/Macros.pm
+++ b/project/captive/doc/Macros.pm
@@ -83,15 +83,15 @@ my($class,$where)=@_;
print ''."\n" for (qw(10 20 40 20 10));
print ' | '."\n";
print '';
- print a_href $My::Web::W->{"rel_prev"},img("/My/arrow-left" ,"Previous document")
+ print img "/My/arrow-left" ,"Previous document","a_href"=>$My::Web::W->{"rel_prev"}
if $My::Web::W->{"rel_prev"};
print ' | '."\n";
print '';
- print a_href $My::Web::W->{"rel_up"} ,img("/My/arrow-up" ,"Parent")
+ print img "/My/arrow-up" ,"Parent","a_href"=>$My::Web::W->{"rel_up"}
if $My::Web::W->{"rel_up"} && !($where && $where eq "footer");
print ' | '."\n";
print '';
- print a_href $My::Web::W->{"rel_next"},img("/My/arrow-right","Next document")
+ print img "/My/arrow-right","Next document"),"a_href"=>$My::Web::W->{"rel_next"}
if $My::Web::W->{"rel_next"};
print ' | '."\n";
print ' | '."\n";
diff --git a/project/d1xnet/ListItem.pm b/project/d1xnet/ListItem.pm
index 80fcdf8..ccaac7c 100755
--- a/project/d1xnet/ListItem.pm
+++ b/project/d1xnet/ListItem.pm
@@ -32,6 +32,7 @@ our @ListItem=(
"name"=>a_href('http://d1x.warpcore.org/','D1X').' TCP/IP',
"platform"=>"patch",
"priority"=>2,
+ "icon"=>"exit03.jpeg",
"download"=>"d1x-tcpip-0.99.1.diff.gz",
"summary"=>a_href('http://d1x.warpcore.org/','D1X').' native TCP/IP support patch',
"license"=>"PD",
diff --git a/project/d1xnet/exit03.jpeg b/project/d1xnet/exit03.jpeg
new file mode 100644
index 0000000..9dbb0d8
Binary files /dev/null and b/project/d1xnet/exit03.jpeg differ
diff --git a/project/int13sniff/Index.html.pl b/project/int13sniff/Index.html.pl
index 5380d28..1d3c9c5 100755
--- a/project/int13sniff/Index.html.pl
+++ b/project/int13sniff/Index.html.pl
@@ -36,6 +36,8 @@ My::Project->init_project(
"ListItem"=>\@project::int13sniff::ListItem::ListItem,
);
-print ''.My::Web::img("int13sniff-snap","Boot Snapshot").' |
'."\n";
+
+print centerimg "int13sniff-snap","Boot Snapshot";
+
My::Web->footer();
diff --git a/project/int13sniff/ListItem.pm b/project/int13sniff/ListItem.pm
index 85a2d58..812df09 100755
--- a/project/int13sniff/ListItem.pm
+++ b/project/int13sniff/ListItem.pm
@@ -32,7 +32,8 @@ our @ListItem=(
"name"=>'Int13Sniff',
"platform"=>"unixdevel",
"priority"=>4,
- "summary"=>'Trace bootloader disk operations',
+ "icon"=>"int13sniff-icon",
+ "summary"=>'Trace PC bootloader disk operations',
"download-source"=>'http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/*checkout*/surprise/surprise/misc/int13sniff.S?rev=HEAD',
"download-gzip(1)ped floppy image head"=>'int13sniff.bin.gz',
"link-parent Surprise project"=>"/project/surprise/",
diff --git a/project/int13sniff/int13sniff-icon.png b/project/int13sniff/int13sniff-icon.png
new file mode 100644
index 0000000..248f14a
Binary files /dev/null and b/project/int13sniff/int13sniff-icon.png differ
diff --git a/project/kewensis/ListItem.pm b/project/kewensis/ListItem.pm
index 40fabe0..66e6431 100755
--- a/project/kewensis/ListItem.pm
+++ b/project/kewensis/ListItem.pm
@@ -41,8 +41,8 @@ our @ListItem=(
@{[ a_href 'http://www.ipni.org/','International Plant Name Index' ]}
provides information about plants in duplicated and unconveniently searchable
pages. You can download their database and run your own engine on it locally.
-This engine allows you to modify the database to fix names of for your own
-plants.
+This engine allows you to modify the database to fix names of your own
+plants and it groups synonyms of the same plant.
HERE
);
diff --git a/project/line9k/Index.html.pl b/project/line9k/Index.html.pl
index 34c58a9..8e6d7fb 100755
--- a/project/line9k/Index.html.pl
+++ b/project/line9k/Index.html.pl
@@ -36,13 +36,15 @@ My::Project->init_project(
"ListItem"=>\@project::line9k::ListItem::ListItem,
);
-print <<'HERE';
+
+print <<"HERE";
Scheme for battery charger. Review/fixes by the courtesy of Pavouk.
Connect serial port (such as /dev/ttyS0
) to RS232
pins,
your original mobile phone charge to AC
pins. PS/2
keyboard
fork of +5V
/GND
pins are required to power this hardware switch.
+
+@{[ centerimg "line9k","AC Switch Scheme" ]}
HERE
-print ''.My::Web::img("line9k","AC Switch Scheme").' |
'."\n";
My::Web->footer();
diff --git a/project/mod_auth_tacacs/ListItem.pm b/project/mod_auth_tacacs/ListItem.pm
index 7e18167..d89b5c9 100755
--- a/project/mod_auth_tacacs/ListItem.pm
+++ b/project/mod_auth_tacacs/ListItem.pm
@@ -32,6 +32,7 @@ our @ListItem=(
"name"=>a_href('http://sourceforge.net/projects/mod-auth-tacacs/','mod_auth_tacacs').' client',
"platform"=>"patch",
"priority"=>2,
+ "icon"=>"cisco-icon.jpeg",
"download"=>"mod_auth_tacacs-2.0.2-gts1-checkout.diff.gz",
"link-mod_auth_tacacs homepage"=>"http://sourceforge.net/projects/mod-auth-tacacs/",
"summary"=>a_href('http://www.cisco.com/warp/public/614/7.html','Cisco TACACS+')
diff --git a/project/mod_auth_tacacs/cisco-icon.jpeg b/project/mod_auth_tacacs/cisco-icon.jpeg
new file mode 100644
index 0000000..7c68e75
Binary files /dev/null and b/project/mod_auth_tacacs/cisco-icon.jpeg differ
diff --git a/project/pgsqlsubstr/ListItem.pm b/project/pgsqlsubstr/ListItem.pm
index db880d6..ebbc18f 100755
--- a/project/pgsqlsubstr/ListItem.pm
+++ b/project/pgsqlsubstr/ListItem.pm
@@ -32,6 +32,7 @@ our @ListItem=(
"name"=>'PostgreSQL-6.3 fix',
"platform"=>"patch",
"priority"=>3,
+ "icon"=>"postgresql",
"summary"=>'Fixed substr() and substring() SQL functions',
"download-patch"=>'http://developer.postgresql.org/cvsweb.cgi/pgsql-server/src/backend/utils/adt/varlena.c.diff?r1=1.31&r2=1.32&f=u',
"link-ChangeLog entry"=>'http://developer.postgresql.org/cvsweb.cgi/pgsql-server/src/backend/utils/adt/varlena.c#rev1.32',
diff --git a/project/pgsqlsubstr/postgresql.png b/project/pgsqlsubstr/postgresql.png
new file mode 100644
index 0000000..c70a41c
Binary files /dev/null and b/project/pgsqlsubstr/postgresql.png differ
diff --git a/project/phphash/ListItem.pm b/project/phphash/ListItem.pm
index 5047f19..d676adf 100755
--- a/project/phphash/ListItem.pm
+++ b/project/phphash/ListItem.pm
@@ -32,6 +32,7 @@ our @ListItem=(
"name"=>'PHP-3.0b6 fix',
"platform"=>"patch",
"priority"=>3,
+ "icon"=>"php",
"summary"=>'Avoid excessive use of memory for hashes',
"download-patch"=>'http://cvs.php.net/diff.php/php3/Attic/hash.c?r1=1.76&r2=1.77&ty=u',
"license"=>"PD",
diff --git a/project/phphash/php.gif b/project/phphash/php.gif
new file mode 100644
index 0000000..1b1fa8f
Binary files /dev/null and b/project/phphash/php.gif differ
diff --git a/project/phphash/php.png b/project/phphash/php.png
new file mode 100644
index 0000000..1cbc06f
Binary files /dev/null and b/project/phphash/php.png differ
diff --git a/project/surprise/Index.html.pl b/project/surprise/Index.html.pl
index 746466f..f233afd 100755
--- a/project/surprise/Index.html.pl
+++ b/project/surprise/Index.html.pl
@@ -36,6 +36,8 @@ My::Project->init_project(
"ListItem"=>\@project::surprise::ListItem::ListItem,
);
-print ''.My::Web::img("surprise-gnome-0","Gnome client").' |
'."\n";
+
+print centerimg "surprise-gnome-0","Gnome client";
+
My::Web->footer();
diff --git a/project/timeplan/ListItem.pm b/project/timeplan/ListItem.pm
index 5d4a9c9..9d14179 100755
--- a/project/timeplan/ListItem.pm
+++ b/project/timeplan/ListItem.pm
@@ -33,6 +33,7 @@ our @ListItem=(
"platform"=>"unixuser",
"trivia"=>1,
"priority"=>6,
+ "icon"=>"digiclock.jpeg",
"download"=>"timeplan-1.0.1.tar.gz",
"cvs"=>"timeplan",
"summary"=>"Calculate statistics from your personal time tracking notes",
diff --git a/project/timeplan/digiclock.jpeg b/project/timeplan/digiclock.jpeg
new file mode 100644
index 0000000..4e4ccbc
Binary files /dev/null and b/project/timeplan/digiclock.jpeg differ
diff --git a/project/winvnc/ListItem.pm b/project/winvnc/ListItem.pm
index 9df46fd..883fecc 100755
--- a/project/winvnc/ListItem.pm
+++ b/project/winvnc/ListItem.pm
@@ -32,6 +32,7 @@ our @ListItem=(
"name"=>"WinVNC hide",
"platform"=>"w32",
"priority"=>6,
+ "icon"=>"nowinvnc",
"download-already patched version 3.3.3r9"=>"vnc-3.3.3r9_x86_win32-exe-SECRET.zip",
"download-original version 3.3.3r9"=>"http://www.uk.research.att.com/vnc/dist/vnc-3.3.3r9_x86_win32.zip",
"download-already patched version 3.3.3r7"=>"vnc-3.3.3r7_x86_win32-exe-SECRET.zip",
diff --git a/project/winvnc/nowinvnc.png b/project/winvnc/nowinvnc.png
new file mode 100644
index 0000000..8fa619e
Binary files /dev/null and b/project/winvnc/nowinvnc.png differ
diff --git a/project/xbill/Index.html.pl b/project/xbill/Index.html.pl
index 6c3bbbb..05b90a5 100755
--- a/project/xbill/Index.html.pl
+++ b/project/xbill/Index.html.pl
@@ -38,11 +38,11 @@ My::Project->init_project(
print <<"HERE";
-This project has been moved to @{[ a_href 'http://sourceforge.net/','SourceForge' ]}.
-Please refer to its @{[ a_href 'http://xbill.sourceforge.net/','SourceForge project page' ]}.
-HERE
+This project has been moved to @{[ a_href 'http://sourceforge.net/','SourceForge' ]}.
+Please refer to its @{[ a_href 'http://xbill.sourceforge.net/','SourceForge project page' ]}.
-print ''.My::Web::img("redmond_.jpeg","xBill").' |
'."\n";
+@{[ centerimg "redmond_.jpeg","xBill" ]}
+HERE
My::Web->footer();
diff --git a/project/xbill/ListItem.pm b/project/xbill/ListItem.pm
index bbeee36..fb0215d 100755
--- a/project/xbill/ListItem.pm
+++ b/project/xbill/ListItem.pm
@@ -32,6 +32,7 @@ our @ListItem=(
"name"=>"Gnome xBill",
"platform"=>"unixuser",
"priority"=>7,
+ "icon"=>"redmond-icon",
"link-Download from SourceForge.net"=>"http://sourceforge.net/project/showfiles.php?group_id=10700",
"link-Homepage on SourceForge.net"=>"http://xbill.sourceforge.net/",
"summary"=>"xBill game rewritten with network support and Gnome/GTK+",
diff --git a/project/xbill/redmond-icon.png b/project/xbill/redmond-icon.png
new file mode 100644
index 0000000..d229977
Binary files /dev/null and b/project/xbill/redmond-icon.png differ