home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Club Amiga de Montreal - CAM
/
CAM_CD_1.iso
/
files
/
349.lha
/
RevComp_v2.0
/
RevCompV2.0-Source
< prev
next >
Wrap
Text File
|
1990-03-06
|
44KB
|
2,555 lines
* --------------------
* - Rev 2.0 -
* - by -
* - Marc Fischlin -
* - in -
* - 11/89 -
* --------------------
incdir "vd0:include/"
include intuition/intuition.i
include intuition/intuition_lib.i
include exec/exec_lib.i
include graphics/graphics_lib.i
include libraries/dos.i
include libraries/dos_lib.i
include misc/easystart.i
jmp staaart
* TextMacro :
* -------------
PRINT MACRO
moveq.l #0,d5
moveq.l #0,d6
moveq.l #0,d0
lea \1,a4
notlenred_\@ move.b (a4)+,d5
tst.b d5
beq prilenred_\@
addq.b #1,d0
bra notlenred_\@
prilenred_\@ move.w d0,d6
move.l wptr,a1
move.l wd_RPort(a1),a1
move.w #1,d0
CALLGRAF SetAPen
move.w \2,d0
move.w \3,d1
move.l wptr,a1
move.l wd_RPort(a1),a1
CALLGRAF Move
move.l wptr,a1
move.l wd_RPort(a1),a1
move.w d6,d0
lea \1,a0
CALLGRAF Text
endm
* FillMacro :
* -------------------
FILL MACRO
move.l wptr,a1
move.l wd_RPort(a1),a1
move.w \3,d0
CALLGRAF SetAPen
move.w \1,d0
add #131,d0
move.w \2,d1
add #2,d1
move.w \1,d2
add #159,d2
move.w \2,d3
add #15,d3
move.l wptr,a1
move.l wd_RPort(a1),a1
CALLGRAF RectFill
endm
* BlueMacro :
* -------------
ASK MACRO
lea \1(pc),a0 ;ist der Platz noch frei ?
moveq.l \2,d0
move.b (a0,d0),d1
tst.b d1
beq \4
jmp \3
endm
* Change :
* ----------
CHANGE MACRO ;was wird um-
moveq.l #0,d5 ;gedreht ?
moveq.l #0,d3
moveq.l #0,d2
moveq.l #0,d6
move.b byte,d6
move.b offset,d5
lea tableII,a3
move.l 0(a3,d5),a5
move.b \4,0(a5,d6)
move d5,d3
move d6,d2
mulu #30,d2
add #2,d2
move.w d2,xfill
lsr #2,d3
mulu #15,d3
add #11,d3
move.w d3,yfill
FILL xfill,yfill,\5
cb_\@ sub \1,d5
sub \2,d6
cmp #0,d5
blt cds_\@
cmp #28,d5
bgt cds_\@
cmp #0,d6
blt cds_\@
cmp #7,d6
bgt cds_\@
lea tableII,a3
move.l 0(a3,d5),a5
move.b 0(a5,d6),d4
cmp.b \3,d4
beq reach_\@
jmp cds_\@
reach_\@ move.b \4,0(a5,d6)
move d5,d3
move d6,d2
mulu #30,d2
add #2,d2
move.w d2,xfill
lsr #2,d3
mulu #15,d3
add #11,d3
move.w d3,yfill
FILL xfill,yfill,\5
jmp cb_\@
cds_\@ nop
endm
* PossibleMacro :
* -----------------
POSSIBLE MACRO ;ist der zug möglich ?
moveq.l #0,d5
moveq.l #0,d6
move.b offset(pc),d5
move.b byte,d6
lea counter(pc),a3
move #0,(a3)
lea tableII(pc),a5
sub \1,d5
sub \2,d6
move.l (a5,d5),a4
move.b (a4,d6),d3
move.b fab1,d4
cmp.b d4,d3
beq voryep_\@
jmp pback_\@
voryep_\@ add.b #1,(a3)
yep_\@ sub \1,d5
tst.b d5
blt pback_\@
cmp.b #28,d5
bgt pback_\@
sub \2,d6
tst.b d6
blt pback_\@
cmp.b #7,d6
bgt pback_\@
move.l (a5,d5),a4
move.b (a4,d6),d3
move.b fab1,d4
cmp.b d4,d3
beq voryep_\@
move.b fab2,d4
cmp.b d4,d3
beq pok_\@
jmp pback_\@
pok_\@ move.b #1,\3
move.b endcounter,d2
move.b counter,d3
add.b d3,d2
move.b d2,endcounter
jmp preally_\@
pback_\@ move.b #0,\3
preally_\@ nop
endm
* HexerMacro :
* --------------
HEXER MACRO
lea \1,a5
move.b \2,d5
and.l #$ffff,d5
divs #10,d5
add.b #"0",d5
move.b d5,(a5)+
swap d5
and.l #$ffff,d5
add.b #"0",d5
move.b d5,(a5)+
PRINT \1,#81,\3
endm
* DrawLines :
* ---------------
Lines move.l #132,d5
move.l wptr,a1
move.l wd_RPort(a1),a1
move.l a1,a5
moveq.l #1,d0
CALLGRAF SetAPen ;weiße Linie
.xlines move.l a5,a1
move.l d5,d0
move.l #13,d1
CALLGRAF Move
move.l a5,a1
move.l d5,d0
move.l #132,d1
CALLGRAF Draw
add #30,d5
cmp #402,d5
beq .ylines
bra .xlines
.ylines move.l #12,d5
.yret move.l a5,a1
move.l d5,d1
move.l #132,d0
CALLGRAF Move
move.l a5,a1
move.l d5,d1
move.l #372,d0
CALLGRAF Draw
add #15,d5
cmp.b #147,d5
beq .rete
bra .yret
.rete rts
* Intuition oeffnen :
* ---------------------
staaart lea intname,a1
moveq #0,d0
CALLEXEC OpenLibrary
move.l d0,_IntuitionBase
* Graphics oeffnen :
* --------------------
lea grafname,a1
moveq #0,d0
CALLEXEC OpenLibrary
move.l d0,_GfxBase
* DOS oeffnen :
* ---------------
lea DOSname,a1
moveq #0,d0
CALLEXEC OpenLibrary
move.l d0,_DOSBase
* OpenMainWindow :
* ------------------
lea wdef,a0
CALLINT OpenWindow
move.l d0,wptr
FILL #92,#56,#3
FILL #122,#56,#2
FILL #92,#71,#2
FILL #122,#71,#3
PRINT msg1,#33,#90
PRINT msg4,#33,#104
PRINT msg11,#71,#56
PRINT msg15,#75,#68
jsr Lines
move.b #1,dots
move.b #3,levelbyte
move.b #0,moves
move.b #0,backs
vorevent move.b #0,upper
move.b #0,drupper
move.b #0,righter
move.b #0,drowner
move.b #0,downer
move.b #0,dlowner
move.b #0,lefter
move.b #0,dlupper
move.b #2,mode
move.b #0,ou
move.b #0,now
event2 moveq.l #0,d5
moveq.l #0,d4
move.b ou,d4
addq.b #1,d4
move.b d4,ou
move.b d4,d5
cmp.b #61,d5 ;ist schon alles voll ?
beq youpass
lea offset(pc),a3
lea byte(pc),a4
lea tableIV(pc),a0
lsl #2,d5
move.l (a0,d5),a0
jmp (a0)
eve4 move.b endcounter,d0
tst.b d0
beq.s event2 ;jetzt mit "."
move.b #1,now
cmp.b #0,dots
beq.s event2
jsr drawDot
bra event2
geht_OK move.b #0,endcounter
move.b #0,mode
bra event
youpass cmp.b #1,now
beq geht_OK
move.b passone,d0
cmp.b #1,d0
beq.s yopa2
jmp u3
yopa2 move.b #0,mode
move.b #0,endcounter
move.b you,d0
move.b cpu,d1
sub.b d0,d1
add.b #64,d1
cmp.b #64,d1
beq yep1
cmp.b #64,d1
bgt yep2
PRINT msg5,#22,#126
bra event
yep1 PRINT msg6,#6,#126
bra event
yep2 PRINT msg7,#18,#126
bra event
pe1 ASK one,#0,pe2,iwi1 ;was ist frei ?
pe2 ASK eight,#0,pe3,iwi8
pe3 ASK one,#7,pe4,iwi57b
pe4 ASK eight,#7,pl1,iwi64b
pl1 ASK one,#2,pl2,iwi17
pl2 ASK one,#3,pl3,iwi25
pl3 ASK one,#4,pl4,iwi33be
pl4 ASK one,#5,pl5,iwi41be
pl5 ASK two,#2,pl6,iwi18
pl6 ASK two,#3,pl7,iwi26
pl7 ASK two,#4,pl8,iwi34be
pl8 ASK two,#5,pl9,iwi42b
pl9 ASK three,#0,pl10,iwi3
pl10 ASK three,#1,pl11,iwi11
pl11 ASK three,#2,pl12,iwi19
pl12 ASK three,#3,pl13,iwi27
pl13 ASK three,#4,pl14,iwi35be
pl14 ASK three,#5,pl15,iwi43b
pl15 ASK three,#6,pl16,iwi51b
pl16 ASK three,#7,pl17,iwi59b
pl17 ASK four,#0,pl18,iwi4
pl18 ASK four,#1,pl19,iwi12
pl19 ASK four,#2,pl20,iwi20
pl20 ASK four,#5,pl21,iwi44b
pl21 ASK four,#6,pl22,iwi52b
pl22 ASK four,#7,pl23,iwi60b
pl23 ASK five,#0,pl24,iwi5
pl24 ASK five,#1,pl25,iwi13
pl25 ASK five,#2,pl26,iwi21
pl26 ASK five,#5,pl27,iwi45b
pl27 ASK five,#6,pl28,iwi53b
pl28 ASK five,#7,pl29,iwi61b
pl29 ASK six,#0,pl30,iwi6
pl30 ASK six,#1,pl31,iwi14
pl31 ASK six,#2,pl32,iwi22
pl32 ASK six,#3,pl33,iwi30
pl33 ASK six,#4,pl34,iwi38be
pl34 ASK six,#5,pl35,iwi46b
pl35 ASK six,#6,pl36,iwi54b
pl36 ASK six,#7,pl37,iwi62b
pl37 ASK seven,#2,pl38,iwi23
pl38 ASK seven,#3,pl39,iwi31
pl39 ASK seven,#4,pl40,iwi39be
pl40 ASK seven,#5,pl41,iwi47b
pl41 ASK eight,#2,pl42,iwi24
pl42 ASK eight,#3,pl43,iwi32
pl43 ASK eight,#4,pl44,iwi40be
pl44 ASK eight,#5,pl45,iwi48b
pl45 ASK one,#1,pl46,iwi9
pl46 ASK two,#0,pl47,iwi2
pl47 ASK two,#1,pl48,iwi10
pl48 ASK eight,#1,pl49,iwi16
pl49 ASK seven,#0,pl50,iwi7
pl50 ASK seven,#1,pl51,iwi15
pl51 ASK one,#6,pl52,iwi49b
pl52 ASK two,#7,pl53,iwi58b
pl53 ASK two,#6,pl54,iwi50b
pl54 ASK eight,#6,pl55,iwi56b
pl55 ASK seven,#7,pl56,iwi63b
pl56 ASK seven,#6,eve4,iwi55b
event move.b #0,upper
move.b #0,drupper
move.b #0,righter
move.b #0,drowner
move.b #0,downer
move.b #0,dlowner
move.b #0,lefter
move.b #0,dlupper
move.l wptr,a0
move.l wd_UserPort(a0),a0
move.l a0,a5
CALLEXEC WaitPort
move.l a5,a0
CALLEXEC GetMsg
move.l d0,a1
move.l im_Class(a1),d4
move.w im_Code(a1),d5
move.l im_IAddress(a1),a4
CALLEXEC ReplyMsg
cmp.l #CLOSEWINDOW,d4
beq dubblepseudo
move.w gg_GadgetID(a4),d0
sub #1,d0
tst.b d0
beq .welchesG
.ret lsl #2,d0
lea.l table,a0
move.l (a0,d0),a0
lea offset,a3
lea byte,a4
jmp (a0)
.welchesG move.l wptr,a0
moveq.l #0,d0
moveq.l #0,d1
move.w 12(a0),d1
move.w 14(a0),d0
sub #13,d1
sub #133,d0
divu #30,d0
and.l #$f,d0
lsl #3,d0
divu #15,d1
and.l #$f,d1
add.b d1,d0
bra .ret
* Your move :
* ------------
iw1 ASK one,#0,event,iwi1
iwi1 move.b #0,(a3) ;was willst du ziehen ?
move.b #0,(a4)
jsr poss
jmp zwischen
iw2 ASK two,#0,event,iwi2
iwi2 move.b #4,(a3)
move.b #0,(a4)
jsr poss
jmp zwischen
dubblepseudo jmp pseudoclosemain
iw3 ASK three,#0,event,iwi3
iwi3 move.b #8,(a3)
move.b #0,(a4)
jsr poss
jmp zwischen
iw4 ASK four,#0,event,iwi4
iwi4 move.b #12,(a3)
move.b #0,(a4)
jsr poss
jmp zwischen
iw5 ASK five,#0,event,iwi5
iwi5 move.b #16,(a3)
move.b #0,(a4)
jsr poss
jmp zwischen
pseudoevent jmp vorevent
iw6 ASK six,#0,event,iwi6
iwi6 move.b #20,(a3)
move.b #0,(a4)
jsr poss
jmp zwischen
iw7 ASK seven,#0,event,iwi7
iwi7 move.b #24,(a3)
move.b #0,(a4)
jsr poss
jmp zwischen
iw8 ASK eight,#0,event,iwi8
iwi8 move.b #28,(a3)
move.b #0,(a4)
jsr poss
jmp zwischen
iw9 ASK one,#1,event,iwi9
iwi9 move.b #0,(a3)
move.b #1,(a4)
jsr poss
jmp zwischen
backy1 jmp backy2
bts1 jmp bts2
ots1 jmp ots2
iw10 ASK two,#1,event,iwi10
iwi10 move.b #4,(a3)
move.b #1,(a4)
jsr poss
jmp zwischen
iw11 ASK three,#1,event,iwi11
iwi11 move.b #8,(a3)
move.b #1,(a4)
jsr poss
jmp zwischen
iw12 ASK four,#1,pseudoevent,iwi12
iwi12 move.b #12,(a3)
move.b #1,(a4)
jsr poss
jmp zwischen
iw13 ASK five,#1,pseudoevent,iwi13
iwi13 move.b #16,(a3)
move.b #1,(a4)
jsr poss
jmp zwischen
iw14 ASK six,#1,pseudoevent,iwi14
iwi14 move.b #20,(a3)
move.b #1,(a4)
jsr poss
jmp zwischen
iw15 ASK seven,#1,pseudoevent,iwi15
iwi15 move.b #24,(a3)
move.b #1,(a4)
jsr poss
jmp zwischen
iw16 ASK eight,#1,pseudoevent,iwi16
iwi16 move.b #28,(a3)
move.b #1,(a4)
jsr poss
jmp zwischen
iw17 ASK one,#2,pseudoevent,iwi17
iwi17 move.b #0,(a3)
move.b #2,(a4)
jsr poss
jmp zwischen
iw18 ASK two,#2,pseudoevent,iwi18
iwi18 move.b #4,(a3)
move.b #2,(a4)
jsr poss
jmp zwischen
iw19 ASK three,#2,pseudoevent,iwi19
iwi19 move.b #8,(a3)
move.b #2,(a4)
jsr poss
jmp zwischen
iw20 ASK four,#2,pseudoevent,iwi20
iwi20 move.b #12,(a3)
move.b #2,(a4)
jsr poss
jmp zwischen
iw21 ASK five,#2,pseudoevent,iwi21
iwi21 move.b #16,(a3)
move.b #2,(a4)
jsr poss
jmp zwischen
iwi33be jmp iwi33
iwi34be jmp iwi34
iwi35be jmp iwi35
iwi38be jmp iwi38
iwi39be jmp iwi39
iwi40be jmp iwi40
iw22 ASK six,#2,pseudoevent,iwi22
iwi22 move.b #20,(a3)
move.b #2,(a4)
jsr poss
jmp zwischen
iw23 ASK seven,#2,pseudoevent,iwi23
iwi23 move.b #24,(a3)
move.b #2,(a4)
jsr poss
jmp zwischen
u3 jmp u4
iwi41be jmp iwi41
iwi42b jmp iwi42
iwi43b jmp iwi43
iwi44b jmp iwi44
iwi45b jmp iwi45
iwi46b jmp iwi46
iwi47b jmp iwi47
iwi48b jmp iwi48
iwi49b jmp iwi49
iwi50b jmp iwi50
iw24 ASK eight,#2,pseudoevent,iwi24
iwi24 move.b #28,(a3)
move.b #2,(a4)
jsr poss
jmp zwischen
depsef jmp pseudoevent
iw25 ASK one,#3,depsef,iwi25
iwi25 move.b #0,(a3)
move.b #3,(a4)
jsr poss
jmp zwischen
iw26 ASK two,#3,depsef,iwi26
iwi26 move.b #4,(a3)
move.b #3,(a4)
jsr poss
jmp zwischen
iwi51b jmp iwi51
iwi52b jmp iwi52
iwi53b jmp iwi53
iwi54b jmp iwi54
iwi55b jmp iwi55
iwi56b jmp iwi56
iwi57b jmp iwi57
iwi58b jmp iwi58
iwi59b jmp iwi59
iwi60b jmp iwi60
iwi61b jmp iwi61
iwi62b jmp iwi62
iwi63b jmp iwi63
iwi64b jmp iwi64
iw27 ASK three,#3,depsef,iwi27
iwi27 move.b #8,(a3)
move.b #3,(a4)
jsr poss
jmp zwischen
iw28 ASK four,#3,depsef,depsef
jmp depsef
iw29 ASK five,#3,depsef,depsef
jmp depsef
pseudoclosemain jmp closemain
iw30 ASK six,#3,depsef,iwi30
iwi30 move.b #20,(a3)
move.b #3,(a4)
jsr poss
jmp zwischen
iw31 ASK seven,#3,depsef,iwi31
iwi31 move.b #24,(a3)
move.b #3,(a4)
jsr poss
jmp zwischen
iw32 ASK eight,#3,depsef,iwi32
iwi32 move.b #28,(a3)
move.b #3,(a4)
jsr poss
jmp zwischen
eve5 jmp eve4
iw33 ASK one,#4,depsef,iwi33
iwi33 move.b #0,(a3)
move.b #4,(a4)
jsr poss
jmp zwischen
iw34 ASK two,#4,depsef,iwi34
iwi34 move.b #4,(a3)
move.b #4,(a4)
jsr poss
jmp zwischen
iw35 ASK three,#4,depsef,iwi35
iwi35 move.b #8,(a3)
move.b #4,(a4)
jsr poss
jmp zwischen
iw36 ASK four,#4,depsef,depsef
jmp depsef
iw37 ASK five,#4,depsef,depsef
jmp depsef
iw38 ASK six,#4,depsef,iwi38
iwi38 move.b #20,(a3)
move.b #4,(a4)
jsr poss
jmp zwischen
iw39 ASK seven,#4,depsef,iwi39
iwi39 move.b #24,(a3)
move.b #4,(a4)
jsr poss
jmp zwischen
backy2 jmp backy3
bts2 jmp bts3
ots2 jmp ots3
iw40 ASK eight,#4,depsef,iwi40
iwi40 move.b #28,(a3)
move.b #4,(a4)
jsr poss
jmp zwischen
iw41 ASK one,#5,depsef,iwi41
iwi41 move.b #0,(a3)
move.b #5,(a4)
jsr poss
jmp zwischen
iw42 ASK two,#5,depsef,iwi42
iwi42 move.b #4,(a3)
move.b #5,(a4)
jsr poss
jmp zwischen
iw43 ASK three,#5,depsef,iwi43
iwi43 move.b #8,(a3)
move.b #5,(a4)
jsr poss
jmp zwischen
iw44 ASK four,#5,depsef,iwi44
iwi44 move.b #12,(a3)
move.b #5,(a4)
jsr poss
jmp zwischen
iw45 ASK five,#5,depsef,iwi45
iwi45 move.b #16,(a3)
move.b #5,(a4)
jsr poss
jmp zwischen
iw46 ASK six,#5,depsef,iwi46
iwi46 move.b #20,(a3)
move.b #5,(a4)
jsr poss
jmp zwischen
iw47 ASK seven,#5,depsef,iwi47
iwi47 move.b #24,(a3)
move.b #5,(a4)
jsr poss
jmp zwischen
iwi1b jmp iwi1
iwi2b jmp iwi2
iwi3b jmp iwi3
iwi4b jmp iwi4
iwi5b jmp iwi5
iwi6b jmp iwi6
iw48 ASK eight,#5,depsef,iwi48
iwi48 move.b #28,(a3)
move.b #5,(a4)
jsr poss
jmp zwischen
iw49 ASK one,#6,depsef,iwi49
iwi49 move.b #0,(a3)
move.b #6,(a4)
jsr poss
jmp zwischen
iw50 ASK two,#6,depsef,iwi50
iwi50 move.b #4,(a3)
move.b #6,(a4)
jsr poss
jmp zwischen
iwi7b jmp iwi7
iwi8b jmp iwi8
iwi9b jmp iwi9
iwi10b jmp iwi10
iwi11b jmp iwi11
iwi12b jmp iwi12
iw51 ASK three,#6,depsef,iwi51
iwi51 move.b #8,(a3)
move.b #6,(a4)
jsr poss
jmp zwischen
iw52 ASK four,#6,depsef,iwi52
iwi52 move.b #12,(a3)
move.b #6,(a4)
jsr poss
jmp zwischen
iwi13b jmp iwi13
iwi14b jmp iwi14
iwi15b jmp iwi15
iwi16b jmp iwi16
iwi17b jmp iwi17
iwi18b jmp iwi18
iwi19b jmp iwi19
iwi20b jmp iwi20
iw53 ASK five,#6,depsef,iwi53
iwi53 move.b #16,(a3)
move.b #6,(a4)
jsr poss
jmp zwischen
iw54 ASK six,#6,depsef,iwi54
iwi54 move.b #20,(a3)
move.b #6,(a4)
jsr poss
jmp zwischen
iwi21b jmp iwi21
iwi22b jmp iwi22
iwi23b jmp iwi23
iwi24b jmp iwi24
iwi25b jmp iwi25
iwi26b jmp iwi26
iwi27b jmp iwi27
iw55 ASK seven,#6,depsef,iwi55
iwi55 move.b #24,(a3)
move.b #6,(a4)
jsr poss
jmp zwischen
iwi30b jmp iwi30
iwi31b jmp iwi31
iwi32b jmp iwi32
iwi33b jmp iwi33
iwi34b jmp iwi34
iwi35b jmp iwi35
iwi38b jmp iwi38
iwi39b jmp iwi39
iwi40b jmp iwi40
iwi41b jmp iwi41
iw56 ASK eight,#6,depsef,iwi56
iwi56 move.b #28,(a3)
move.b #6,(a4)
jsr poss
jmp zwischen
iw57 ASK one,#7,depsef,iwi57
iwi57 move.b #0,(a3)
move.b #7,(a4)
jsr poss
jmp zwischen
u4 jmp u5
iw58 ASK two,#7,depsef,iwi58
iwi58 move.b #4,(a3)
move.b #7,(a4)
jsr poss
jmp zwischen
iw59 ASK three,#7,depsef,iwi59
iwi59 move.b #8,(a3)
move.b #7,(a4)
jsr poss
jmp zwischen
iw60 ASK four,#7,depsef,iwi60
iwi60 move.b #12,(a3)
move.b #7,(a4)
jsr poss
jmp zwischen
iw61 ASK five,#7,depsef,iwi61
iwi61 move.b #16,(a3)
move.b #7,(a4)
jsr poss
jmp zwischen
rucksack jmp depsef
iw62 ASK six,#7,depsef,iwi62
iwi62 move.b #20,(a3)
move.b #7,(a4)
jsr poss
jmp zwischen
iw63 ASK seven,#7,depsef,iwi63
iwi63 move.b #24,(a3)
move.b #7,(a4)
jsr poss
jmp zwischen
iw64 ASK eight,#7,depsef,iwi64
iwi64 move.b #28,(a3)
move.b #7,(a4)
jsr poss
zwischen move.b mode,d0
cmp.b #1,d0
beq movein
cmp.b #2,d0
beq eve5
move.b endcounter,d0
tst.b d0
beq rucksack
moveq.l #0,d0
move.b moves,d0
divu #10,d0
swap d0
and.l #$f,d0
lsl #2,d0
lea tableX(pc),a0
move.l (a0,d0),a0 ;in welchen move ?
move.l (a0)+,a5
lea one(pc),a4
jsr chab
move.l (a0)+,a5
lea two(pc),a4
jsr chab
move.l (a0)+,a5
lea three(pc),a4
jsr chab
move.l (a0)+,a5
lea four(pc),a4
jsr chab
move.l (a0)+,a5
lea five(pc),a4
jsr chab
move.l (a0)+,a5
lea six(pc),a4
jsr chab
move.l (a0)+,a5
lea seven(pc),a4
jsr chab
move.l (a0)+,a5
lea eight(pc),a4
jsr chab
move.b upper,d0
tst.b d0
beq n1
CHANGE #4,#0,#2,#1,#3
n1 move.b drupper,d0
tst.b d0
beq n2
CHANGE #4,#-1,#2,#1,#3
n2 move.b righter,d0
tst.b d0
beq n3
CHANGE #0,#-1,#2,#1,#3
n3 move.b drowner,d0
tst.b d0
beq n4
CHANGE #-4,#-1,#2,#1,#3
n4 move.b downer,d0
tst.b d0
beq n5
CHANGE #-4,#0,#2,#1,#3
n5 move.b dlowner,d0
tst.b d0
beq n6
CHANGE #-4,#1,#2,#1,#3
n6 move.b lefter,d0
tst.b d0
beq n7
CHANGE #0,#1,#2,#1,#3
n7 move.b dlupper,d0
tst.b d0
beq fxs
CHANGE #4,#1,#2,#1,#3
fxs move.b #1,mode
move.b moves,d0
addq.b #1,d0
move.b d0,moves
move.b backs,d0
cmp.b #10,d0
beq .label1
addq.b #1,d0
move.b d0,backs
.label1 jsr count
HEXER msg2,you,#90
HEXER msg3,cpu,#104
jsr clearDots
u5 move.b cpu,d0 ;der Computer zieht !
tst.b d0
beq r2 ;CPU verliert
move.b #0,TwentyEight
move.b #0,passone
move.b #0,hicounter
move.b #0,endcounter
move.b #1,mode
move.b #1,fab1
move.b #2,fab2 ;Farben zum Vergleichen !
u7 move.b #0,ou
uptohim move.b #0,upper
move.b #0,drupper
move.b #0,righter
move.b #0,dlupper
move.b #0,downer
move.b #0,dlowner
move.b #0,lefter
move.b #0,dlupper
moveq.l #0,d4
move.b ou,d4
addq.b #1,d4
move.b d4,ou
moveq.l #0,d5
move.b ou,d5
cmp.b #61,d5
beq executeit
u2 lea offset(pc),a3
lea byte(pc),a4
lea tableIII(pc),a0
moveq.l #0,d5
move.b ou,d5
lsl #2,d5
move.l (a0,d5),a0
jmp (a0)
e1 ASK one,#0,movein,iwi1b ;was ist frei ?
e2 ASK eight,#0,movein,iwi8b
e3 ASK one,#7,movein,iwi57 ;die Ecken vielleicht ?
e4 ASK eight,#7,movein,iwi64
l1 ASK one,#1,movein,iwi9b ;oder die Randfelder ?
l2 ASK one,#2,movein,iwi17b
l3 ASK one,#3,movein,iwi25b
l4 ASK one,#4,movein,iwi33b
l5 ASK one,#5,movein,iwi41b
l6 ASK one,#6,movein,iwi49b
l7 ASK eight,#1,movein,iwi16b
l8 ASK eight,#2,movein,iwi24b
l9 ASK eight,#3,movein,iwi32b
l10 ASK eight,#4,movein,iwi40b
l11 ASK eight,#5,movein,iwi48
l12 ASK eight,#6,movein,iwi56
l13 ASK two,#0,movein,iwi2b
l14 ASK three,#0,movein,iwi3b
l15 ASK four,#0,movein,iwi4b
l16 ASK five,#0,movein,iwi5b
l17 ASK six,#0,movein,iwi6b
l18 ASK seven,#0,movein,iwi7b
l19 ASK two,#7,movein,iwi58
l20 ASK three,#7,movein,iwi59
l21 ASK four,#7,movein,iwi60
l22 ASK five,#7,movein,iwi61
l23 ASK six,#7,movein,iwi62
l24 ASK seven,#7,movein,iwi63
l25 ASK three,#2,movein,iwi19b ;die Innenfelder (4x4) !?
l26 ASK three,#3,movein,iwi27b
l27 ASK three,#4,movein,iwi35b
l28 ASK three,#5,movein,iwi43
l29 ASK four,#2,movein,iwi20b
l30 ASK four,#5,movein,iwi44
l31 ASK five,#2,movein,iwi21b
l32 ASK five,#5,movein,iwi45
l33 ASK six,#2,movein,iwi22b
l34 ASK six,#3,movein,iwi30b
l35 ASK six,#4,movein,iwi38b
l36 ASK six,#5,movein,iwi46
l37 ASK two,#2,movein,iwi18b ;dann die übrigen Felder ?
l38 ASK two,#3,movein,iwi26b
l39 ASK two,#4,movein,iwi34b
l40 ASK two,#5,movein,iwi42
l41 ASK three,#1,movein,iwi11b
l42 ASK three,#6,movein,iwi51
l43 ASK four,#1,movein,iwi12b
l44 ASK four,#6,movein,iwi52
l45 ASK five,#1,movein,iwi13b
l46 ASK five,#6,movein,iwi53
l47 ASK six,#1,movein,iwi14b
l48 ASK six,#6,movein,iwi54
l49 ASK seven,#2,movein,iwi23b
l50 ASK seven,#3,movein,iwi31b
l51 ASK seven,#4,movein,iwi39b
l52 ASK seven,#5,movein,iwi47
l53 ASK seven,#1,movein,iwi15b ;nicht die Voreckfelder !
l54 ASK two,#1,movein,iwi10b
l55 ASK two,#6,movein,iwi50
l56 ASK seven,#6,movein,iwi55
movein cmp.b #3,levelbyte
bne .Max
cmp.b #29,ou
bne .Min
cmp.b #6,hicounter ;eins der Randfelder frei ?
bge executeit
.Min cmp.b #1,levelbyte
beq .Max
cmp.b #2,levelbyte
beq .Min2
cmp.b #41,ou
bne .Max
cmp.b #4,hicounter ;Innenfeld (4x4)
bge executeit
bra .Max
.Min2 cmp.b #41,ou ;bei Level 2
bge .Max
cmp.b #28,ou
bls .Max
cmp.b #0,endcounter
bne m67
.Max move.b endcounter,d0 ;Rückkehr
tst.b d0
beq uptohim
cmp.b #1,levelbyte
beq .skip1
cmp.b #4,ou ;is'ne Ecke frei ?
bls m67
.skip1 addq.b #3,d0 ;erhöht um 3 für better blanks
move.b d0,endcounter
move.b ou,d0
cmp.b #3,levelbyte
bne .skip2
cmp.b #16,d0
bls mTV1
cmp.b #28,d0
bls mTV2
.skip2 cmp.b #1,levelbyte
beq m7
cmp.b #57,d0 ;Voreckfelder
beq m8
cmp.b #58,d0
beq m8b
cmp.b #59,d0
beq m8c
cmp.b #60,d0
beq m8d
m7 move.b hicounter,d1
move.b endcounter,d0
cmp.b d1,d0
beq m40
cmp.b d1,d0
bge m2
m3 move.b #0,endcounter
jmp uptohim
m2 move.b endcounter,hicounter
move.b offset,highoff
move.b byte,highbyte
move.b upper,hiupper
move.b drupper,hidrupper
move.b righter,hirighter
move.b drowner,hidrowner
move.b downer,hidowner
move.b dlowner,hidlowner
move.b lefter,hilefter
move.b dlupper,hidlupper
bra m3
m40 move.b $dff007,d0 ;was soll DAS ???
btst #1,d0 ;Ah , Zufall !
beq m3
bra m2
m8 lea eight(pc),a6
move.b (a6),d0
m8all cmp.b #2,d0 ;Status der Ecke
beq m7
move.b #1,endcounter ;schon von Schwarz genommen
tst.b d0
beq m7 ;noch frei
move.b #2,endcounter
bra m7 ;schon von Orange genommen
m8d lea eight(pc),a6
move.b 7(a6),d0
bra m8all
m8c lea one(pc),a6
move.b 7(a6),d0
bra m8all
m8b lea one(pc),a6
move.b (a6),d0
bra m8all
m11 move.b hicounter,d0
tst.b d0
beq u2
move.b highbyte,d0
tst.b d0
beq m12
cmp.b #7,d0
beq m12
move.b hirighter,d0
tst.b d0
beq m13
bra m18
m13 moveq.l #0,d2
moveq.l #0,d3
move.b highoff,d2
lea tableII(pc),a4
move.l (a4,d2),a5
move.b highbyte,d3
addq.b #1,d3
move.b (a5,d3),d4
cmp.b #1,d4
beq.s m16
bra m18
m16 move.b #1,hicounter
jmp u2
m18 move.b hilefter,d0
tst.b d0
beq.s m19
bra executeit
m19 moveq.l #0,d2
moveq.l #0,d3
move.b highoff,d2
lea tableII(pc),a4
move.l (a4,d2),a5
move.b highbyte,d3
subq.b #1,d3
move.b (a5,d3),d4
cmp.b #1,d4
beq.s m22
bra executeit
m22 move.b #1,hicounter
jmp u2
m12 move.b hidowner,d0
tst.b d0
beq.s m23
bra m28
m23 moveq.l #0,d2
moveq.l #0,d3
move.b highoff,d2
addq.b #4,d2
lea tableII(pc),a4
move.l (a4,d2),a5
move.b highbyte,d3
move.b (a5,d3),d4
cmp.b #1,d4
beq.s m26
bra m28
m26 move.b #1,hicounter
jmp u2
m28 move.b hiupper,d0
tst.b d0
beq m29
bra executeit
m29 moveq.l #0,d2
moveq.l #0,d3
move.b highoff,d2
subq.b #4,d2
lea tableII(pc),a4
move.l (a4,d2),a5
move.b highbyte,d3
move.b (a5,d3),d4
cmp.b #1,d4
beq.s m32
bra executeit
m32 move.b #1,hicounter
jmp u2
m6 move.b #0,mode
jmp rucksack
mTV1 bra special_case
mTV1back moveq.l #0,d0 ;Randfelder checken
moveq.l #0,d5
move.b offset(pc),d0
lea tableII(pc),a2
move.l (a2,d0),a0
moveq.l #0,d1
move.b byte,d1
move.l d1,d6 ;retten
subq.b #1,d1
.label2q move.b (a0,d1),d2 ;nach links
moveq.b #1,d5
tst.b d2
beq to_the_right ;d5 = 1 - geht OK
moveq.b #0,d5 ;d5 = 0 - no way
cmp.b #2,d2
bne .label1q
subq.b #1,d1
cmp.b #-1,d1
beq m7
bra .label2q
.label1q cmp.b #0,lefter
bne .label3q
moveq.b #0,d5 ;Orange !!!
bra to_the_right
.label3q subq.b #1,d1 ;umdrehbar
move.b (a0,d1),d2
cmp.b #2,d2
bne .label3q
.label4q subq.b #1,d1 ;und danach ?
cmp.b #-1,d1
beq m67
move.b (a0,d1),d2
moveq.b #2,d5 ;d5 = 2 - umdrehbar
tst.b d2
beq to_the_right
moveq.b #0,d5
cmp.b #1,d2 ;wieder Orange ?
beq to_the_right ;dann NEIN !
bra .label4q
to_the_right
move.l d6,d1
addq.b #1,d1
.label2q move.b (a0,d1),d2 ;nach rechts
tst.b d2
beq .ask_for
cmp.b #2,d2
bne .label1q
addq.b #1,d1
cmp.b #8,d1
beq .ask_for
bra .label2q
.label1q cmp.b #0,righter
bne .label3q
.nein move.b #3,endcounter
.no1 moveq.l #0,d0
move.b byte,d0
cmp.b #1,d0
bne .no2
moveq.b #0,d0
.no_all move.b (a0,d0),d2
tst.b d2
bne .no3
cmp.b #2,d5
beq m67
move.b #1,endcounter
bra m7
.no3 cmp.b #2,d2
beq m7
move.b #2,endcounter
bra m7
.no2 cmp.b #6,byte
bne m7
moveq.b #7,d0
bra .no_all
.label3q addq.b #1,d1 ;umdrehbar
move.b (a0,d1),d2
cmp.b #2,d2
bne .label3q
.label4q addq.b #1,d1 ;und danach ?
cmp.b #8,d1
beq m67 ;dann hab ich die Ecke !
move.b (a0,d1),d2
tst.b d2
bne .label5q
tst.b d5
beq .ask_for
moveq.b #2,d5
bra .ask_for
.label5q cmp.b #1,d2 ;wieder Orange ?
beq .nein ;dann NEIN !
bra .label4q
.ask_for tst.b d5 ;d5 = 0 - nein
beq .nein
cmp.b #1,byte
beq .no1
cmp.b #6,byte
beq .no1
cmp.b #2,d5
beq m67
bra m7
special_case ;Ecke frei-orange-frei-orange-frei
lea one(pc),a0
cmp.b #0,offset
beq .sc1
lea eight(pc),a0
.sc1 move.b (a0),d2 ;Ecke frei ?
tst.b d2
bne .scR
move.b 1(a0),d2
cmp.b #1,d2 ;Voreckfeld orange ?
bne .scR
moveq.l #1,d0
.scLoop addq.b #1,d0
cmp.b #8,d0
beq .scR
move.b (a0,d0),d2
cmp.b #1,d2
beq .scLoop
tst.b d2 ;danach frei ?
bne .scR
move.b byte,d5
cmp.b d0,d5 ;is'es das Feld ?
bne .scR
addq.b #1,d0
cmp.b #8,d0
beq .scR
move.b (a0,d0),d2
cmp.b #1,d2 ;danach orange ?
bne .scR
.scLoop2 addq.b #1,d0
cmp.b #8,d0
beq m67 ;frei oder Ecke !
move.b (a0,d0),d2
tst.b d2
beq m67
cmp.b #1,d2
bne .scR
bra .scLoop2
.scR lea one(pc),a0 ;die rechte Ecke ?
cmp.b #0,offset
beq .sc3
lea eight(pc),a0
.sc3 move.b 7(a0),d2 ;Ecke frei ?
tst.b d2
bne .scNo
move.b 6(a0),d2
cmp.b #1,d2 ;Voreckfeld orange ?
bne .scNo
moveq.l #6,d0
.scLoop3 subq.b #1,d0
cmp.b #-1,d0
beq .scNo
move.b (a0,d0),d2
cmp.b #1,d2
beq .scLoop3
tst.b d2 ;danach frei ?
bne .scNo
move.b byte,d5
cmp.b d0,d5
bne .scNo
subq.b #1,d0
cmp.b #-1,d0
beq .scNo
move.b (a0,d0),d2
cmp.b #1,d2 ;danach orange ?
bne .scNo
.scLoop4 subq.b #1,d0
cmp.b #-1,d0
beq m67 ;frei oder Ecke !
move.b (a0,d0),d2
tst.b d2
beq m67
cmp.b #1,d2
bne .scNo
bra .scLoop4
.scNo bra mTV1back
mTV2 bra special_caseII
mTV2back moveq.l #0,d1 ;Randfelder checken
moveq.l #0,d5
move.b offset(pc),d1
lea tableII(pc),a2
moveq.l #0,d0
move.b byte,d0
move.l d1,d6 ;retten
subq.b #4,d1
.label2q move.l (a2,d1),a0
move.b (a0,d0),d2 ;nach oben
moveq.b #1,d5
tst.b d2
beq to_the_down ;d5 = 1 - geht OK
moveq.b #0,d5 ;d5 = 0 - no way
cmp.b #2,d2
bne .label1q
subq.b #4,d1
cmp.b #-4,d1
beq m7
bra .label2q
.label1q cmp.b #0,upper
bne .label3q
moveq.b #0,d5 ;Orange !!!
bra to_the_down
.label3q subq.b #4,d1
move.l (a2,d1),a0 ;umdrehbar
move.b (a0,d0),d2
cmp.b #2,d2
bne .label3q
.label4q subq.b #4,d1 ;und danach ?
cmp.b #-4,d1
beq m67
move.l (a2,d1),a0
move.b (a0,d0),d2
moveq.b #2,d5
tst.b d2
beq to_the_down
moveq.b #0,d5
cmp.b #1,d2 ;wieder Orange ?
beq to_the_down ;dann NEIN !
bra .label4q
to_the_down
move.l d6,d1
addq.b #4,d1
.label2q move.l (a2,d1),a0
move.b (a0,d0),d2 ;nach unten
tst.b d2
beq .ask_for
cmp.b #2,d2
bne .label1q
addq.b #4,d1
cmp.b #32,d1
beq .ask_for
bra .label2q
.label1q cmp.b #0,downer
bne .label3q
.nein move.b #3,endcounter
.no1 moveq.l #0,d1
move.b offset,d1
cmp.b #4,d1
bne .no2
moveq.b #0,d1
.no_all moveq.l #0,d0
move.b byte,d0
move.l (a2,d1),a0
move.b (a0,d0),d2
tst.b d2
bne .no3
cmp.b #2,d5
beq m67
move.b #1,endcounter
bra m7
.no3 cmp.b #2,d2
beq m7
move.b #2,endcounter
bra m7
.no2 cmp.b #24,d1
bne m7
move.b #28,d1
bra .no_all
.label3q addq.b #4,d1
move.l (a2,d1),a0 ;umdrehbar
move.b (a0,d0),d2
cmp.b #2,d2
bne .label3q
.label4q addq.b #4,d1 ;und danach ?
cmp.b #32,d1
beq m67 ;dann hab ich die Ecke !
move.l (a2,d1),a0
move.b (a0,d0),d2
tst.b d2
bne .label5q
tst.b d5
beq .ask_for
moveq.b #2,d5
bra .ask_for
.label5q cmp.b #1,d2 ;wieder Orange ?
beq .nein ;dann NEIN !
bra .label4q
.ask_for tst.b d5 ;d5 = 0 - nein
beq .nein
cmp.b #4,offset
beq .no1
cmp.b #24,offset
beq .no1
cmp.b #2,d5
beq m67
bra m7
special_caseII ;Ecke frei-orange-frei-orange-frei
moveq.l #0,d1
moveq.l #0,d3
moveq.l #0,d4
move.b byte,d1
lea tableII(pc),a2
.sc1 move.l (a2),a0
move.b (a0,d1),d2 ;Ecke frei ?
tst.b d2
bne .scR
move.l 4(a2),a0
move.b (a0,d1),d2
cmp.b #1,d2 ;Voreckfeld orange ?
bne .scR
moveq.l #4,d4
.scLoop addq.b #4,d4
cmp.b #32,d4
beq .scR
move.l (a2,d4),a0
move.b (a0,d1),d2
cmp.b #1,d2
beq .scLoop
tst.b d2 ;danach frei ?
bne .scR
move.b offset,d5
cmp.b d4,d5 ;is'es das Feld ?
bne .scR
addq.b #4,d4
cmp.b #32,d4
beq .scR
move.l (a2,d4),a0
move.b (a0,d1),d2
cmp.b #1,d2 ;danach orange ?
bne .scR
.scLoop2 addq.b #4,d4
cmp.b #32,d4
beq m67 ;frei oder Ecke !
move.l (a2,d4),a0
move.b (a0,d1),d2
tst.b d2
beq m67
cmp.b #1,d2
bne .scR
bra .scLoop2
.scR move.l 28(a2),a0
move.b (a0,d1),d2 ;Ecke frei ?
tst.b d2
bne .scNo
move.l 24(a2),a0
move.b (a0,d1),d2
cmp.b #1,d2 ;Voreckfeld orange ?
bne .scNo
moveq.l #24,d4
.scLoop3 subq.b #4,d4
cmp.b #-4,d4
beq .scNo
move.l (a2,d4),a0
move.b (a0,d1),d2
cmp.b #1,d2
beq .scLoop3
tst.b d2 ;danach frei ?
bne .scNo
move.b offset,d5
cmp.b d4,d5
bne .scNo
subq.b #4,d4
cmp.b #-4,d4
beq .scNo
move.l (a2,d4),a0
move.b (a0,d1),d2
cmp.b #1,d2 ;danach orange ?
bne .scNo
.scLoop4 subq.b #4,d4
cmp.b #-4,d4
beq m67 ;frei oder Ecke !
move.l (a2,d4),a0
move.b (a0,d1),d2
tst.b d2
beq m67
cmp.b #1,d2
bne .scNo
bra .scLoop4
.scNo bra mTV2back
m67 move.b endcounter,hicounter
move.b #0,endcounter
move.b offset,highoff
move.b byte,highbyte
move.b upper,hiupper
move.b drupper,hidrupper
move.b righter,hirighter
move.b drowner,hidrowner
move.b downer,hidowner
move.b dlowner,hidlowner
move.b lefter,hilefter
move.b dlupper,hidlupper
executeit move.b #0,endcounter
move.b hicounter,d0
tst.b d0
beq r3
jsr blink
move.b highoff,offset
move.b highbyte,byte
move.b hiupper,d0
tst.b d0
beq n1b
CHANGE #4,#0,#1,#2,#2
n1b move.b hidrupper,d0
tst.b d0
beq n2b
CHANGE #4,#-1,#1,#2,#2
n2b move.b hirighter,d0
tst.b d0
beq n3b
CHANGE #0,#-1,#1,#2,#2
n3b move.b hidrowner,d0
tst.b d0
beq n4b
CHANGE #-4,#-1,#1,#2,#2
n4b move.b hidowner,d0
tst.b d0
beq n5b
CHANGE #-4,#0,#1,#2,#2
n5b move.b hidlowner,d0
tst.b d0
beq n6b
CHANGE #-4,#1,#1,#2,#2
n6b move.b hilefter,d0
tst.b d0
beq n7b
CHANGE #0,#1,#1,#2,#2
n7b move.b hidlupper,d0
tst.b d0
beq fxsb
CHANGE #4,#1,#1,#2,#2
fxsb jsr count
HEXER msg2,you,#90
HEXER msg3,cpu,#104
bra r2
r3 move.b #1,passone
r2 move.b #2,fab1
move.b #1,fab2
move.b #0,mode
jmp rucksack
bts3 jsr clear
jsr Lines
move.b #0,moves
move.b #0,backs
jmp u5
ots3 jsr clear
jsr Lines
move.b #0,moves
move.b #0,backs
jmp rucksack
* ChangeOld :
* -------------
chab moveq.l #7,d5
ch2 move.b (a4)+,(a5)+
dbra d5,ch2
moveq.l #0,d5
rts
* Back :
* -------- ;wenn "Back" gedrückt wurde
backy3 cmp.b #0,backs
beq rucksack
move.b moves,d0
subq.b #1,d0
move.b d0,moves
move.b backs,d0
subq.b #1,d0
move.b d0,backs
moveq.l #0,d0
move.b moves,d0
divu #10,d0
swap d0
and.l #$f,d0
lsl #2,d0
lea tableX(pc),a0
move.l (a0,d0),a0 ;von welchen move ?
move.l (a0)+,a5
lea one(pc),a4
moveq.l #7,d4
bac1 move.b (a5)+,(a4)+
dbra d4,bac1
bac2 lea two(pc),a4
move.l (a0)+,a5
moveq.l #7,d4
bac3 move.b (a5)+,(a4)+
dbra d4,bac3
bac4 lea three(pc),a4
move.l (a0)+,a5
moveq.l #7,d4
bac5 move.b (a5)+,(a4)+
dbra d4,bac5
bac6 lea four(pc),a4
move.l (a0)+,a5
moveq.l #7,d4
bac7 move.b (a5)+,(a4)+
dbra d4,bac7
bac8 lea five(pc),a4
move.l (a0)+,a5
moveq.l #7,d4
bac9 move.b (a5)+,(a4)+
dbra d4,bac9
bac10 lea six(pc),a4
move.l (a0)+,a5
moveq.l #7,d4
bac11 move.b (a5)+,(a4)+
dbra d4,bac11
bac12 lea seven(pc),a4
move.l (a0)+,a5
moveq.l #7,d4
bac13 move.b (a5)+,(a4)+
dbra d4,bac13
bac14 lea eight(pc),a4
move.l (a0),a5
moveq.l #7,d4
bac15 move.b (a5)+,(a4)+
dbra d4,bac15
moveq.l #0,d4
bac16 move.l wptr,a1
move.l wd_RPort(a1),a1
moveq.l #0,d0
CALLGRAF SetAPen
move.l wptr,a1
move.l wd_RPort(a1),a1
moveq.l #0,d5
moveq.l #0,d6
btouch lea tableII(pc),a3
move.l (a3,d5),a3
moveq.l #7,d4
bwhich move.b (a3)+,d6
moveq.l #7,d3
sub d4,d3
mulu #30,d3
addq #2,d3
move.w d3,xfill
move.l d5,d3
lsr #2,d3
mulu #15,d3
add #11,d3
move.w d3,yfill
tst.b d6
beq bclrnext
cmp.b #2,d6
beq bacblac
bra bacora
brunter addq #4,d5
cmp #32,d5
beq brrret
bra btouch
bacora moveq.l #3,d3
bdraw FILL xfill,yfill,d3
bra bnext
bacblac moveq.l #2,d3
bra bdraw
bclrnext moveq.l #0,d3
bra bdraw
bnext dbra d4,bwhich
bra brunter
brrret jsr count
HEXER msg2,you,#90
HEXER msg2,cpu,#104
PRINT msg9,#6,#126
jmp rucksack
* Dots on/off :
* ---------------
dotty cmp.b #1,dots
bne dotty1
PRINT msg12,#75,#56
jsr clearDots
move.b #0,dots
jmp rucksack
dotty1 move.b #1,dots
PRINT msg11,#71,#56
move.b #0,endcounter
jmp vorevent
* Level-Wahl :
* --------------
level move.b levelbyte,d0
addq.b #1,d0
cmp.b #4,d0
bne l1zui
move.b #1,levelbyte
PRINT msg13,#75,#68
jmp rucksack
l1zui move.b d0,levelbyte
cmp.b #2,d0
bne l2zui
PRINT msg14,#75,#68
jmp rucksack
l2zui PRINT msg15,#75,#68
jmp rucksack
* Blinker :
* ----------- ;blink mal kurz (s/w)
blink moveq.l #0,d2
moveq.l #0,d3
move.b highbyte,d2
mulu #30,d2
addq #2,d2
move.w d2,xfill
moveq.l #0,d3
move.b highoff,d3
lsr #2,d3
mulu #15,d3
add #11,d3
move.w d3,yfill
moveq.l #4,d5
b4 subq.b #1,d5
tst.b d5
beq bret
FILL xfill,yfill,#1
moveq.l #6,d1
CALLDOS Delay
b2 FILL xfill,yfill,#2
moveq.l #6,d1
CALLDOS Delay
bra b4
bret rts
* Possnotmac :
* --------------
poss POSSIBLE #4,#0,upper ;möglich ?
POSSIBLE #4,#-1,drupper
POSSIBLE #0,#-1,righter
POSSIBLE #-4,#-1,drowner
POSSIBLE #-4,#0,downer
POSSIBLE #-4,#1,dlowner
POSSIBLE #0,#1,lefter
POSSIBLE #4,#1,dlupper
rts
* Counter :
* ----------- ;durchzählen
count moveq.l #0,d5
moveq.l #0,d6
move.b #0,you
move.b #0,cpu
lea you(pc),a5
lea cpu(pc),a4
touchdown lea tableII(pc),a3
move.l (a3,d5),a3
moveq.l #7,d2
which move.b (a3)+,d3
tst.b d3
beq next
cmp.b #2,d3
beq.s toblack
cmp.b #1,d3
beq.s toorange
toblack add.b #1,(a4)
bra next
toorange add.b #1,(a5)
next dbra d2,which
moveq.l #0,d2
runter addq #4,d5
cmp.b #32,d5
beq.s cret
bra touchdown
cret rts
* Clear :
* ---------
clear move.l wptr,a1
move.l wd_RPort(a1),a1
moveq.l #0,d0
CALLGRAF SetAPen
move.l wptr,a1
move.l wd_RPort(a1),a1
lea one(pc),a0
lea two(pc),a1
lea three(pc),a2
lea six(pc),a3
lea seven(pc),a4
lea eight(pc),a5
moveq.l #7,d0
cl2 move.b #0,(a0)+
move.b #0,(a1)+
move.b #0,(a2)+
move.b #0,(a3)+
move.b #0,(a4)+
move.b #0,(a5)+
dbra d0,cl2
cl6 lea cop1(pc),a0
lea cop2(pc),a1
lea cop3(pc),a2
lea cop6(pc),a3
lea cop7(pc),a4
lea cop8(pc),a5
moveq.l #7,d0
cl7 move.b #0,(a0)+
move.b #0,(a1)+
move.b #0,(a2)+
move.b #0,(a3)+
move.b #0,(a4)+
move.b #0,(a5)+
dbra d0,cl7
cl3 lea four(pc),a0
lea five(pc),a1
lea cop4(pc),a2
lea cop5(pc),a3
move.b #0,(a0)+
move.b #0,(a1)+
move.b #0,(a0)+
move.b #0,(a1)+
move.b #0,(a0)+
move.b #0,(a1)+
move.b #1,(a0)+
move.b #2,(a1)+
move.b #2,(a0)+
move.b #1,(a1)+
move.b #0,(a0)+
move.b #0,(a1)+
move.b #0,(a0)+
move.b #0,(a1)+
move.b #0,(a0)+
move.b #0,(a1)+
move.b #0,(a2)+
move.b #0,(a3)+
move.b #0,(a2)+
move.b #0,(a3)+
move.b #0,(a2)+
move.b #0,(a3)+
move.b #1,(a2)+
move.b #2,(a3)+
move.b #2,(a2)+
move.b #1,(a3)+
move.b #0,(a2)+
move.b #0,(a3)+
move.b #0,(a2)+
move.b #0,(a3)+
move.b #0,(a2)+
move.b #0,(a3)+
moveq.l #0,d5
.btouch lea tableII(pc),a3
move.l (a3,d5),a3
moveq.l #7,d4
.bwhich move.b (a3)+,d6
moveq.l #7,d3
sub d4,d3
mulu #30,d3
addq #2,d3
move.w d3,xfill
move.l d5,d3
lsr #2,d3
mulu #15,d3
add #11,d3
move.w d3,yfill
tst.b d6
beq .bclrnext
cmp.b #2,d6
beq .bacblac
bra .bacora
.brunter addq #4,d5
cmp #32,d5
beq .brrret
bra .btouch
.bacora moveq.l #3,d3
.bdraw FILL xfill,yfill,d3
bra .bnext
.bacblac moveq.l #2,d3
bra .bdraw
.bclrnext moveq.l #0,d3
bra .bdraw
.bnext dbra d4,.bwhich
jmp .brunter
.brrret move.b #2,you
move.b #2,cpu
PRINT msg1,#33,#90
PRINT msg4,#33,#104
PRINT msg9,#6,#126
rts
* Clear the dots :
* ------------------
clearDots cmp.b #0,dots
beq .ret
moveq.l #0,d5
moveq.l #0,d6
.btouch lea tableII(pc),a3
move.l (a3,d5),a3
moveq.l #7,d4
.bwhich move.b (a3)+,d6
moveq.l #7,d3
sub d4,d3
mulu #30,d3
addq #2,d3
move.w d3,xfill
move.l d5,d3
lsr #2,d3
mulu #15,d3
add #11,d3
move.w d3,yfill
tst.b d6
bne .next
FILL xfill,yfill,#0
.next dbra d4,.bwhich
.brunter addq.b #4,d5
cmp.b #32,d5
bne .btouch
moveq.l #0,d4
.ret rts
* finish activity :
* -------------------
closemain move.l wptr,a0
CALLINT CloseWindow
closeDOS move.l _DOSBase,a1
CALLEXEC CloseLibrary
closegraf move.l _GfxBase,a1
CALLEXEC CloseLibrary
closeint move.l _IntuitionBase,a1
CALLEXEC CloseLibrary
stop_it rts
W_gadgets equ WINDOWCLOSE!WINDOWDRAG!WINDOWDEPTH
W_extras equ SMART_REFRESH!ACTIVATE
W_Title dc.b " REVCOMP V2.0 by MARC FISCHLIN ",0
even
wdef dc.w 130,32
dc.w 380,136
dc.b 2,1
dc.l GADGETUP!CLOSEWINDOW
dc.l W_gadgets!W_extras
dc.l gadget1
dc.l 0
dc.l W_Title
dc.l 0,0
dc.w 50,50,400,200
dc.w WBENCHSCREEN
intname INTNAME
grafname GRAFNAME
DOSname DOSNAME
_IntuitionBase ds.l 1
_GfxBase ds.l 1
_DOSBase ds.l 1
wptr ds.l 1
counter dc.w 0
endcounter dc.w 0
xfill dc.w 0
yfill dc.w 0
ou dc.b 0
abx dc.b 0
TwentyEight dc.b 0
ab1 dc.b 0
test dc.b 0
highoff dc.b 0
highbyte dc.b 0
hicounter dc.b 0
ecke dc.b 0
hiupper dc.b 0
hidrupper dc.b 0
hirighter dc.b 0
hidrowner dc.b 0
hidowner dc.b 0
hidlowner dc.b 0
hilefter dc.b 0
hidlupper dc.b 0
passone dc.b 0
upper dc.b 0
drupper dc.b 0
righter dc.b 0
drowner dc.b 0
downer dc.b 0
dlowner dc.b 0
lefter dc.b 0
dlupper dc.b 0
you dc.b 0
cpu dc.b 0
offset dc.b 0
byte dc.b 0
mode dc.b 0
fab1 dc.b 2
fab2 dc.b 1
even
one dc.b 0,0,0,0,0,0,0,0
two dc.b 0,0,0,0,0,0,0,0
three dc.b 0,0,0,0,0,0,0,0
four dc.b 0,0,0,1,2,0,0,0
five dc.b 0,0,0,2,1,0,0,0
six dc.b 0,0,0,0,0,0,0,0
seven dc.b 0,0,0,0,0,0,0,0
eight dc.b 0,0,0,0,0,0,0,0
even
cop1 dc.b 0,0,0,0,0,0,0,0
cop2 dc.b 0,0,0,0,0,0,0,0
cop3 dc.b 0,0,0,0,0,0,0,0
cop4 dc.b 0,0,0,1,2,0,0,0
cop5 dc.b 0,0,0,2,1,0,0,0
cop6 dc.b 0,0,0,0,0,0,0,0
cop7 dc.b 0,0,0,0,0,0,0,0
cop8 dc.b 0,0,0,0,0,0,0,0
even
tableIV dc.l 0
dc.l pe1
dc.l pe2
dc.l pe3
dc.l pe4
dc.l pl1
dc.l pl2
dc.l pl3
dc.l pl4
dc.l pl5
dc.l pl6
dc.l pl7
dc.l pl8
dc.l pl9
dc.l pl10
dc.l pl11
dc.l pl12
dc.l pl13
dc.l pl14
dc.l pl15
dc.l pl16
dc.l pl17
dc.l pl18
dc.l pl19
dc.l pl20
dc.l pl21
dc.l pl22
dc.l pl23
dc.l pl24
dc.l pl25
dc.l pl26
dc.l pl27
dc.l pl28
dc.l pl29
dc.l pl30
dc.l pl31
dc.l pl32
dc.l pl33
dc.l pl34
dc.l pl35
dc.l pl36
dc.l pl37
dc.l pl38
dc.l pl39
dc.l pl40
dc.l pl41
dc.l pl42
dc.l pl43
dc.l pl44
dc.l pl45
dc.l pl46
dc.l pl47
dc.l pl48
dc.l pl49
dc.l pl50
dc.l pl51
dc.l pl52
dc.l pl53
dc.l pl54
dc.l pl55
dc.l pl56
tableIII dc.l 0
dc.l e1
dc.l e2
dc.l e3
dc.l e4
dc.l l1
dc.l l2
dc.l l3
dc.l l4
dc.l l5
dc.l l6
dc.l l7
dc.l l8
dc.l l9
dc.l l10
dc.l l11
dc.l l12
dc.l l13
dc.l l14
dc.l l15
dc.l l16
dc.l l17
dc.l l18
dc.l l19
dc.l l20
dc.l l21
dc.l l22
dc.l l23
dc.l l24
dc.l l25
dc.l l26
dc.l l27
dc.l l28
dc.l l29
dc.l l30
dc.l l31
dc.l l32
dc.l l33
dc.l l34
dc.l l35
dc.l l36
dc.l l37
dc.l l38
dc.l l39
dc.l l40
dc.l l41
dc.l l42
dc.l l43
dc.l l44
dc.l l45
dc.l l46
dc.l l47
dc.l l48
dc.l l49
dc.l l50
dc.l l51
dc.l l52
dc.l l53
dc.l l54
dc.l l55
dc.l l56
tableII dc.l one
dc.l two
dc.l three
dc.l four
dc.l five
dc.l six
dc.l seven
dc.l eight
table dc.l iw1
dc.l iw2
dc.l iw3
dc.l iw4
dc.l iw5
dc.l iw6
dc.l iw7
dc.l iw8
dc.l iw9
dc.l iw10
dc.l iw11
dc.l iw12
dc.l iw13
dc.l iw14
dc.l iw15
dc.l iw16
dc.l iw17
dc.l iw18
dc.l iw19
dc.l iw20
dc.l iw21
dc.l iw22
dc.l iw23
dc.l iw24
dc.l iw25
dc.l iw26
dc.l iw27
dc.l iw28
dc.l iw29
dc.l iw30
dc.l iw31
dc.l iw32
dc.l iw33
dc.l iw34
dc.l iw35
dc.l iw36
dc.l iw37
dc.l iw38
dc.l iw39
dc.l iw40
dc.l iw41
dc.l iw42
dc.l iw43
dc.l iw44
dc.l iw45
dc.l iw46
dc.l iw47
dc.l iw48
dc.l iw49
dc.l iw50
dc.l iw51
dc.l iw52
dc.l iw53
dc.l iw54
dc.l iw55
dc.l iw56
dc.l iw57
dc.l iw58
dc.l iw59
dc.l iw60
dc.l iw61
dc.l iw62
dc.l iw63
dc.l iw64
dc.l bts1
dc.l ots1
dc.l backy1
dc.l dotty
dc.l level
* Messages :
* ------------
msg1 dc.b "YOU : 02",0
msg4 dc.b "CPU : 02",0
msg2 dc.b " ",0
msg3 dc.b " ",0
msg5 dc.b "- You win -",0
msg6 dc.b "- Game's tied -",0
msg7 dc.b "- You lose -",0
msg9 dc.b " ",0
msg10 dc.b ".",0
msg11 dc.b " on ",0
msg12 dc.b "off",0
msg13 dc.b " 1 ",0
msg14 dc.b " 2 ",0
msg15 dc.b " 3 ",0
even
* Gadgets :
* -----------
border dc.w 0,0
dc.b 1,0,0,5
dc.l koord
dc.l 0
koord dc.w -1,-1
dc.w 29,-1
dc.w 29,14
dc.w -1,14
dc.w -1,-1
gadget1 dc.l bts
dc.w 133,13,240,120,GADGHNONE,RELVERIFY,1
dc.l 0,0,0,0,0
dc.w 1
dc.l 0
bts dc.l ots
dc.w 5,13,123,9
dc.w GADGHCOMP
dc.w RELVERIFY
dc.w 1
dc.l border2
dc.l 0
dc.l bts_text
dc.l 0,0
dc.w 65
dc.l 0
bts_text dc.b 1,0,0,0
dc.w 2,1
dc.l 0
dc.l bts_real
dc.l 0
bts_real dc.b " Black starts",0
even
border2 dc.w 0,0
dc.b 1,0,0,5
dc.l koords2
dc.l 0
koords2 dc.w -1,-1,123,-1,123,9,-1,9,-1,-1
ots dc.l backy
dc.w 5,25,123,9
dc.w GADGHCOMP
dc.w RELVERIFY
dc.w 1
dc.l border2
dc.l 0
dc.l ots_text
dc.l 0,0
dc.w 66
dc.l 0
ots_text dc.b 1,0,0,0
dc.w 2,1
dc.l 0
dc.l ots_real
dc.l 0
ots_real dc.b " Orange starts",0
backy dc.l doo
dc.w 5,37,123,9
dc.w GADGHCOMP
dc.w RELVERIFY
dc.w 1
dc.l border2
dc.l 0
dc.l backy_text
dc.l 0,0
dc.w 67
dc.l 0
backy_text dc.b 1,0,0,0
dc.w 6,1
dc.l 0
dc.l backy_real
dc.l 0
backy_real dc.b " Back ",0
even
doo dc.l lev
dc.w 5,49,123,9
dc.w GADGHCOMP
dc.w RELVERIFY
dc.w 1
dc.l border2
dc.l 0
dc.l doo_text
dc.l 0,0
dc.w 68
dc.l 0
doo_text dc.b 1,0,0,0
dc.w 4,1
dc.l 0
dc.l doo_real
dc.l 0
doo_real dc.b " Dots ",0
even
lev dc.l 0
dc.w 5,61,123,9
dc.w GADGHCOMP
dc.w RELVERIFY
dc.w 1
dc.l border2
dc.l 0
dc.l lev_text
dc.l 0,0
dc.w 69
dc.l 0
lev_text dc.b 1,0,0,0
dc.w 8,1
dc.l 0
dc.l lev_real
dc.l 0
lev_real dc.b " Level ",0
even
moves dc.b 0
backs dc.b 0
now dc.b 0
dots dc.b 1
levelbyte dc.b 3
even
lAa dc.b 0,0,0,0,0,0,0,0
lAb dc.b 0,0,0,0,0,0,0,0
lAc dc.b 0,0,0,0,0,0,0,0
lAd dc.b 0,0,0,0,0,0,0,0
lAe dc.b 0,0,0,0,0,0,0,0
lAf dc.b 0,0,0,0,0,0,0,0
lAg dc.b 0,0,0,0,0,0,0,0
lAh dc.b 0,0,0,0,0,0,0,0
lBa dc.b 0,0,0,0,0,0,0,0
lBb dc.b 0,0,0,0,0,0,0,0
lBc dc.b 0,0,0,0,0,0,0,0
lBd dc.b 0,0,0,0,0,0,0,0
lBe dc.b 0,0,0,0,0,0,0,0
lBf dc.b 0,0,0,0,0,0,0,0
lBg dc.b 0,0,0,0,0,0,0,0
lBh dc.b 0,0,0,0,0,0,0,0
lCa dc.b 0,0,0,0,0,0,0,0
lCb dc.b 0,0,0,0,0,0,0,0
lCc dc.b 0,0,0,0,0,0,0,0
lCd dc.b 0,0,0,0,0,0,0,0
lCe dc.b 0,0,0,0,0,0,0,0
lCf dc.b 0,0,0,0,0,0,0,0
lCg dc.b 0,0,0,0,0,0,0,0
lCh dc.b 0,0,0,0,0,0,0,0
lDa dc.b 0,0,0,0,0,0,0,0
lDb dc.b 0,0,0,0,0,0,0,0
lDc dc.b 0,0,0,0,0,0,0,0
lDd dc.b 0,0,0,0,0,0,0,0
lDe dc.b 0,0,0,0,0,0,0,0
lDf dc.b 0,0,0,0,0,0,0,0
lDg dc.b 0,0,0,0,0,0,0,0
lDh dc.b 0,0,0,0,0,0,0,0
lEa dc.b 0,0,0,0,0,0,0,0
lEb dc.b 0,0,0,0,0,0,0,0
lEc dc.b 0,0,0,0,0,0,0,0
lEd dc.b 0,0,0,0,0,0,0,0
lEe dc.b 0,0,0,0,0,0,0,0
lEf dc.b 0,0,0,0,0,0,0,0
lEg dc.b 0,0,0,0,0,0,0,0
lEh dc.b 0,0,0,0,0,0,0,0
lFa dc.b 0,0,0,0,0,0,0,0
lFb dc.b 0,0,0,0,0,0,0,0
lFc dc.b 0,0,0,0,0,0,0,0
lFd dc.b 0,0,0,0,0,0,0,0
lFe dc.b 0,0,0,0,0,0,0,0
lFf dc.b 0,0,0,0,0,0,0,0
lFg dc.b 0,0,0,0,0,0,0,0
lFh dc.b 0,0,0,0,0,0,0,0
lGa dc.b 0,0,0,0,0,0,0,0
lGb dc.b 0,0,0,0,0,0,0,0
lGc dc.b 0,0,0,0,0,0,0,0
lGd dc.b 0,0,0,0,0,0,0,0
lGe dc.b 0,0,0,0,0,0,0,0
lGf dc.b 0,0,0,0,0,0,0,0
lGg dc.b 0,0,0,0,0,0,0,0
lGh dc.b 0,0,0,0,0,0,0,0
lHa dc.b 0,0,0,0,0,0,0,0
lHb dc.b 0,0,0,0,0,0,0,0
lHc dc.b 0,0,0,0,0,0,0,0
lHd dc.b 0,0,0,0,0,0,0,0
lHe dc.b 0,0,0,0,0,0,0,0
lHf dc.b 0,0,0,0,0,0,0,0
lHg dc.b 0,0,0,0,0,0,0,0
lHh dc.b 0,0,0,0,0,0,0,0
lIa dc.b 0,0,0,0,0,0,0,0
lIb dc.b 0,0,0,0,0,0,0,0
lIc dc.b 0,0,0,0,0,0,0,0
lId dc.b 0,0,0,0,0,0,0,0
lIe dc.b 0,0,0,0,0,0,0,0
lIf dc.b 0,0,0,0,0,0,0,0
lIg dc.b 0,0,0,0,0,0,0,0
lIh dc.b 0,0,0,0,0,0,0,0
lJa dc.b 0,0,0,0,0,0,0,0
lJb dc.b 0,0,0,0,0,0,0,0
lJc dc.b 0,0,0,0,0,0,0,0
lJd dc.b 0,0,0,0,0,0,0,0
lJe dc.b 0,0,0,0,0,0,0,0
lJf dc.b 0,0,0,0,0,0,0,0
lJg dc.b 0,0,0,0,0,0,0,0
lJh dc.b 0,0,0,0,0,0,0,0
even
tableX dc.l tableXI,tableXII,tableXIII,tableXIV,tableXV,tableXVI,tableXVII,tableXVIII,tableXIX,tableXX
tableXI dc.l lAa,lAb,lAc,lAd,lAe,lAf,lAg,lAh
tableXII dc.l lBa,lBb,lBc,lBd,lBe,lBf,lBg,lBh
tableXIII dc.l lCa,lCb,lCc,lCd,lCe,lCf,lCg,lCh
tableXIV dc.l lDa,lDb,lDc,lDd,lDe,lDf,lDg,lDh
tableXV dc.l lEa,lEb,lEc,lEd,lEe,lEf,lEg,lEh
tableXVI dc.l lFa,lFb,lFc,lFd,lFe,lFf,lFg,lFh
tableXVII dc.l lGa,lGb,lGc,lGd,lGe,lGf,lGg,lGh
tableXVIII dc.l lHa,lHb,lHc,lHd,lHe,lHf,lHg,lHh
tableXIX dc.l lIa,lIb,lIc,lId,lIe,lIf,lIg,lIh
tableXX dc.l lJa,lJb,lJc,lJd,lJe,lJf,lJg,lJh
* Dot malen :
* -------------
drawDot move.l wptr,a1
move.l wd_RPort(a1),a1
move.l a1,a4
moveq #1,d0
CALLGRAF SetAPen
move.l a4,a1
moveq.l #0,d5
moveq.l #0,d4
move.b offset,d5
lsr #2,d5
move.b byte,d4
mulu #15,d5
mulu #30,d4
add #19,d5
add #146,d4
move.l d4,d0
move.l d5,d1
CALLGRAF WritePixel
move.l d4,d0
move.l d5,d1
addq.b #1,d0
move.l a4,a1
CALLGRAF WritePixel
move.l d4,d0
addq.b #1,d5
move.l d5,d1
move.l a4,a1
CALLGRAF WritePixel
move.l d4,d0
addq.b #1,d0
move.l d5,d1
move.l a4,a1
CALLGRAF WritePixel
move.b #0,endcounter
rts