music playing support and using shadow screen

This commit is contained in:
nihirash 2019-07-26 00:13:15 +03:00
parent 07e997ce60
commit 4253d96253
11 changed files with 1330 additions and 50 deletions

View File

@ -1,4 +1,4 @@
*.tap
player.bin
ugoph.bin
.vscode
dist/
.vscode

View File

@ -1,6 +1,9 @@
all: ugoph.bin
ugoph.bin: *.asm *.pg
player.bin: vtpl.asm
sjasmplus vtpl.asm
ugoph.bin: *.asm player.bin
sjasmplus main.asm
clean:

Binary file not shown.

View File

@ -6,6 +6,9 @@ openPage:
push de
push bc
xor a
call changeBank
ex hl, de
ld de, hist
@ -22,6 +25,10 @@ openPage:
pop de
pop hl
call makeRequest
xor a
call changeBank
ld hl, page_buffer
call loadData
xor a
@ -41,6 +48,9 @@ makeRequest:
ld hl, downloading_msg
call showTypePrint
xor a
call changeBank
ld hl, cmd_open1 ; Open TCP connection
call uartWriteStringZ
pop hl
@ -205,7 +215,7 @@ closed_callback
hostTxt db 'Enter host: ', 0
d_path db '/'
defs 69
defs 254
d_host defs 70
d_port db '70'
defs 5

View File

@ -1,19 +0,0 @@
iWelcome to uGophy v.0.5 fake (NULL) 0
i fake (NULL) 0
i(c) 2019 Alexander Sharikhin aka Nihirash fake (NULL) 0
i fake (NULL) 0
iVersion 0.5 - User input on gopher pages supported fake (NULL) 0
i fake (NULL) 0
iThis version works on 14MHz turbo mode fake (NULL) 0
iIf you using old core - please update. fake (NULL) 0
i fake (NULL) 0
iNavigation keys: fake (NULL) 0
iQ - Up fake (NULL) 0
iA - Down fake (NULL) 0
iB - History back fake (NULL) 0
iO - Enter server name to browse(using port 70) fake (NULL) 0
iEnter - Visit page/Download file fake (NULL) 0
i fake (NULL) 0
iBookmarks: fake (NULL) 0
1Nihirash.net - BIG collection of games and nihirash's things / nihirash.net 70
1Logout128's gopherspace. Phlog aggregator are there / i-logout.cz 70

View File

@ -1,14 +1,26 @@
DEVICE ZXSPECTRUM48
DEVICE ZXSPECTRUM128
org 24100
Start:
jp run
ds #21d9
run:
xor a
call changeBank
ld de, #4000
ld bc, eop - page_buffer
ld hl, page_buffer
ldir
call renderHeader
ld hl, connecting_wifi
call printZ64
call initWifi
ld de, path
ld hl, server
ld bc, port
call openPage
jp showPage
wSec: ld b, 50
wsLp halt
djnz wsLp
@ -27,17 +39,14 @@ wsLp halt
connecting_wifi db 13, ' Connecting to WiFi', 13, 0
open_lbl db 'Opening connection to ', 0
path db '/'
defs 254
path db '/unomenu'
defs 247
server db 'nihirash.net'
defs 58
port db '70'
defs 5
page_buffer
display "Page buffer starts here"
display $
incbin "index.pg"
db 0
db 0
page_buffer equ $
INCBIN "player.bin"
eop equ $
SAVEBIN "ugoph.bin", Start, eop - Start
SAVEBIN "ugoph.bin", Start, $ - Start

View File

