Update....
Progress has slowed due to work and other distractions but some advances have been made. I have written my own text scrolling routine which is a vast improvement on the scroll used by the spectraNet ROM. I will post the scroll code below. I am very open to suggestions for this routine. The routine + lookup table costs 404 bytes. I am sure there are ways to reduce the size without reducing the speed. I have also added some text formatting to stop words being cut in half. Things look OK, but the MUD data has a carriage return at the end of each 80 character line so some lines leave excess white space at the ends. Really to improve the text formatting, the MUD data would have to be changed. Editing the default circleMUD world would take many hours. I have spent a few hours learning how to structure the MUD files and have added a few new locations and a portal system to gain access to the default circleMUD world. The new locations are more friendly to the 42 char client.
https://www.youtube.com/watch?v=mMpVs27dS00
The assembly for my 52 byte scroll routine.
Code: Select all
;;; scroll the text window up one row
;;; B = number of rows to scroll up
Scroll_Up
push bc
halt
ld b,168 ; we will loop for 168 lines of screen memory
scroll_loop
push bc
;; source and destination are referenced from a lookup table (screen-lookup.asm)
source
ld hl,(screen_lookup+16) ; source is 8 lines below destination (each line is a 2 byte address)
destination
ld de,(screen_lookup)
ld bc,32 ; copy 32 bytes, the length of one line
ldir ; perform copy
;; increment the source and destination lookup pointers
ld hl,(destination+2) ; ld de,(NN) uses ED prefix hence +2
inc hl
inc hl
ld (destination+2),hl
ld hl,(source+1)
inc hl
inc hl
ld (source+1),hl
pop bc
djnz scroll_loop
;; reset the source and destination pointers
ld hl,screen_lookup+16
ld (source+1),hl
ld hl,screen_lookup
ld (destination+2),hl
pop bc
djnz Scroll_Up
The routine uses a 352 byte lookup table :
Code: Select all
;;; Lookup table of the address of the first byte of each pixel line
;;; Row 00
;defw 16384 ; 000
;defw 16640 ; 001
;defw 16896 ; 002
;defw 17152 ; 003
;defw 17408 ; 004
;defw 17664 ; 005
;defw 17920 ; 006
;defw 18176 ; 007
;;; Row 01
screen_lookup ;this label marks the top of the scroll window
defw 16416 ; 008
defw 16672 ; 009
defw 16928 ; 010
defw 17184 ; 011
defw 17440 ; 012
defw 17696 ; 013
defw 17952 ; 014
defw 18208 ; 015
;;; Row 02
defw 16448 ; 016
defw 16704 ; 017
defw 16960 ; 018
defw 17216 ; 019
defw 17472 ; 020
defw 17728 ; 021
defw 17984 ; 022
defw 18240 ; 023
;;; Row 03
defw 16480 ; 024
defw 16736 ; 025
defw 16992 ; 026
defw 17248 ; 027
defw 17504 ; 028
defw 17760 ; 029
defw 18016 ; 030
defw 18272 ; 031
;;; Row 04
defw 16512 ; 032
defw 16768 ; 033
defw 17024 ; 034
defw 17280 ; 035
defw 17536 ; 036
defw 17792 ; 037
defw 18048 ; 038
defw 18304 ; 039
;;; Row 05
defw 16544 ; 040
defw 16800 ; 041
defw 17056 ; 042
defw 17312 ; 043
defw 17568 ; 044
defw 17824 ; 045
defw 18080 ; 046
defw 18336 ; 047
;;; Row 06
defw 16576 ; 048
defw 16832 ; 049
defw 17088 ; 050
defw 17344 ; 051
defw 17600 ; 052
defw 17856 ; 053
defw 18112 ; 054
defw 18368 ; 055
;;; Row 07
defw 16608 ; 056
defw 16864 ; 057
defw 17120 ; 058
defw 17376 ; 059
defw 17632 ; 060
defw 17888 ; 061
defw 18144 ; 062
defw 18400 ; 063
;;; Row 08
defw 18432 ; 064
defw 18688 ; 065
defw 18944 ; 066
defw 19200 ; 067
defw 19456 ; 068
defw 19712 ; 069
defw 19968 ; 070
defw 20224 ; 071
;;; Row 09
defw 18464 ; 072
defw 18720 ; 073
defw 18976 ; 074
defw 19232 ; 075
defw 19488 ; 076
defw 19744 ; 077
defw 20000 ; 078
defw 20256 ; 079
;;; Row 10
defw 18496 ; 080
defw 18752 ; 081
defw 19008 ; 082
defw 19264 ; 083
defw 19520 ; 084
defw 19776 ; 085
defw 20032 ; 086
defw 20288 ; 087
;;; Row 11
defw 18528 ; 088
defw 18784 ; 089
defw 19040 ; 090
defw 19296 ; 091
defw 19552 ; 092
defw 19808 ; 093
defw 20064 ; 094
defw 20320 ; 095
;;; Row 12
defw 18560 ; 096
defw 18816 ; 097
defw 19072 ; 098
defw 19328 ; 099
defw 19584 ; 100
defw 19840 ; 101
defw 20096 ; 102
defw 20352 ; 103
;;; Row 13
defw 18592 ; 104
defw 18848 ; 105
defw 19104 ; 106
defw 19360 ; 107
defw 19616 ; 108
defw 19872 ; 109
defw 20128 ; 110
defw 20384 ; 111
;;; Row 14
defw 18624 ; 112
defw 18880 ; 113
defw 19136 ; 114
defw 19392 ; 115
defw 19648 ; 116
defw 19904 ; 117
defw 20160 ; 118
defw 20416 ; 119
;;; Row 15
defw 18656 ; 120
defw 18912 ; 121
defw 19168 ; 122
defw 19424 ; 123
defw 19680 ; 124
defw 19936 ; 125
defw 20192 ; 126
defw 20448 ; 127
;;; Row 16
defw 20480 ; 128
defw 20736 ; 129
defw 20992 ; 130
defw 21248 ; 131
defw 21504 ; 132
defw 21760 ; 133
defw 22016 ; 134
defw 22272 ; 135
;;; Row 17
defw 20512 ; 136
defw 20768 ; 137
defw 21024 ; 138
defw 21280 ; 139
defw 21536 ; 140
defw 21792 ; 141
defw 22048 ; 142
defw 22304 ; 143
;;; Row 18
defw 20544 ; 144
defw 20800 ; 145
defw 21056 ; 146
defw 21312 ; 147
defw 21568 ; 148
defw 21824 ; 149
defw 22080 ; 150
defw 22336 ; 151
;;; Row 19
defw 20576 ; 152
defw 20832 ; 153
defw 21088 ; 154
defw 21344 ; 155
defw 21600 ; 156
defw 21856 ; 157
defw 22112 ; 158
defw 22368 ; 159
;;; Row 20
defw 20608 ; 160
defw 20864 ; 161
defw 21120 ; 162
defw 21376 ; 163
defw 21632 ; 164
defw 21888 ; 165
defw 22144 ; 166
defw 22400 ; 167
;;; Row 21
output_line
defw 20640 ; 168
defw 20896 ; 169
defw 21152 ; 170
defw 21408 ; 171
defw 21664 ; 172
defw 21920 ; 173
defw 22176 ; 174
defw 22432 ; 175
;;; Row 22
defw 20672 ; 176
defw 20928 ; 177
defw 21184 ; 178
defw 21440 ; 179
defw 21696 ; 180
defw 21952 ; 181
defw 22208 ; 182
defw 22464 ; 183
;;; Row 23
status_line
defw 20704 ; 184
;defw 20960 ; 185
;defw 21216 ; 186
;defw 21472 ; 187
;defw 21728 ; 188
;defw 21984 ; 189
;defw 22240 ; 190
;defw 22496 ; 191
I have also set up a TNFS server on the Pi alongside the MUD server. I will be adding in-line images very soon.
Imminent ToDo's
- Delete key. Still not got one.
- 10kb text buffer, allowing the user to scroll back text to re-read it.
- A 'More..' prompt when the incoming data goes over 21 lines. Client will wait for a space bar before continuing.
I am pretty much ready to put this thing online for testing. My only reservation at this point is security. How much of a risk is forwarding a couple of ports (TCP for the MUD, UDP for the TNFS server) to a Pi running on a standard broadband router?
I could afford to rent some server space and host the two servers on that which would remove the need to publish my home IP, but if it is relatively safe to run TNFS/MUD from home I would do it that way and forgo the cost.
I have set up the TNFS server to deliver the latest version of the SpectraMUD client, so you can set it up as a default filesystem and boot straight into the latest version.