?login_element?

Subversion Repositories NedoOS

Rev

Rev 1764 | Rev 1984 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed

  1.     module History
  2. back:
  3.     ld a, (depth) : cp 1 : jp z, load
  4.     ld hl, historyBlock + HistoryRecord, de, historyBlock, bc, (total - 1) * HistoryRecord : ldir ; Move history up
  5.     ld hl, depth : dec (hl)
  6. ; Loads current resource
  7. load:
  8.     ld hl, .msg : call DialogBox.msgNoWait
  9.     xor a : ld hl, outputBuffer, de, outputBuffer + 1
  10.         IFDEF MSX
  11.         ld bc, (ramtop)
  12.         dec bc
  13.         ELSE
  14.         ld bc, #ffff - outputBuffer - 1
  15.         ENDIF
  16.  
  17.     ld (hl), a
  18.     ldir
  19.    
  20.     ld a, (historyBlock.isFile) : and a : jp nz, Fetcher.fetchFromFS
  21.     jp Fetcher.fetchFromNet
  22.  
  23. .msg db "    Loading resource! Please wait! It will be here soon!", 0
  24.  
  25. home:
  26.     ld hl, homePage
  27. ; HL - gopher row
  28. navigate:
  29.     ld de, hl
  30.     call UrlEncoder.isValidGopherRow
  31.     jr nc, load ; Not valid - reload last
  32.     ld hl, de
  33.     push hl
  34.  
  35.     push hl
  36.     ld hl, HistoryEnd - HistoryRecord, de, HistoryEnd, bc,  HistoryRecord * total : lddr
  37.  
  38.     ld de, (Render.position), (historyBlock.position + HistoryRecord), de
  39.     ; Clean up struct
  40.     xor a : ld hl, historyBlock, de, historyBlock + 1, bc, historyBlockSize - 1, (hl), a : ldir
  41.     pop hl
  42.  
  43.     ; Fill record
  44.     ld de, hl
  45.     call UrlEncoder.isFile
  46.     ex hl, de
  47.     ld de, historyBlock
  48.     ld (de), a : inc de
  49.     ld a, (hl) : push hl, de : call Render.getIcon : pop de, hl
  50.     ld (de), a : inc de
  51.     ld a, 9
  52.    
  53.     IFDEF MSX
  54.         ld bc, #ff
  55.     ELSE
  56.         ld bc, #ff
  57.     ENDIF
  58.    
  59.     cpir
  60. .locatorCopy
  61.     ld a, (hl) : cp 9 : jr z, 1f
  62.     ld (de), a : inc hl, de
  63.     jr .locatorCopy
  64. 1
  65.     inc hl : xor a : ld (de), a
  66.     ld de, historyBlock.host
  67. .hostCopy
  68.     ld a, (hl) : cp 9 : jr z, 1f
  69.     ld (de), a : inc hl, de
  70.     jr .hostCopy
  71. 1
  72.     inc hl : xor a : ld (de), a
  73.     ld de, historyBlock.port
  74. .portCopy
  75.     ld a, (hl)
  76.     cp 9 : jr z, 1f
  77.     cp 13 : jr z, 1f
  78.     cp 10 : jr z, 1f
  79.     cp 0  : jr z, 1f
  80.     ld (de), a : inc hl, de
  81.     jr .portCopy
  82. 1   xor a : ld (de), a
  83.     ld hl, DialogBox.inputBuffer, de, historyBlock.search, bc, #ff : ldir
  84.     ld de, 0, (historyBlock.position), de
  85.     pop hl
  86.     ld a, (depth) : cp total : jr nc, 1f
  87.     inc a : ld (depth), a
  88. 1
  89.     ld a,(historyBlock.mediaType) : cp MIME_DOWNLOAD : jp z, Gopher.download
  90.    
  91.     ifdef GS
  92.     ld a,(historyBlock.mediaType)
  93.     cp MIME_MOD
  94.     jp nz,load
  95.     ld a,(GeneralSound.GSdownType)
  96.     xor 1
  97.     jp z, downMod2file
  98.  
  99. downMod2GS
  100.     jp Gopher.loadMod
  101. downMod2file    
  102.     jp Gopher.download
  103.     else
  104.     ld a,(historyBlock.mediaType) : cp MIME_MOD : jp z, Gopher.download
  105.     endif
  106.  
  107.     jp load
  108.    
  109. homePage:    
  110.         IFDEF MSX
  111.         db "1Home", TAB, "index.gph"
  112.         db TAB, "file", TAB, "70", CR, LF, 0
  113.     ELSE
  114.         db "1Home", TAB, "browser/index.gph"
  115.         db TAB, "file", TAB, "70", CR, LF, 0
  116.     ENDIF  
  117.     endmodule