@ -7,6 +7,10 @@ showPage:
call showCursor
showLp:
call controls
xor a
call changeBank
dup 5
halt
edup
@ -176,7 +180,7 @@ downFl:
call cleanIBuff
ld hl, file_buffer
call findFnme
jp isImage
jp isOpenable
dfl:
ld hl, file_buffer
call findFnme
@ -195,18 +199,23 @@ dfl:
call showCursor
ret
isImage:
isOpenable:
ld a, (hl)
and a
jr z, checkImg
jr z, checkFile
push hl
call pushRing
pop hl
inc hl
jr isImage
jr isOpenable
imgExt db ".scr", 0
imgExt2 db ".SCR", 0
checkImg:
pt3Ext db ".pt3", 0
pt3Ext2 db ".PT3", 0
checkFile:
;; Images
ld hl, imgExt
call searchRing
cp 1
@ -216,23 +225,71 @@ checkImg:
call searchRing
cp 1
jr z, loadImage
;; Music
ld hl, pt3Ext
call searchRing
cp 1
jr z, playMusic
ld hl, pt3Ext2
call searchRing
cp 1
jr z, playMusic
jp dfl
loadImage:
ld hl, server_buffer
ld de, file_buffer
ld bc, port_buffer
call makeRequest
ld hl, #4000
ld a, 7
call changeBank
ld hl, #c000
call loadData
ld c, #ff
xor a
out (c), a
wKey: call inkey
or a
jr z, wKey
xor a
call changeBank
jp showPage
playMusic:
ld hl, hist
ld de, path
ld bc, 322
ldir
ld hl, server_buffer
ld de, file_buffer
ld bc, port_buffer
call openPage
ld hl, playing
call showTypePrint
xor a
call changeBank
ld hl, page_buffer
call #4003
playLp:
halt
call #4005
in a, (#fe)
cpl
and 15
jr z, playLp
call #4008
jp historyBack
findFnme:
push hl
pop de
@ -481,10 +538,10 @@ show_offset db 0
display $
cursor_pos db 1
head db " UGophy - ZX-UNO Gopher client v. 0.5 (c) Alexander Sharikhin", 13,0
head db " UGophy - ZX-UNO Gopher client v. 0.6 (c) Alexander Sharikhin", 13,0
cleanLine db " ",0
playing db "Playing... Hold <SPACE> to stop!", 0
type_inpt db "User input: ", 0
type_text db "Text file: ", 0
type_info db "Information ", 0

View File

@ -4,6 +4,10 @@ showText:
call renderTextScreen
showTxLp:
call txControls
xor a
call changeBank
dup 5
halt
edup

View File

@ -12,6 +12,8 @@ ilp
push bc
push de
call findAddr
ld a, 7
call changeBank
ld b, 8
iCLP:
@ -24,7 +26,11 @@ iCLP:
inc e
pop bc
djnz ilp
ret
;xor a
;call changeBank
ret
gotoXY:
ld (coords), bc
@ -55,6 +61,10 @@ putC:
ret nc
push bc
ld a, 7
call changeBank
call findAddr
pop af
ld l, a
@ -83,9 +93,9 @@ findAddr:
ld a, e
srl a
ld e, a
ld hl, 8192
ld hl, #A000
jr c, fa1
ld hl, 0
ld hl, #8000
fa1:
LD A,D
AND 7
@ -103,9 +113,15 @@ fa1:
ret
clearScreen:
ld a, 7
call changeBank
ld c, #ff
ld a, #3E
out (c), a
di
ld hl,0
ld d,h
@ -113,7 +129,7 @@ clearScreen:
ld b,h
ld c,b
add hl,sp
ld sp,16384+6144
ld sp,#c000 + 6144
clgloop
push de
push de
@ -133,7 +149,7 @@ clgloop
djnz clgloop
ld b,c
ld sp,24576+6144
ld sp,#e000 + 6144
clgloop2:
push de
push de
@ -153,6 +169,10 @@ clgloop2:
djnz clgloop2
ld sp,hl
xor a
call changeBank
ei
ret

View File

@ -2,6 +2,13 @@ SCANDBLCTRL_REG = #0B
ZXUNO_ADDR = #FC3B
ZXUNO_REG = #FD3B
; A - memory bank
changeBank:
ld bc, #7ffd
or #18
out (c), a
ret
setNoTurboMode:
push af
push bc

1189
software/ugophy/vtpl.asm Normal file

File diff suppressed because it is too large Load Diff