A few days ago I coded The Matrix digital rain effect, a fictional representation of the code for the virtual reality of The Matrix. The technique is simple: fill the screen with random characters and scroll down columns of attributes, occasionally switching between black and green.
Here's the final code - 147 bytes of Z80 using the default Sinclair font:
org 08000h
; black border / black attributes
xor a
out (0FEh),a
ld hl,05AFFh
attr: ld (hl),a
dec hl
bit 2,h
jr z,attr
; fill screen with random characters
ld e,a
fillscr:ld d,040h
fill: call rndchar
ld a,d
cp 058h
jr nz,fill
inc e
jr nz,fillscr
; digital rain loop
frame: ld b,06h
halt
column: push bc
; randomize one character
call random
and 018h
jr z,docol
add a,038h
ld d,a
call random
ld e,a
call rndchar
; select a random column
docol: call random
and 01Fh
ld l,a
ld h,058h
; ~1% chance black -> white
ld a,(hl)
or a
ld bc,0247h
jr z,check
; white -> bright green
white: cp c
ld c,044h
jr z,movecol
; bright green -> green
cp c
ld c,04h
jr z,movecol
; ~6% chance green -> black
ld bc,0F00h
check: call random
cp b
jr c,movecol
ld c,(hl)
; move column down
movecol:ld de,020h
ld b,018h
down: ld a,(hl)
ld (hl),c
ld c,a
add hl,de
djnz down
pop bc
djnz column
; test for keypress
ld bc,07FFEh
in a,(c)
rrca
jr c,frame
ret
; display a random glyph
rndchar:call random
crange: sub 05Fh
jr nc,crange
add a,a
ld l,a
ld h,0
add hl,hl
add hl,hl
ld bc,(05C36h)
add hl,bc
ld b,8
char: ld a,(hl)
ld (de),a
inc d
inc hl
djnz char
ret
; get a byte from the ROM
random: push hl
ld hl,(seed)
inc hl
ld a,h
and 01Fh
ld h,a
ld (seed),hl
ld a,(hl)
pop hl
ret
seed:

