-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
History refactoring. It fixes bug and adds multilevel history
- Loading branch information
Showing
18 changed files
with
177 additions
and
192 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
include "history/index.asm" | ||
include "urlencoder.asm" | ||
include "fetcher.asm" | ||
include "media-processor.asm" | ||
include "history.asm" | ||
include "media-processor.asm" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
MODULE History | ||
|
||
back: | ||
ld a, (depth) : cp 1 : ret z | ||
ld hl, historyBlock + HistoryRecord, de, historyBlock, bc, (total - 1) * HistoryRecord : ldir ; Move history up | ||
ld hl, depth : dec (hl) | ||
; Loads current resource | ||
load: | ||
ld hl, .msg : call DialogBox.msgNoWait | ||
xor a : ld hl, buffer, de, buffer + 1, bc, #ffff - buffer - 1, (hl), a : ldir | ||
ld a, (historyBlock.isFile) : and a : jp nz, Fetcher.fetchFromFS | ||
jp Fetcher.fetchFromNet | ||
|
||
.msg db "Loading resource! Please wait! It will be here soon!", 0 | ||
|
||
home: | ||
ld hl, homePage | ||
; HL - gopher row | ||
navigate: | ||
ld de, hl | ||
call UrlEncoder.isValidGopherRow | ||
jr nc, load ; Not valid - reload last | ||
ld hl, de | ||
push hl | ||
|
||
push hl | ||
ld hl, HistoryEnd - HistoryRecord, de, HistoryEnd, bc, HistoryRecord * total : lddr | ||
pop hl | ||
|
||
; Fill record | ||
ld de, hl | ||
call UrlEncoder.isFile | ||
ex hl, de | ||
ld de, historyBlock | ||
ld (de), a : inc de | ||
ld a, (hl) : push hl, de : call Render.getIcon : pop de, hl | ||
ld (de), a : inc de | ||
ld a, 9, bc, #ff : cpir | ||
.locatorCopy | ||
ld a, (hl) : cp 9 : jr z, 1f | ||
ld (de), a : inc hl, de | ||
jr .locatorCopy | ||
1 | ||
inc hl : xor a : ld (de), a | ||
ld de, historyBlock.host | ||
.hostCopy | ||
ld a, (hl) : cp 9 : jr z, 1f | ||
ld (de), a : inc hl, de | ||
jr .hostCopy | ||
1 | ||
inc hl : xor a : ld (de), a | ||
ld de, historyBlock.port | ||
.portCopy | ||
ld a, (hl) | ||
cp 9 : jr z, 1f | ||
cp 13 : jr z, 1f | ||
cp 10 : jr z, 1f | ||
cp 0 : jr z, 1f | ||
ld (de), a : inc hl, de | ||
jr .portCopy | ||
1 xor a : ld (de), a | ||
ld hl, DialogBox.inputBuffer, de, historyBlock.search, bc, #ff : ldir | ||
ld de, (Render.position), (historyBlock.position + HistoryRecord), de | ||
ld de, 0, (historyBlock.position), de | ||
pop hl | ||
ld a, (depth) : cp total : jr nc, 1f | ||
inc a : ld (depth), a | ||
1 | ||
jp load | ||
|
||
ENDMODULE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
include "controller.asm" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
; This shit brokes adressing!!!! | ||
; | ||
; STRUCT HistoryRecord | ||
;isFile BYTE | ||
;mediaType BYTE | ||
;locator BLOCK #ff | ||
;host BLOCK 64 ; If you'll use longer host name - you're "сам себе злобный буратино"(you're your only enemy) | ||
;port BLOCK 6 ; can be up to 65535 | ||
;search BLOCK #FF | ||
;position WORD #00 | ||
; ENDS | ||
|
||
|
||
total equ 5 | ||
depth db 0 | ||
|
||
historyBlock: | ||
.isFile db 0 | ||
.mediaType db 0 | ||
.locator ds #ff | ||
.host ds 64 | ||
.port ds 6 | ||
.search ds #ff | ||
.position dw #00 | ||
|
||
HistoryRecord EQU $ - historyBlock | ||
dup total | ||
ds HistoryRecord | ||
edup | ||
HistoryEnd equ $ - 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,4 @@ | ||
nameBuffer db "index.gph", 0 | ||
ds #7f - ($ - nameBuffer), 0 | ||
nameBuffer ds #ff, 0 | ||
db 0 | ||
hostName ds 48 | ||
|
||
MODULE History | ||
row db "1Starting page", 09, "index.gph", 09, "file", 09, "70", 13, 10 | ||
ds #ff - ($ - row) | ||
prev db "1Starting page", 09, "index.gph", 09, "file", 09, "70", 13, 10 | ||
ds #ff - ($ - prev) | ||
position dw 0 | ||
input db 0 | ||
ENDMODULE | ||
hostName ds 64 |
Oops, something went wrong.