; Title : Wormy
-; Version : 96% (0.96.C21)
+; Version : 96% (0.96.C24)
; Release Date : UUHHhhh... soon?!?
; Filename : wormy.86p (5kb)
; Author(s) : Shiar
; 96% = DONE
-; * complete readme
-; 1% * misc (pollish, bugs, &&&)
-; * mem at worm #4 (still 12 bytes or so.....)
-; * fix line proc (+large circles)
+; 1% * misc (bugs, &&&, pollish, &&, &)
+; * mem at worm #4 (still 12 bytes or so.. or more? or less?)
+; * look at init-z in line routine again
; * LINK
-; 1% * fix transmit game/level data
+; 1% * fix transmit game/level data (?)
+; * >Somehow do a lot of testing with 2 calcs< *sigh*
;100% = bugs fixed + levels done
-;>110%: sound, startpos
+;>110%: sound, startpos (?)
;>120%: coop (DON'T COUNT ON IT)
;-----------------------------
;-----------------------------
;-----------------------------
+;NOTES:
+;* Use for LEARNING practises ONLY!
+; Don't ever release altered code w/o permission!
+;* Code was originally by Scabby (Matthew Shepcar),
+; a few lines by Jonah Cohen,
+; and everything else by me - Shiar (Mischa Poslawsky).
+;* Although I've commented quite some stuff, I can't guarantee
+; everybody will understand it. This is probably not the best source
+; to learn z80 from. w00t the Shyer Way (tm).
+;* Don't scroll down if you get scared easily.
+
#define buffer ;use display buffer (otherwise write directly to screen)
#define readymask ;"greys" out the field before starting a level
#define coolzgfx ;nice graphics for game over screen
leveldata = $F400 ;-FA70 (<=671)
;can you believe i actually left $269 bytes of memory unused?!?
-;MEM|8---9---A---B---C---D---E---F---|
-; |..[------]||[]|......[-----]|[].|
-; | SCREEN 2* 13 PRGM 4LV |
+;MEM|8---9---A---B---C---D---E---F---| ;there's something wrong
+; |..[------]||[]|......[-----]|[].| ;if you still understand
+; | SCREEN 2* 13 PRGM 4LV | ;after looking at this
;--- temporary
.org %1101011101001000
-start:
- nop
+start: ;turn back NOW!
+ nop ;and so it begins...
jp Start
ld bc,42
.org $-1 ;3y3 M 1337!
.db %1010010
jr nz,$+47
dec l
- .db " 96% C21",0
+ .db " 96% C24",0
WormIcon:
.db 8,2
.db %00000000,%00111100
inc ix
_searchnext:
cal _RAM_PAGE_7
- jr searchnext
+ jr searchnext
loadgametype:
psh de
#else
ld ix,templevels-3
#endif
-levelselectmenu:
+ cp (ix+3) ;1st=255
+ jp z,ExitNoStats ;->no lvls
psh ix ;offset
+ cp (ix+6) ;2nd=255
+ jr z,loadlevel1 ;->1 lvl
+levelselectmenu: ;load next page
ld a,-2
ld (availevels),a
cal _clrWindow
ld hl,$0601 ;x=1
ld (_penCol),hl
dispnextlevel:
- ld a,(ix+3)
+ ld de,3
+ add ix,de
+ ld a,(ix)
ld b,a
inc a ;cp 255
jr z,__levselect
ld (hl),a ;y+6
cp 49 ;bottom of screen
jr nc,_levselect
- ld de,3
- add ix,de
ld hl,availevels
inc (hl)
ld a,b ;(ix+0)
cal _vputs
jr dispnextlevel
+loadlevel1:
+ pop hl
+ ld b,-2
+ jr loadlevel
+
readylevelfile: ;selected level at ahl
; ld hl,templevels-3/0
ld a,b
;----- build trig tables -----
;-----------------------------
- ld hl,TrigPrecalc
- ld de,SinCosTable
- psh de
- ld bc,65
- ldir
+ ld hl,TrigPrecalc ;I believe this
+ ld de,SinCosTable ;is one of the few
+ psh de ;pieces of original
+ ld bc,65 ;Peaworm code still
+ ldir ;left intact..
dec hl
ld b,63
MirrorSineWave:
;-----------------------------
-DisplayField:
- ld a,c
- sub 29
+DisplayField: ;all done by Jonah Cohen iirc. (-scrolling is scary-)
+ ld a,c ;not the fastest routine outthere, but it does get the job done.
+ sub 29 ;if something doesn't work, I probably _did_ alter it ;)
jr nc,NotMinYScroll
xor a
NotMinYScroll:
FP_Bit =$+1
set 0,a
- psh de ;&&&
+ psh de ;&&& C`MON! THIS IS UGLY! *hit myself*
ld de,ScrBuffer
add hl,de
pop de
; dec a ;4 = circle
; jp z,drawcircle
+;IMHO, one weery nice routine. Oh lemme be proud just *once*.
+;Not perfect since it uses a screwy lineroutine to draw stuff
+;but, just _look_ at it. Ain't it grand? Z80 at its best.
+;Nice comments, also. So here we go: Shiar's Circle Routine:
+;(using the Bresenham method)
+
drawcircle: ;(d,e),h ;de=x,y; h=z
ld c,h ;c=yy=z
ld a,h
ld b,c
ld c,a ;ex b,c
pop hl
- ret
+ ret ;thats it
drawbox: ;(d,e)-(h,l)
ld b,l ;Delta-y
dec h
; jp drawline
-;LINE (d,e)-(h,l)
-;destroyes a
+;A lot like Scabby's line routine in Wonderworm (dunno whether he wrote it
+;himself.) I did make a few optimizations and commented the thing.
+;A nice routine (also Bresenham), but for Wormy not perfect since really
+;large lines (>128 pixels in length or something) won't be flawless.
drawline: ;(d,e)-(h,l)
psh bc ;destr: a