Hi!
ReplyDeleteI assembled this code snippet using zeus (cross-assembler by Mottershead and Brattel), and ran it in the zeus built-in emulator and also in spectaculator,
However, the code stops on the halt instruction. Only if I comment it out will the code run properly on both emulators.
Since both emulators have no issues running large programs and spectaculator runs most existing games, I'm curious as to why this doesn't work?
/// Magnus
I am glad that I saw this post. It is informative blog for us and we need this type of blog thanks for share this blog, Keep posting such instructional blogs and I am looking forward for your future posts. Python Projects for Students Data analytics is the study of dissecting crude data so as to make decisions about that data. Data analytics advances and procedures are generally utilized in business ventures to empower associations to settle on progressively Python Training in Chennai educated business choices. In the present worldwide commercial center, it isn't sufficient to assemble data and do the math; you should realize how to apply that data to genuine situations such that will affect conduct. In the program you will initially gain proficiency with the specialized skills, including R and Python dialects most usually utilized in data analytics programming and usage; Python Training in Chennai at that point center around the commonsense application, in view of genuine business issues in a scope of industry segments, for example, wellbeing, promoting and account. Project Center in Chennai
DeleteDid it in BASIC on a TRS-80 MC-10:
ReplyDeletehttps://youtu.be/53OgDv_BuQk
Cool stuff :-)
ReplyDeletePerl doesn't offer the designs and security wanted for Internet programming without anyone else.here
ReplyDeleteThe A+ programming language also has an automatic synchronization of widgets and variables, and finally but not least, it also has an asynchronous execution of functions associated with variable and events.Handle session in perl
ReplyDeleteThe A+ programming language also has an automatic synchronization of widgets and variables, and finally but not least, it also has an asynchronous execution of functions associated with variable and events.JQuery editable tables
ReplyDeleteIf you did not understand that comparison, don't worry about it too much. Object orientation is hard to get your head around, but any basic Java or other object-oriented language tutorial will have you understanding everything in that paragraph.best office chair for lower back pain
ReplyDeleteThe likenesses between these two movies, 123movies 2020 website in any case, immeasurably exceed the distinctions.
ReplyDeleteMP Board 12th Class Blueprint 2021 English Medium & Hindi Medium PDF download, MPBSE 12th Blueprint 2021 Pdf Download, mpbse.nic.in 12th Blue Print, Marking Scheme and Arts, Commerce and Science Streams Chapter wise Weightage pdf download. MP Board 12th Blue Print || MPBSE 12th Model Papers || MPBSE 10th Model Papers
ReplyDeleteManabadi AP Intermediate 2nd Year Model Question Paper 2021 MPC, BIPC, CEC, MEC group TM, EM Subject wise Blue Print, Download BIEAP Intermediate Second Year Model Question Papers, AP Senior Inter Test Papers, Chapter wise important Questions download. || AP Inter MPC, Bi.PC, CEC Blue Print || AP Inter 1st / 2nd Year Model Papers || AP 2nd year inter Test Papers
Kar 1st / 2nd PUC Blue Print || UP Board 12th Blueprint 2021
I really enjoy reading of your article. I wanted to inform you that you have people like me who appreciate your work. sms bomber apk editor no wifi games
ReplyDeleteKar PUC Model Paper 2021 Download
ReplyDelete1st PUC Model Question Paper 2021
Kar II PUC Model Paper 2021
Puc Model Paper 2021
Question Bank - PUE
www.pue.kar.nic.in
pue.kar.nic.in Model Question Paper
Model Paper 2021
ReplyDeletePSC Result 2020
Ebtedayee Result 2020 Madrasah Board EBT Markslist
HP Board 12th Model Paper 2021
JKBOSE 12th Question Paper 2021
PSEB 12th Sample Paper 2021
GSEB 12th Std Question Paper 2021
Bihar Board 12th Model Paper 2021
pue.kar.nic.in
ReplyDeleteKarnataka II PUC Question Paper 2021
Kar 2nd PUC Model Paper 2021
Karnataka II PUE Syllabus 2021
KAR I PUC Question Paper 2021
Karnataka 1st PUC Syllabus 2021
KAR 1st / 2nd PUC Blueprint 2021
ReplyDeleteModel Question Papers 2021 Previous Question Paper
Model Question Paper 2021 Download
Model Question Paper 2021 Download
Model Question Paper 2021 Download
Model Question Paper 2021 Download
Model Question Paper 2021 Download
Model Question Paper 2021 Download
Model Question Paper 2021 Download
Model Question Paper 2021 Download
Model Question Paper 2021 Download
Model Papers 2021 Question Paper 2021
ReplyDeleteTN Plus Two Model Paper
Kar 2nd PUC Model Question Paper
HPBOSE Board 10th Model Paper
JNVST Navodaya Previous Model Question Paper
UBSE Board 12th Model Paper
UP Board 12th Model Paper
APSEAP 10th Model paper
TS Intermediate 1st Year and 2nd Year Model Paper
AP Intermediate Model Paper
Model Papers 2021
ReplyDeleteQuestions Papers 2021
Model Question Papers 2021 Previous Question Paper
TS 10th Model Papers 2021
KAR SSLC Model Papers 2021
JAC 12th Model Papers 2021
MP 10th Blue Print
AP EAMCET Results 2020 APSCHE Result
ReplyDeleteAP EAMCET Results 2020 APSCHE Result
TS EAMCET Result 2020 TSCHE Results
AP ECET Result 2020 APSCHE Results
Model Question Papers 2021 Previous Question Paper
AP EAMCET Results 2020 APSCHE Result
ReplyDeleteAP EAMCET Results 2020 APSCHE Result
ReplyDeleteTS EAMCET Result 2020 TSCHE Results
ReplyDeleteThis is one of the most incredible blogs Ive read in a very long time.
ReplyDeletevé máy bay tết giá rẻ nhất
lịch bay hà nội đà nẵng
vé máy bay đi nha trang tháng 10
vé máy bay khứ hồi hà nội phú quốc
giá vé máy bay hà nội liên khương
Thanks for sharing AP TET Notification 2021
ReplyDeleteThanks for sharing its very nice Bihar Board 12th Result 2021
ReplyDelete