commit 6dfe27ce596fe0890b2ec84d37586720ac6cf6bd Author: erysdren Date: Sat Oct 12 20:32:30 2024 -0500 Initial commit diff --git a/Documentazione/Grafica/ASCIA.LBM b/Documentazione/Grafica/ASCIA.LBM new file mode 100644 index 0000000..246f03b Binary files /dev/null and b/Documentazione/Grafica/ASCIA.LBM differ diff --git a/Documentazione/Grafica/BALLS.LBM b/Documentazione/Grafica/BALLS.LBM new file mode 100644 index 0000000..7cbd14c Binary files /dev/null and b/Documentazione/Grafica/BALLS.LBM differ diff --git a/Documentazione/Grafica/BCK_C0.LBM b/Documentazione/Grafica/BCK_C0.LBM new file mode 100644 index 0000000..d8cadd6 Binary files /dev/null and b/Documentazione/Grafica/BCK_C0.LBM differ diff --git a/Documentazione/Grafica/BCK_C1.LBM b/Documentazione/Grafica/BCK_C1.LBM new file mode 100644 index 0000000..5dfc18a Binary files /dev/null and b/Documentazione/Grafica/BCK_C1.LBM differ diff --git a/Documentazione/Grafica/BCK_C2.LBM b/Documentazione/Grafica/BCK_C2.LBM new file mode 100644 index 0000000..5dfc18a Binary files /dev/null and b/Documentazione/Grafica/BCK_C2.LBM differ diff --git a/Documentazione/Grafica/BCK_F0.LBM b/Documentazione/Grafica/BCK_F0.LBM new file mode 100644 index 0000000..acd20b5 Binary files /dev/null and b/Documentazione/Grafica/BCK_F0.LBM differ diff --git a/Documentazione/Grafica/BCK_F1.LBM b/Documentazione/Grafica/BCK_F1.LBM new file mode 100644 index 0000000..853af83 Binary files /dev/null and b/Documentazione/Grafica/BCK_F1.LBM differ diff --git a/Documentazione/Grafica/BCK_F2.LBM b/Documentazione/Grafica/BCK_F2.LBM new file mode 100644 index 0000000..683cb4d Binary files /dev/null and b/Documentazione/Grafica/BCK_F2.LBM differ diff --git a/Documentazione/Grafica/BUB1.LBM b/Documentazione/Grafica/BUB1.LBM new file mode 100644 index 0000000..11869a7 Binary files /dev/null and b/Documentazione/Grafica/BUB1.LBM differ diff --git a/Documentazione/Grafica/BUB2.LBM b/Documentazione/Grafica/BUB2.LBM new file mode 100644 index 0000000..7b2f7ce Binary files /dev/null and b/Documentazione/Grafica/BUB2.LBM differ diff --git a/Documentazione/Grafica/DRAGON1.LBM b/Documentazione/Grafica/DRAGON1.LBM new file mode 100644 index 0000000..82b16ed Binary files /dev/null and b/Documentazione/Grafica/DRAGON1.LBM differ diff --git a/Documentazione/Grafica/DRAGON2.LBM b/Documentazione/Grafica/DRAGON2.LBM new file mode 100644 index 0000000..f5f6b30 Binary files /dev/null and b/Documentazione/Grafica/DRAGON2.LBM differ diff --git a/Documentazione/Grafica/EDITOR.LBM b/Documentazione/Grafica/EDITOR.LBM new file mode 100644 index 0000000..750f7cd Binary files /dev/null and b/Documentazione/Grafica/EDITOR.LBM differ diff --git a/Documentazione/Grafica/FACE.LBM b/Documentazione/Grafica/FACE.LBM new file mode 100644 index 0000000..0a13d1b Binary files /dev/null and b/Documentazione/Grafica/FACE.LBM differ diff --git a/Documentazione/Grafica/FLOOR1.LBM b/Documentazione/Grafica/FLOOR1.LBM new file mode 100644 index 0000000..9718401 Binary files /dev/null and b/Documentazione/Grafica/FLOOR1.LBM differ diff --git a/Documentazione/Grafica/FLOOR2.LBM b/Documentazione/Grafica/FLOOR2.LBM new file mode 100644 index 0000000..4dcaf88 Binary files /dev/null and b/Documentazione/Grafica/FLOOR2.LBM differ diff --git a/Documentazione/Grafica/FLOOR3.LBM b/Documentazione/Grafica/FLOOR3.LBM new file mode 100644 index 0000000..7e1b88b Binary files /dev/null and b/Documentazione/Grafica/FLOOR3.LBM differ diff --git a/Documentazione/Grafica/FONT.LBM b/Documentazione/Grafica/FONT.LBM new file mode 100644 index 0000000..b11929a Binary files /dev/null and b/Documentazione/Grafica/FONT.LBM differ diff --git a/Documentazione/Grafica/FONT2.LBM b/Documentazione/Grafica/FONT2.LBM new file mode 100644 index 0000000..8447b65 Binary files /dev/null and b/Documentazione/Grafica/FONT2.LBM differ diff --git a/Documentazione/Grafica/FUCILE.LBM b/Documentazione/Grafica/FUCILE.LBM new file mode 100644 index 0000000..bd63a42 Binary files /dev/null and b/Documentazione/Grafica/FUCILE.LBM differ diff --git a/Documentazione/Grafica/MANO.LBM b/Documentazione/Grafica/MANO.LBM new file mode 100644 index 0000000..c89db04 Binary files /dev/null and b/Documentazione/Grafica/MANO.LBM differ diff --git a/Documentazione/Grafica/MISC.LBM b/Documentazione/Grafica/MISC.LBM new file mode 100644 index 0000000..d136ed0 Binary files /dev/null and b/Documentazione/Grafica/MISC.LBM differ diff --git a/Documentazione/Grafica/MITRA.LBM b/Documentazione/Grafica/MITRA.LBM new file mode 100644 index 0000000..0ad920f Binary files /dev/null and b/Documentazione/Grafica/MITRA.LBM differ diff --git a/Documentazione/Grafica/MORTI.LBM b/Documentazione/Grafica/MORTI.LBM new file mode 100644 index 0000000..d15e6c3 Binary files /dev/null and b/Documentazione/Grafica/MORTI.LBM differ diff --git a/Documentazione/Grafica/NEWFONT.LBM b/Documentazione/Grafica/NEWFONT.LBM new file mode 100644 index 0000000..69eb85a Binary files /dev/null and b/Documentazione/Grafica/NEWFONT.LBM differ diff --git a/Documentazione/Grafica/NICTEST.LBM b/Documentazione/Grafica/NICTEST.LBM new file mode 100644 index 0000000..8240a1e Binary files /dev/null and b/Documentazione/Grafica/NICTEST.LBM differ diff --git a/Documentazione/Grafica/OBJECTS.LBM b/Documentazione/Grafica/OBJECTS.LBM new file mode 100644 index 0000000..9822083 Binary files /dev/null and b/Documentazione/Grafica/OBJECTS.LBM differ diff --git a/Documentazione/Grafica/OBJECTS2.LBM b/Documentazione/Grafica/OBJECTS2.LBM new file mode 100644 index 0000000..461a2b3 Binary files /dev/null and b/Documentazione/Grafica/OBJECTS2.LBM differ diff --git a/Documentazione/Grafica/OTHER.LBM b/Documentazione/Grafica/OTHER.LBM new file mode 100644 index 0000000..4aaf3ee Binary files /dev/null and b/Documentazione/Grafica/OTHER.LBM differ diff --git a/Documentazione/Grafica/PLAYER1.LBM b/Documentazione/Grafica/PLAYER1.LBM new file mode 100644 index 0000000..a1d424a Binary files /dev/null and b/Documentazione/Grafica/PLAYER1.LBM differ diff --git a/Documentazione/Grafica/PLAYER2.LBM b/Documentazione/Grafica/PLAYER2.LBM new file mode 100644 index 0000000..aee1265 Binary files /dev/null and b/Documentazione/Grafica/PLAYER2.LBM differ diff --git a/Documentazione/Grafica/PRES.LBM b/Documentazione/Grafica/PRES.LBM new file mode 100644 index 0000000..04a50b8 Binary files /dev/null and b/Documentazione/Grafica/PRES.LBM differ diff --git a/Documentazione/Grafica/RAGNO.LBM b/Documentazione/Grafica/RAGNO.LBM new file mode 100644 index 0000000..bb2dd4d Binary files /dev/null and b/Documentazione/Grafica/RAGNO.LBM differ diff --git a/Documentazione/Grafica/SLIMER.LBM b/Documentazione/Grafica/SLIMER.LBM new file mode 100644 index 0000000..f79d6df Binary files /dev/null and b/Documentazione/Grafica/SLIMER.LBM differ diff --git a/Documentazione/Grafica/SOLD1.LBM b/Documentazione/Grafica/SOLD1.LBM new file mode 100644 index 0000000..54897ce Binary files /dev/null and b/Documentazione/Grafica/SOLD1.LBM differ diff --git a/Documentazione/Grafica/SOLD2.LBM b/Documentazione/Grafica/SOLD2.LBM new file mode 100644 index 0000000..7049a87 Binary files /dev/null and b/Documentazione/Grafica/SOLD2.LBM differ diff --git a/Documentazione/Grafica/WALLS1.LBM b/Documentazione/Grafica/WALLS1.LBM new file mode 100644 index 0000000..0c33b95 Binary files /dev/null and b/Documentazione/Grafica/WALLS1.LBM differ diff --git a/Documentazione/Grafica/WALLS2.LBM b/Documentazione/Grafica/WALLS2.LBM new file mode 100644 index 0000000..ffef5b3 Binary files /dev/null and b/Documentazione/Grafica/WALLS2.LBM differ diff --git a/Documentazione/Grafica/WALLS3.LBM b/Documentazione/Grafica/WALLS3.LBM new file mode 100644 index 0000000..ba9770e Binary files /dev/null and b/Documentazione/Grafica/WALLS3.LBM differ diff --git a/Documentazione/Grafica/WALLS4.LBM b/Documentazione/Grafica/WALLS4.LBM new file mode 100644 index 0000000..7539968 Binary files /dev/null and b/Documentazione/Grafica/WALLS4.LBM differ diff --git a/Documentazione/Suoni/ASCIAHIT.WAV b/Documentazione/Suoni/ASCIAHIT.WAV new file mode 100644 index 0000000..612e696 Binary files /dev/null and b/Documentazione/Suoni/ASCIAHIT.WAV differ diff --git a/Documentazione/Suoni/BBOUNCE.WAV b/Documentazione/Suoni/BBOUNCE.WAV new file mode 100644 index 0000000..cfc7d84 Binary files /dev/null and b/Documentazione/Suoni/BBOUNCE.WAV differ diff --git a/Documentazione/Suoni/BEAM.WAV b/Documentazione/Suoni/BEAM.WAV new file mode 100644 index 0000000..8abec77 Binary files /dev/null and b/Documentazione/Suoni/BEAM.WAV differ diff --git a/Documentazione/Suoni/BONUS.WAV b/Documentazione/Suoni/BONUS.WAV new file mode 100644 index 0000000..31dc310 Binary files /dev/null and b/Documentazione/Suoni/BONUS.WAV differ diff --git a/Documentazione/Suoni/BUB3.WAV b/Documentazione/Suoni/BUB3.WAV new file mode 100644 index 0000000..985661d Binary files /dev/null and b/Documentazione/Suoni/BUB3.WAV differ diff --git a/Documentazione/Suoni/CHARGE.WAV b/Documentazione/Suoni/CHARGE.WAV new file mode 100644 index 0000000..4ca9eb2 Binary files /dev/null and b/Documentazione/Suoni/CHARGE.WAV differ diff --git a/Documentazione/Suoni/CHARGE2.WAV b/Documentazione/Suoni/CHARGE2.WAV new file mode 100644 index 0000000..4ca9eb2 Binary files /dev/null and b/Documentazione/Suoni/CHARGE2.WAV differ diff --git a/Documentazione/Suoni/CLOCK.WAV b/Documentazione/Suoni/CLOCK.WAV new file mode 100644 index 0000000..766beb5 Binary files /dev/null and b/Documentazione/Suoni/CLOCK.WAV differ diff --git a/Documentazione/Suoni/CLOCK2.WAV b/Documentazione/Suoni/CLOCK2.WAV new file mode 100644 index 0000000..94a5ec0 Binary files /dev/null and b/Documentazione/Suoni/CLOCK2.WAV differ diff --git a/Documentazione/Suoni/CLOSE.WAV b/Documentazione/Suoni/CLOSE.WAV new file mode 100644 index 0000000..c237e5a Binary files /dev/null and b/Documentazione/Suoni/CLOSE.WAV differ diff --git a/Documentazione/Suoni/COLPO1.WAV b/Documentazione/Suoni/COLPO1.WAV new file mode 100644 index 0000000..4277843 Binary files /dev/null and b/Documentazione/Suoni/COLPO1.WAV differ diff --git a/Documentazione/Suoni/COLPO3.WAV b/Documentazione/Suoni/COLPO3.WAV new file mode 100644 index 0000000..d90c8c8 Binary files /dev/null and b/Documentazione/Suoni/COLPO3.WAV differ diff --git a/Documentazione/Suoni/ESPLOS.WAV b/Documentazione/Suoni/ESPLOS.WAV new file mode 100644 index 0000000..5ab3b75 Binary files /dev/null and b/Documentazione/Suoni/ESPLOS.WAV differ diff --git a/Documentazione/Suoni/FINELIV.WAV b/Documentazione/Suoni/FINELIV.WAV new file mode 100644 index 0000000..83a9bfa Binary files /dev/null and b/Documentazione/Suoni/FINELIV.WAV differ diff --git a/Documentazione/Suoni/FIRE.WAV b/Documentazione/Suoni/FIRE.WAV new file mode 100644 index 0000000..fc7bd1b Binary files /dev/null and b/Documentazione/Suoni/FIRE.WAV differ diff --git a/Documentazione/Suoni/FUCIL1.WAV b/Documentazione/Suoni/FUCIL1.WAV new file mode 100644 index 0000000..2454f47 Binary files /dev/null and b/Documentazione/Suoni/FUCIL1.WAV differ diff --git a/Documentazione/Suoni/FUCIL2.WAV b/Documentazione/Suoni/FUCIL2.WAV new file mode 100644 index 0000000..9d46d5c Binary files /dev/null and b/Documentazione/Suoni/FUCIL2.WAV differ diff --git a/Documentazione/Suoni/GLASS.WAV b/Documentazione/Suoni/GLASS.WAV new file mode 100644 index 0000000..9e291cf Binary files /dev/null and b/Documentazione/Suoni/GLASS.WAV differ diff --git a/Documentazione/Suoni/GOCCIA.WAV b/Documentazione/Suoni/GOCCIA.WAV new file mode 100644 index 0000000..01151f7 Binary files /dev/null and b/Documentazione/Suoni/GOCCIA.WAV differ diff --git a/Documentazione/Suoni/KEYS.WAV b/Documentazione/Suoni/KEYS.WAV new file mode 100644 index 0000000..6feaa19 Binary files /dev/null and b/Documentazione/Suoni/KEYS.WAV differ diff --git a/Documentazione/Suoni/MISSILE.WAV b/Documentazione/Suoni/MISSILE.WAV new file mode 100644 index 0000000..88862e8 Binary files /dev/null and b/Documentazione/Suoni/MISSILE.WAV differ diff --git a/Documentazione/Suoni/MISSILE2.WAV b/Documentazione/Suoni/MISSILE2.WAV new file mode 100644 index 0000000..2f2cb6c Binary files /dev/null and b/Documentazione/Suoni/MISSILE2.WAV differ diff --git a/Documentazione/Suoni/OSSA.WAV b/Documentazione/Suoni/OSSA.WAV new file mode 100644 index 0000000..57d23ad Binary files /dev/null and b/Documentazione/Suoni/OSSA.WAV differ diff --git a/Documentazione/Suoni/PASSO.WAV b/Documentazione/Suoni/PASSO.WAV new file mode 100644 index 0000000..dab847a Binary files /dev/null and b/Documentazione/Suoni/PASSO.WAV differ diff --git a/Documentazione/Suoni/PASSO2.WAV b/Documentazione/Suoni/PASSO2.WAV new file mode 100644 index 0000000..b96af33 Binary files /dev/null and b/Documentazione/Suoni/PASSO2.WAV differ diff --git a/Documentazione/Suoni/PIST1.WAV b/Documentazione/Suoni/PIST1.WAV new file mode 100644 index 0000000..e8492a2 Binary files /dev/null and b/Documentazione/Suoni/PIST1.WAV differ diff --git a/Documentazione/Suoni/PORTA1.WAV b/Documentazione/Suoni/PORTA1.WAV new file mode 100644 index 0000000..a8ac4d9 Binary files /dev/null and b/Documentazione/Suoni/PORTA1.WAV differ diff --git a/Documentazione/Suoni/PORTA2.WAV b/Documentazione/Suoni/PORTA2.WAV new file mode 100644 index 0000000..312aade Binary files /dev/null and b/Documentazione/Suoni/PORTA2.WAV differ diff --git a/Documentazione/Suoni/PROIETT.WAV b/Documentazione/Suoni/PROIETT.WAV new file mode 100644 index 0000000..980890a Binary files /dev/null and b/Documentazione/Suoni/PROIETT.WAV differ diff --git a/Documentazione/Suoni/RISATA.WAV b/Documentazione/Suoni/RISATA.WAV new file mode 100644 index 0000000..0d75fc9 Binary files /dev/null and b/Documentazione/Suoni/RISATA.WAV differ diff --git a/Documentazione/Suoni/SLIMATT.WAV b/Documentazione/Suoni/SLIMATT.WAV new file mode 100644 index 0000000..207692e Binary files /dev/null and b/Documentazione/Suoni/SLIMATT.WAV differ diff --git a/Documentazione/Suoni/SLIMDEAD.WAV b/Documentazione/Suoni/SLIMDEAD.WAV new file mode 100644 index 0000000..538ad98 Binary files /dev/null and b/Documentazione/Suoni/SLIMDEAD.WAV differ diff --git a/Documentazione/Suoni/SLIMDOWN.WAV b/Documentazione/Suoni/SLIMDOWN.WAV new file mode 100644 index 0000000..fc00ec3 Binary files /dev/null and b/Documentazione/Suoni/SLIMDOWN.WAV differ diff --git a/Documentazione/Suoni/SLIME01.WAV b/Documentazione/Suoni/SLIME01.WAV new file mode 100644 index 0000000..7894b6a Binary files /dev/null and b/Documentazione/Suoni/SLIME01.WAV differ diff --git a/Documentazione/Suoni/SLIME02.WAV b/Documentazione/Suoni/SLIME02.WAV new file mode 100644 index 0000000..002a513 Binary files /dev/null and b/Documentazione/Suoni/SLIME02.WAV differ diff --git a/Documentazione/Suoni/SLIMHIT.WAV b/Documentazione/Suoni/SLIMHIT.WAV new file mode 100644 index 0000000..172099b Binary files /dev/null and b/Documentazione/Suoni/SLIMHIT.WAV differ diff --git a/Documentazione/Suoni/SOLDATT.WAV b/Documentazione/Suoni/SOLDATT.WAV new file mode 100644 index 0000000..207692e Binary files /dev/null and b/Documentazione/Suoni/SOLDATT.WAV differ diff --git a/Documentazione/Suoni/SOLDDEAD.WAV b/Documentazione/Suoni/SOLDDEAD.WAV new file mode 100644 index 0000000..754860d Binary files /dev/null and b/Documentazione/Suoni/SOLDDEAD.WAV differ diff --git a/Documentazione/Suoni/SOLDDOWN.WAV b/Documentazione/Suoni/SOLDDOWN.WAV new file mode 100644 index 0000000..8046e64 Binary files /dev/null and b/Documentazione/Suoni/SOLDDOWN.WAV differ diff --git a/Documentazione/Suoni/SOLDHIT.WAV b/Documentazione/Suoni/SOLDHIT.WAV new file mode 100644 index 0000000..a23aa0a Binary files /dev/null and b/Documentazione/Suoni/SOLDHIT.WAV differ diff --git a/Documentazione/Suoni/SPIDATT.WAV b/Documentazione/Suoni/SPIDATT.WAV new file mode 100644 index 0000000..3f60b89 Binary files /dev/null and b/Documentazione/Suoni/SPIDATT.WAV differ diff --git a/Documentazione/Suoni/SPIDDEAD.WAV b/Documentazione/Suoni/SPIDDEAD.WAV new file mode 100644 index 0000000..5eef999 Binary files /dev/null and b/Documentazione/Suoni/SPIDDEAD.WAV differ diff --git a/Documentazione/Suoni/SPIDDOWN.WAV b/Documentazione/Suoni/SPIDDOWN.WAV new file mode 100644 index 0000000..fe068a7 Binary files /dev/null and b/Documentazione/Suoni/SPIDDOWN.WAV differ diff --git a/Documentazione/Suoni/SPIDHIT.WAV b/Documentazione/Suoni/SPIDHIT.WAV new file mode 100644 index 0000000..be51dfb Binary files /dev/null and b/Documentazione/Suoni/SPIDHIT.WAV differ diff --git a/Documentazione/Suoni/SPIDNEAR.WAV b/Documentazione/Suoni/SPIDNEAR.WAV new file mode 100644 index 0000000..bd4a49e Binary files /dev/null and b/Documentazione/Suoni/SPIDNEAR.WAV differ diff --git a/Documentazione/Suoni/THUNDER.WAV b/Documentazione/Suoni/THUNDER.WAV new file mode 100644 index 0000000..d22d12f Binary files /dev/null and b/Documentazione/Suoni/THUNDER.WAV differ diff --git a/Documentazione/Suoni/TOPO.WAV b/Documentazione/Suoni/TOPO.WAV new file mode 100644 index 0000000..8c88860 Binary files /dev/null and b/Documentazione/Suoni/TOPO.WAV differ diff --git a/Documentazione/Suoni/TUONO.WAV b/Documentazione/Suoni/TUONO.WAV new file mode 100644 index 0000000..ca0e281 Binary files /dev/null and b/Documentazione/Suoni/TUONO.WAV differ diff --git a/Documentazione/Suoni/UNLOCK.WAV b/Documentazione/Suoni/UNLOCK.WAV new file mode 100644 index 0000000..2a33140 Binary files /dev/null and b/Documentazione/Suoni/UNLOCK.WAV differ diff --git a/Documentazione/Suoni/VASO1.WAV b/Documentazione/Suoni/VASO1.WAV new file mode 100644 index 0000000..617e132 Binary files /dev/null and b/Documentazione/Suoni/VASO1.WAV differ diff --git a/Documentazione/Suoni/VASO2.WAV b/Documentazione/Suoni/VASO2.WAV new file mode 100644 index 0000000..e84afd5 Binary files /dev/null and b/Documentazione/Suoni/VASO2.WAV differ diff --git a/Documentazione/Suoni/VENOM.WAV b/Documentazione/Suoni/VENOM.WAV new file mode 100644 index 0000000..5ab3b75 Binary files /dev/null and b/Documentazione/Suoni/VENOM.WAV differ diff --git a/Documentazione/Suoni/WIND.WAV b/Documentazione/Suoni/WIND.WAV new file mode 100644 index 0000000..ea69c50 Binary files /dev/null and b/Documentazione/Suoni/WIND.WAV differ diff --git a/Documentazione/Suoni/WIND2.WAV b/Documentazione/Suoni/WIND2.WAV new file mode 100644 index 0000000..58b1ef7 Binary files /dev/null and b/Documentazione/Suoni/WIND2.WAV differ diff --git a/Documentazione/Testi/2nd stage/KAOS87.NIC b/Documentazione/Testi/2nd stage/KAOS87.NIC new file mode 100644 index 0000000..60038ca --- /dev/null +++ b/Documentazione/Testi/2nd stage/KAOS87.NIC @@ -0,0 +1,17 @@ + + +...attestato che ormai la LINEARITA' grafica Š indispensabile, questa + versione si chiama: + + + KAOS v0.87á + - -- --- --- Simultron --- --- -- - + (Rayer upgrade) + +- Nuovo algoritmo di correzione prospettica ESATTA per la visualizzazione + degli oggetti (il lato giusto, SEMPRE !); +- + + + + diff --git a/Documentazione/Testi/2nd stage/KAOS88I.NIC b/Documentazione/Testi/2nd stage/KAOS88I.NIC new file mode 100644 index 0000000..63f0eca --- /dev/null +++ b/Documentazione/Testi/2nd stage/KAOS88I.NIC @@ -0,0 +1,141 @@ +...le versioni 0.88á e 0.88ái sono andate perse... + +beh, poco male (mi dispiace per il dischetto) perchŠ c'era un BUGgone che +impediva il corretto funzionamento del 3D_SoundManager, e ora non c'Š pi—! +(il bug !) + +Ladies & gentlemen, + + + The KAOS 0.88á Simultron illusion 2 + (2nd revision of illusive version of Kaos) + +Come non avrai gi… letto, la parola "illusion" sta a significare che il gioco +contiene algoritmi ad ottimizzazione distruttiva, in grado di offrire grandi +incrementi di prestazioni mostrando per• "inaccettabili" approssimazioni +nei campi di visualizzazione e sonoro. +La parola "inaccettabile" significa che, vedendolo in un'ottica completamente +teorica, il programma (gioco) NON FUNZIONA; guardandolo invece dalla parte +del giocatore, il tutto risulta realistico, veloce e senza compromessi. + +Ora metter• alla prova questa mia teoria (del magheggio) lasciandoti come +scopo quello di "riuscire a" trovare le "fregature" (alcune praticamente +impossibili da scovare anche per me). + +Naturalmente se non ti accorgerai di nulla, rimarranno il quella definitiva. + +Cosa ci guadagno (ci ho guadagnato) ? + Con l'incremento di prestazioni ottenuto Š stato possibile gestire il + quadro di sfondo (lo so quelle nuvolette fanno schifo !), gestire le + sorgenti luminose con il suono del fuoco indipendentemente dalla loro + presenza nel range di visione, gestire in modo diverso il MemoryManager + in modo da permettere l'allocazione ottima nel caso peggiore (WOW!). + +NOTA: lo sfondo viene disegnato solo per met… in questa versione !!!!!!!! + Se tu fai un buco nel pavimento NON vedi la parte sotto !!!!!!!!!!! + Se vieni colpito in modo "duro" (>=10%) la visione si sposta in + alto e in basso (prev. in basso) MA LO SFONDO NON SHIFTA ! + Non Š che ci voglia tanto a far muovere lo sfondo in verticale, ma + righiede un algoritmo pi— complesso e pi— memoria per contenere + l'intero file d'immagine (che ora occupa un solo .LBM (backg.lbm), + e non credo ne valga pa pena, visto che il giocatore guarda per aria + solo quando viene colpito. +(EHI, non sono cosŤ stupido! QUESTO NON RIENTRA NEI MAGHEGGI SALVA-CPU !!!) + +* per quanto riguarda i flash troppo forti, per ora non mi interessano ma + ricordami in futuro di cambiarli; +* vedi se sono riuscito a mettere le figure fronte/retro (eh sŤ perchŠ questo + file lo scrivo anche prima...) +* nella modalit… ADNICO (che in futuro verr… REGOLARIZZATA) sto facendo + diverse prove, quindi non ti preoccupare se "esco dal seminato" ! + +I Suoni: +- bisogna cambiare il suoni del vento; credo che il problema stia nel fatto + che NON Š possibile ottenere un suono realistico (quando si ripete !) se + il file sonoro Š troppo corto, infatti per fare "FIRE.WAV" ci ho sbattuto + la testa; + (puoi fare questi suoni un p• pi— lunghi, ma occhio !) +- i suoni delle porte vanno benissimo; +- ...anche i vasi; +- per i volumi ci metteremo d'accordo; +- ho ritardato il rimbalzo dei proiettili, e poi... bla,bla,bla, comunque + bisognerebbe rifare il suono un p• pi— simile a quello di Quake; +- non ho ancora messo quello delle ossa; + +Il braciere (Brazier) Š bello, ma bisognerebbe abbassare LA PARTE DIETRO +(solo!) della figura di quando Š spento. + +* ALTRO * +- se le porte ancora non funzionano tutte, non ti preoccupare, funzioneranno; +- usa con discrezione i muri diagonali (non fare corridoi stretti...) ed + EVITA di fare come ho fatto io nel livello (di test) che ho creato (ora + il livello ha estensione .DLF e per ora NON sar… compatibile con la + versione finale che conterr… tutti i mostri); +- segnati tutti gli errori che trovi (potrebbero essere le esche della + versione "illusion"); + + +NOTA SU QUAKE !!!!!!!!! Quake ? + +Ho trovato come entrare nella modalit… Nightmare !!! +(c'Š una porticina sotto alla vasca dell'acqua nell'altro episodio (che io +non ho, quindi non serve)), Š la vasca dove si sbuca da sotto e si cade, +ma puoi usare NOCLIP. + + + +------------ the day after ------------------- +Novit… del giorno dopo: + +Ho fatto in modo di lasciare degli spazi liberi nella gestione dei +livelli dell'editor. In questo modo i livelli .DLF generati NON SARANNO +compatibili con quelli del disco andato perduto (Copyright almeno sulla +modifica del livello...), ma potrebbero essere quelli definitivi (nel +senso che avranno lo stesso formato di quelli finali non shareware). + +Ho aggiustato le porte (almeno cosŤ credo), tenendo presente il fatto che per +realizzare una porta vera e propria (cioŠ speculare da ambo i lati e con +i doorslots laterali) Š necessario utilizzare la forma a croce (sull'editor), +mentre per i passaggi segreti (o porte senza maniglia) si possono usare tutte +le altre forme (che appaiono sempre nello stesso verso). + +Ci sono 16 suoni contemporaneamente (ormai ho dciso, sono necessari tutti). + +The Kaos Editor v0.1á: +Come avrai gi… notato ho fatto in modo da creare pulsanti di diverse forme +(...diciamo "misure"); + +Ci sono 16 (e dico 16 1111111111166666666666666!!!!!!!!!!!!) TABELLE (cioŠ +livelli) diverse. Le prime 12 sono quelle usate prevalentemente per il gioco +e le altre QUATTRO (4444444444!!!!!!!!!!!) sono per gli incontri a 2/3. + +Ogni TABELLA si divide in 3 LIVELLI: Soffitto, Muri, Pavimento; +Per i soffitti e pavimenti la cosa Š facile: + si possono solo inserire TEXTURE PIENE (e anche oggetti, ma questa Š un'al- + tra cosa...) e vedere in corrispondenza (sulla stessa mappa) anche la + mappa dei Muri. +La mappa dei Muri contiene tutti i tipi di muri, porte, oggetti, mostri, ecc. +Per ogni muro Š possibile scegliere: +- TEXTURE: figura ad esso associata; +- FORMA: quadrata, verticale, orizzontale, diagonale1, diagonale2, + centrale (per porte) +- TIPO: texture piena (normale), porta 1 (ad apertura laterale), porta 2 + (ad apertura centrale), grata 4-8 (4 pixel pieni, 8 vuoti in + sequenza). + Non Š consigliato usare grate diagonali (funzionano solo in + determinate posizioni (per ora, e forse per sempre)) +Queste 3 caratteristiche sono selezionabili in modo completamente +indipentente, ma c'Š da notare che NON Š possibile, in questo modo, ottenere +delle porte/grate (cancelli); Š comunque possibili aggiungere 1 "forma" nuova +e 3 "tipi" nuovi al 3D-îngine; +Per ora non c'Š nessuna informazione riguardante la selezione effettuata, ma +in futuro potrebbe essere possibile far abbassare i pulsanti di selezione in +modo da far capire quali scelte sono state fatte per la selezione corrente. + +PER QUESTIONI DI SICUREZZA ho messo una protezione al gioco in modo che +si rifiuti di partire SE IL LIVELLO CONTIENE almeno un BUBbone !!!!!!!!!!!!! +(se vuoi la versione completa posso toglierla) + + + + -=đNicođ=- diff --git a/Documentazione/Testi/2nd stage/KAOS89.NIC b/Documentazione/Testi/2nd stage/KAOS89.NIC new file mode 100644 index 0000000..e08c002 --- /dev/null +++ b/Documentazione/Testi/2nd stage/KAOS89.NIC @@ -0,0 +1,137 @@ + + Kaos v0.89á + ------------====đ DarkHacker đ====------------- + + +La versione DarkHacker ha il Nuovissimo MemoryManager v3.0: +- Ottimizzato ! Pi— veloce (istantaneo), pi— preciso e pi— funzionale; +- Gestisce 3 tipi di memorie: Convenzionale, XMS, Disco, ed Š comunque + progettato in modo da ospitare anche un futuribile PageManager che + permetterebbe di gestire la memoria EMS (e gli UMB); + +La memoria Disco Š a sola lettura, praticamente Š il Mega File .BDF +(Block Data File) che contiene la totalit… dei dati dinamici del gioco. +La velocit… di inizializzazione si porta a pochi secondi (0.5 nel mio +caso, ma ho 1Mb di Smartdrv) e permette di scaricare l'intera area dati +utili (circa 1Mb) senza compressione (almeno per ora, ma non Š escluso che +si possa utilizzare un mio personale algoritmo di compressione creato +su misura per i dati di tipo grafico (e non peggiora le cose nel caso dei +file sonori (poco comprimibili))). +La versione 3.0 non Š poi tutta questa meraviglia, perchŠ la gestione dello +swapping su disco Š fatta in modo "client", nel senso che non c'Š una vera +e propria strategia di gestione, ma si basa sulla semplice richiesta +momentanea di dati. Per questo, ma anche per questioni di lentezza, +l'utilizzo del disco viene fatto solo in caso di completa allocazione delle +altre risorse. Questa modalit… di gestione NON significa che se un dato non +Š presente in memoria vene caricato ripetutamente da disco, ma solo che Š +possibile che dati veramente unutili siano conservati in XMS mentre invece +i dati utilizzati di rado stiano su disco ! + +Ma allora come fa Wolf3D ? +Anche Wolf3D ha i suoi problemi, e li risolve in modo diverso: +- per ogni blocco di memoria mantiene informazioni riguardanti il numero di + volte che il blocco Š utilizzato e, in base a questo numero, decide quale + togliere; +Non ho usato questo metodo perchŠ richiede + memoria, + tempo per decidere +qual'Š il blocco da eliminare ed ha un problema: se un blocco viene preso +per essere usato in modo alternato con altri (come pu• essere un'animazione) +il risultato Š quello di swappare sempre e solo questi blocchi perchŠ sono +usati poco (nel senso "per poco tempo") e ci• provoca un ulteriore +rallentamento, senza contare che quando cambi stanza le texture possono +anche cambiare completamente e perci• si deve attendere che le nuove +siano usate tanto quanto quelle vecchie oppure scegliere un time-slice che +sia piccolo, ma a questo punto non servirebbe a niente procedere con... +BASTAAAA! (...insomma Š una soluzione del cazzo!) + +Ma come fa DOOM ? +Seeeeeee ! M• voi pure sapŠ come fa DOOM !! + SŤ! +Beh, DOOM USA LA MODALITA' PROTETTA e tutti i suoi 32 bit e non ha problemi +di swapping in memoria, perci• si preoccupa solo di averne di disponibile, +altrimenti si carica i dati dal disco... insomma si pone pochi problemi. + + +Come VEDERE lo swapping (in memoria o su disco). +E' statisticamente provato che per emettere i suoni dei tuoni, o per +caricare l'immagine dello sfondo (solo quando questo Š visibile !) il +MemoryManager viene impegnato in una operazione ripetuta di swapping di +blocchi. Se la memoria Š in condizioni non favorevoli, questa fase +pu• provocare la perdita di 1 frame (ma si nota ugualmente, specialmente sui +Pentium). + +Ho aggiunto un controllo globale di memoria libera in modo da impedire la +partenza del gioco in condizioni di "grave mancanza di memoria". + +DATI (NOTA MOLTO BENE !): +Il gioco pu• girare anche con soli 80Kb di memoria base libera !!!!!!!!!!!! +80Kb di memoria base corrispondono a meno di 400Kb di memoria convenzionale, +ma pu• cambiare al variare della grandezza dell'eseguibile. +Logicamente pi— bassa Š la memoria e pi— lento sar… il gioco ! +A partire da circa 240Kb di memoria base gli swapping diventano pi— rari e +il gioco rallenta solo a tratti (quando deve preparare suoni lunghi); +da qui, aumentando la memoria, i rallentamenti caleranno in modo +esponenziale. +Se non si configura il computer per dare abbastanza memoria XMS (circa 2Mb +utile, ma ne vengono allocati anche 4), se necessario, entrer… in ballo la +memoria disco (non poi cosŤ lenta), perci• il gioco, IN MODALITA' "DATAFILE", +pu• anche girare in soli 400Kb di memoria convenzionale !!!!!!!!!!!!!!!!!!! +I dati sono stati raccolti con Windows95, quindi non so se sono attendibili. + +Condizioni critiche: +In condizioni di "very low memory", Š possibile che alcune funzioni vengano +automaticamente annullate se non si riesce a preparare i dati. +Ecco una list delle principali funzioni che richiedono molte risorse, messe +in ordine di "disattivabilit…": +1) sfondo; +2) suoni; +3) numeri per il punteggio; +4) textures di gioco (impossibile che vengano disattivate); + +E' molto probabile che si verifichino casi in cui la presenza momentanea di +un suoni (lunghi) provochi la disattivazione (altrettanto MOMENTANEA) dello +sfondo. In condizioni di memoria "gravemente bassa" lo sfondo non viene +disegnato praticamente mai (sfondo nero). + +------------------------------------------------------------------------ +Lasts +------------------------------------------------------------------------ + +* Ho aggiunto le 30 textures; +* Ho messo i pavimenti trasparenti + (NON POTEVO RINUNCIARCI, AVEVO GIA' FATTO LA ROUTINE !) + L'unico problema Š che, per ragioni di velocit…, Š necessario piazzare + le texture trasparenti nelle ultime 3 posizioni (vedi Walls5) o, se la + cosa ti interessa, nelle ultime 8 posizioni (8 textures !) + NON si contano le VERE ultime 2 textures (DOOR SLOT & SWITCH UP); + + Data la particolare struttura dell'algoritmo, la presenza di troppe + textures trasparenti nello stesso quadro NON necessariamente RALLENTA + il gioco e, se gli spazi vuoti solo >50% dell'intera texture allora si + ha addirittura un AUMENTO DI PRESTAZIONI (ma bisogna calcolare che, a + questo punto, deve essere disegnato anche lo sfondo) ! +* Ho aumentato la capienza della DrawList (max 128 oggetti); +* Ho abbozzato un'intelligenza (di test) allo SLIMER + (ha un range di visione di 150ř, e spara dei missiloni se vede un player + o un altro slimer) + + PROVA AD USARE IL LIVELLO DI PROVA CHE TI HO FATTO... + ...quando entri nello stanzone con gli Slimers cominci a strippare ! + + Ora lo Slimer ha un oggetto tutto suo. + (in futuro lo avranno tutti...) + +* Ho aggiunto il NULL-block anche per i muri (come Quake); +* Ho fatto di tutto per farmi venire l'errore del loadsound() ma non mi Š + mai apparso ! + +---------------------- +Ultime di Mezzanotte (e non scherzo !) +---------------------- +Ho attappato qualche problema dell'editor, ma credo che ce ne siano altri... + +Ho rallentato i missili... + +...ecc. non mi ricordo pi—, c'ho sonno + + + -=đNicođ=- diff --git a/Documentazione/Testi/2nd stage/KAOSL83.BAK b/Documentazione/Testi/2nd stage/KAOSL83.BAK new file mode 100644 index 0000000..55073c1 --- /dev/null +++ b/Documentazione/Testi/2nd stage/KAOSL83.BAK @@ -0,0 +1,323 @@ + + + + + ++ ++++ ++ + + + + ++ ++++++++ ++ + ++++ __-++++++++++ ++++ + + + + +++++ _---+++++++++++ +++++ + + + ++ ++++ +++++++++++++ ++++ ++ + + + ++++ ++++++ +++++++++++++++++ ++++++ ++++ + + + ++++++++++++++++++++++++++++++++++++++++++ + + + ++++++++++++++++++++++++++++++++++ + + + + ++++ ++++++++++++++++++++++++++ ++++ + + + + ++++++++++++++++++++++++++++++++++ + + + Źndromeda Soźt KAOS v0.83á Golden Hawk + + Technical Informations and Error Reports + (another story-file) + +Dalla versione L0.8 KAOS dispone delle seguenti novit…: +- Gestione lineare della grafica (persi 64K di RAM); +- Gestione completa della mappa di gioco con forme multiple; +- Pavimenti e soffitti in texture quadrate e gestione luce, con 5 livelli + di ottimizzazione (ma per me Š ancora lento); +- Fantastico (Š dir poco!) algoritmo di gestione degli oggetti con mappa + separata ed estese capacit… di sovrapposizione (dynamically linked list + with automatic collision updating (C)1997 Valentini Domenico); +- Eccezionale flessibilit… e resistenza alle modifiche (l'ho fatto io !); +- ... + +Dalla 0.83: +- 3D_SoundManager v1.0 DMA with wave desync and ray-casting calculations; +- MemoryManager v1.1 with Page locking and fast reset ( -=đFaster ); +- Enhanced Collision Detection algorithm; +- return of Multi-Player game; +- return of Window resizable (needs testing) & Palette GAMMA correction; + + EHI IT'S A BETA ! Needs to be tested ! + +Info: +- Per me, con la SYNCronizzazione video, dovrebbe andare pi— lento... quindi + puoi toglierla con l'opzione /NOSYNC (se vuoi vedere le opzioni usa /H, ma + certe ancora non funzionano); sto cercando un altro algoritmo per la + sincronizzazione, ma Š assolutamente inutile perchŠ dipende solo dalla + scheda video ! +- La vera lentezza del gioco Š solo nei pavimenti e soffitti, tutto il + resto Š veloce anche senza ottimizzazione; non credo che metter• mai + un'opzione per eliminare il disegno dei pav/sof, ma forse si potrebbe + fare una routine pi— veloce senza texture mapping per i computer dove + la lentezza Š inaccettabile ( <18 fps ); + +---------------------------------------------------------------------------- +STORIA DI UN ERRORE O DI UN VIRUS ? (26/10/96) + (...questo lo devo assolutamente scrivere !) + (se non ti interessa, salta oltre il tratteggio) + +Il fottuto problema del ca..., li mort..., sto str..., porc... l'ho risolto! + L'errore pi— difficile di tutti quelli che mi sono capitati (tempo di + determinazione della soluzione: circa 6 ore complessive). + (ora capisci che intendo per esaurimento di nervi !?) + Il problema stava diviso in due routines assembler del gestore di + memoria e agiva in modo assolutamente incontrollabile, perchŠ dipendeva + dalla configurazione iniziale (casuale) del computer, e siccome questo + si bloccava sempre, il risultato cambiava ad ogni reset del sistema. + L'errore di per s‚ avrebbe comportato solo un'errata scrittura in memoria + ma questo influiva su quasi tutte le funzioni del gioco e quindi l'errore + era ogni volta diverso. Una volta determinato l'errore vero e proprio, + cioŠ "il mandante" l'ho corretto, ma a questo punto il secondo errore Š + corso in aiuto del primo rimischiando le carte ed eludendo ogni tipo di + controlli da me fatti per annientare il primo (sembra una puntata di + "Hack, l'ammazzavirus"). Un errore, oserei dire, Stealth e da + Immunodeficenza prodotta (detto cosŤ sembra proprio un virus). + Solo un'attenta analisi incrociata e l'attacco su pi— fronti, l'elimina- + zione di parti di programma, la creazione di finte aree dati e un + piccolo giro di debug {*blink*} hanno permesso di determinare la causa + prima del male (ma non la seconda !) e in seguito (per induzione) anche + la seconda, con l'ovvia fortuna di averli entrambi dello stesso tipo e + nello stesso modulo ! + Questo tipo di errore Š quello pi— bestiale (ma avviene quasi esclusiva- + mente per l'uso di routines assembler) ed Š provocato dal caricamento di + dati puntatore (far) nel DATA SEGMENT con l'immediato impedimento di + leggere dati globali con l'esatto valore (il compilatore dice che va + tutto bene e invece col cazzo !). Di per s‚ il problema di leggere + i valori corretti delle variabili provoca un malfunzionamento evidente + del modulo e il suo immediato riconoscimento, ma questa volta si Š + creata una "coincidenza di istruzioni" per cui il primo errore provocava + distruzione di dati in memoria (e quindi un malfunzionamento su tutti i + fronti) e il secondo provvedeva a nascondere il primo con la tecnica + stealth di ricoprimento, tipica dei virus informatici. + +Scusa della noiosa interruzione, ma Š per i posteri ! (It will be only ONE !) +---------------------------------------------------------------------------- + +Problemi noti (in questa versione c'Š una soluzione a tutto ! (se p• f…)): +- collisioni in generale tra mostri e muri...; +- quando si Š attaccati ad un mostro, questo non riesce a staccarsi; +- 3d_sound da tarare (cosŤ va bene ?); + si deve anche regolare il fattore di attenuazione dovuto al passaggio del + suono attraverso muri, ecc. +- non ci sono ancora tutte le animazioni; +- alcune collisioni non sono state esaminate (bisogna impostare la + dimensione virtuale degli oggetti coinvolti); +- forzando, si pu• passare tra 2 colonne (Š davvero un problema ?); +- Non c'Š ancora l'editor per la nuova versione (!); +- Non c'Š ancora la gestione dei font lineare (ma Š quasi fatta); +- Non c'Š ancora la gestione delle esplosioni (Š solo simulata per alcuni + oggetti, ma non provoca nessuno spostamento); +- Il Player non muore; +- ...e tutte le cavolate + +Problemi lontani (in ordine di precedenza): +- L'editor; +- Il men—; +- La gestione del mouse o joystick; + +I Suoni: +Ci sono delle regole per la registrazione dei suoni: +- accŠtto ®soloŻ i formati RAW, VOC, WAV a 11,025KHz NON COMPRESSI, MONO e + ad 8 BIT ! (se si decidesse di abbassare la frequenza per tutti o di + ridurre la grandezza dei files a me sta bene (ma l'eco Š bello)); +- Il volume per i suoni (3D) che verranno spazializzati deve essere + globalmente lo stesso (o coerente nel'insieme) e NON deve avere punte in + cui l'onda viene tagliata (l'hai fatto a Teoria dei Segnali ehh ?! (vedi + "-cut" o "Bobbit")); questa cosa Š importante perchŠ non influisce + negativamente solo sulla qualit… del suono, ma anche sul lavoro di + sovrapposizione del 3D_SoundManager !!! + NOTA: I suoni di ambiente come tuoni, gocce (?), ecc. sono trattati in + modo diverso e quindi possono avere volumi anche molto diversi. + +Problema gravissimo: +LA MEMORIA: Il nuovo gestore di memoria riesce a bloccare aree di memoria + con alta priorit… (quelle dei suoni) evitando un continuo + processo di swapping in XMS ma, data la grandezza dei file + sonori, questo impedisce lo spostamento di altri blocchi. + Se gli altri blocchi sono le texture, il problema non Š grave, + ma potrebbe rallentare il gioco su un computer lento (486), + invece se il blocco Š quello relativo ad un'altro suono, cioŠ + di grandi dimensioni, si potrebbe bloccare addirittura il + gioco! (Stiamo lavorando per voi) + Se un suono non entra in memoria, NON VIENE SUONATO ! (Ma in + futuro potrebbe liberarsi...). + + IL PROGRAMMA E' STATO RICOMPILATO OTTIMIZZANDO LA GRANDEZZA + DELL'ESEGUIBILE E NON LA VELOCITA' D'ESECUZIONE !!!!!!!!!!! + + La prossima revisione sar… ottimizzata per memoria a cominciare + dal nuovo gestore (MemoryManager v1.1) e ci• comporter… un + rallentamento delle funzioni di swapping (non apprezzabile + ad occhio, credo) + + + +úúúúúúúúúúúú-----=======đđđđđđđđđđđđđđđđđđđđđđđđđ=======-----úúúúúúúúúúúúúú + 1ř revisione: KAOS1.EXE + +"Dalla qualit… ed evoluzione degli errori direi che la versione 8 di KAOS Š + veramente ad un'altro livello. Ma anche per gli errori dell'ottava gene- + razione c'Š stato rimedio." +Ho gi… sfornato la prima revisione della versione L0.83á (Š proprio vero, +quando le cose funzionano...). In questa Š stata modificata la struttura +dati utilizzata per la gestione del MemoryManager (guadagno di circa 3Kb ! +Ultimamente m'attacco pure ai bit !) e apportate delle modifiche ai +parametri di compilazione per ottenere delle ottimizzazioni per le routines +assembler. +Ho applicato un ulteriore ottimizzazione alle routines di disegno pavimenti/ +soffitti (in totale 6 ottimizzazioni in cascata, di cui quest'ultima fissa). + +Problemi gravi da risolvere subito: +- Le collisioni tra gli oggetti, e intendo tutti tranne il player, devono es- + sere uniformate ad utilizzare l'algoritmo del Player. + DEVI TESTARE L'ALGORITMO DI COLLISIONE DEL PLAYER CON MURI E OGGETTI FERMI + se questo ti va bene allora procedo alla sostituzione generale (ma + attenzione, il nuovo algoritmo Š meno efficiente ed Š una via di mezzo tra + quello stupido e quello intelligente (inaccettabile)); + Modificando questo errore si ovvierebbe anche ad un'altra bestialata che + riguarda l'errata visualizzazione degli oggetti molto vicini ai muri + (prima si tagliavano, ora sono loro a "tagliare" il muro !); +- La modalit… MULTI-PLAYER NON Š stata assolutamente controllata !!! + +Problemi meno gravi: +- Non c'Š ancora la registrazione della configurazione (ma non credo che + serva a molto ora che io lavoro a finestra massima e l'algoritmo di + ricalcolo delle dimensioni Š praticamente istantaneo); + +Ottimizzare, sŤ ma quanto ? +* Gli oggetti mobili (per ora solo i mostri) si attivano solo quando sono +stati visti almeno per una volta e da quel momento si animano per tutta la +loro vita rubando tempo alla CPU anche quando nessuno pu• vederli per un +lungo periodo di tempo ("Se un albero cade in Australia e nessuno pu• +vederlo, allora l'albero Š caduto o no ?")... +Per mostri poco intelligenti (come topi o slimer) potrebbe essere possibile +fornire un controllo sul tempo che Š trascorso dall'ultima volta che sono +stati visti e procedere cosŤ (singolarmente) alla loro disattivazione (nel +senso che non vengono pi— animati fino alla prossima inquadratura da parte +di almeno un giocatore). +Per le torce e i lampadari questo tipo di ottimizzazione Š spinta ai massimi +livelli, bloccando immediatamente l'animazione non appena l'oggetto esce +fuori dal quadro di visione globale. +* Il 3D-îngine riesce a gestire qualsiasi oggetto, per questo potrebbe essere +possibile un'inquadratura separata (fronte/retro), una visione dal punto di +vista del missile che vola, la "modalit… carrello" di BARBOON, ecc. +L'unica restrizione che per ora non intendo elimirare per ragioni di +efficienza Š il fatto che il 3D-îngine non possa gestire al meglio (che si +legge "velocemente") finestre di dimensioni diverse. + +---- Nel KAOS2.EXE c'Š la versione con il 3D_SoundManager tarato bene + (almeno credo); per controllare la veridiciticimiticit… usare ADMAXY + e sparare in tondo... (in entrambe le versioni) e provare poi con i + punti lontani e con quelli nascosti dai muri, sempre girando lo sguardo + mentre il suono Š in esecuzione. + Non credo di aver ancora raggiunto l'uso ottimale di entrambe le + tecniche stereo (per questa versione lo sfasamento si occupa solo + dell'angolo e il volume della distanza e dell'attenuazione, invece + dovrebbe esserci una specie di interazione profondamente matematica...) + +NOTA DEI TEMPI PRESENTI: 'sto gioco 'n finir… mai! +(momento di sconforto) A me m'ha rotto verament'ibball ! + Me comincia a stuf… pure 'l 3D sound !! + PerchŠ dopo non facciamo un programma serio invece + dell'n-esima copiatura ? + PerchŠ perdere tempo con questa roba quando c'Š chi + ti gestisce BSP in 3D al doppio della velocit… con + texture mapping a correzione prospettica e Phong + shading ? + PerchŠ 2 non fa 3 ? + PerchŠ non mettiamo una musica heavy metal nel + gioco ? + PerchŠ non mi va di pensare a come disegnare lo + sfondo ? + PerchŠ per ottenere lo sfondo sul map editor sar… + necessario applicare dei quadrati particolari non + associati a nessuna texture nel gioco ? + PerchŠ non facciamo un gioco di motoscafi come + quello di Federico ? + Ma non era di auto ? + Beh sŤ, ma hai visto come curvano ? + PerchŠ in queste versioni non ho messo i pavimenti + diversi ? + PerchŠ perdo tempo a scrivere queste cazzate quando + devo studiare Fisica II ? + PerchŠ il MemoryManager non funziona per + Windows 95(TM) ? + PerchŠ anche il gioco di Federico non funziona sotto + Windows 95(TM) ? + Cos'Š Windows 95(TM) ? + Cos'Š (TM) ? + Cos'Š ? ? + PerchŠ il MemoryManager vede solo 2M di XMS ? + PerchŠ ho programmato la SB16 in modo diverso dalla + SBPro ? + PerchŠ se riduco la finestra di visualizzazione Š + possibile che il computer si blocchi quando c'Š + un corridoio lungo ? + PerchŠ l'algoritmo di disegno dei pavimenti va pi— + veloce quando i pavimenti cambiano orizzontalmente + rispetto a quando i pavimenti sono visti a strisce + verticali ? + PerchŠ tutti vogliono fare i programmatori e farsi + venire la meningite ? + PerchŠ c'Š ancora chi programma l'Amiga(TM) ? + PerchŠ in casi particolari il MemoryManager v1.1 + non funziona rispetto al suo predecessore ? + PerchŠ non voglio suonare i file sonori direttamente + dalla memoria XMS quando ho quasi la certezza che + questo possa essere fatto ? + PerchŠ non mi sono comprato il compilatore a 32 bit + per non avere pi— problemi di memoria ? + PerchŠ gli altri non si fanno tutti questi + problemi ? + PerchŠ gli alieni di ID4 hanno attaccato la Terra + senza pensarci troppo ? + PerchŠ avevano i tentacoli ? + PerchŠ non facciamo un gioco proiettato al futuro + o uno simile ad "Alone in the Dark" ? + PerchŠ hai continuato a leggere queste domande + se sapevi che erano inutili e senza le risposte ? + PerchŠ hai guardato quanto mancava ancora da + leggere prima della fine del file ? + PerchŠ non usi il RAR per comprimere ? (l'ho messo + nel disco, ma Š nascosto e devi scrivere: + attrib -h a:rar.exe) + PerchŠ prima di masterizzare il tuo hard disk non + esegui l'ottimizzazione del disco ? + PerchŠ in Quake FLY&NOCLIP le torce si vedono + anche nell'altra stanza e i mostri no ? + PerchŠ l'eseguibile del nostro gioco Š cosŤ grosso ? + PerchŠ "Ingegneria del software" e "Informatica + Grafica" sono in alternativa ? + PerchŠ rot(TUO) != 0 ? + PerchŠ mi invento sempre nomi strani per ogni nuova + versione del Kaos di Kaos ? + PerchŠ "Golden Hawk" ? + PerchŠ non ho fatto una mappa 128x128 ? + PerchŠ non Š assolutamente possibile cambiare le + dimensioni di questa mappa ? + PerchŠ sono tanto fiero della mappa degli oggetti ? + PerchŠ ora di C++ Š rimasta solo la gestione degli + oggetti e degli eventi ? + PerchŠ non ho ancora ottimizzato al massimo il + 3D-îngine ? + PerchŠ non ho messo il soldato o le animazioni + delle morti dei mostri ? + PerchŠ ci vuole tanto tempo a fare questa cavolo di + intelligenza dei mostri ? + PerchŠ non si prendono ancora gli oggetti ? + PerchŠ questo file mi ricorda tanto la fine di + "Monkey Island" 1, 2 e "Sam & Max hit the road" ? + PerchŠ PerchŠ ? + PerchŠ uso il DMA basso anche per la SB16 ? + PerchŠ il sonoro non funziona se non ho impostato + il DMA ad 1 e l'IRQ a 5 ? + PerchŠ sul tuo computer la temporizzazione non + funziona ? + PerchŠ non ho corretto il problema delle torce ? + PerchŠ non ho scritto all'inizio della pagina ? + PerchŠ i tuoi due controller hanno fatto conflitto + solo dopo un anno di uso ? + PerchŠ non ho copiato la routine di + autoconfigurazione della scheda sonora dai + sorgenti di Wolf3D ? + PerchŠ termina cosŤ la lista dei perchŠ ? + + Unica risposta: PerchŠ me s• rotto ! + + -=đNicođ=- diff --git a/Documentazione/Testi/2nd stage/KAOSL83.NIC b/Documentazione/Testi/2nd stage/KAOSL83.NIC new file mode 100644 index 0000000..eba05d2 --- /dev/null +++ b/Documentazione/Testi/2nd stage/KAOSL83.NIC @@ -0,0 +1,324 @@ + + + + + ++ ++++ ++ + + + + ++ ++++++++ ++ + ++++ __-++++++++++ ++++ + + + + +++++ _---+++++++++++ +++++ + + + ++ ++++ +++++++++++++ ++++ ++ + + + ++++ ++++++ +++++++++++++++++ ++++++ ++++ + + + ++++++++++++++++++++++++++++++++++++++++++ + + + ++++++++++++++++++++++++++++++++++ + + + + ++++ ++++++++++++++++++++++++++ ++++ + + + + ++++++++++++++++++++++++++++++++++ + + + Źndromeda Soźt KAOS v0.83á Golden Hawk + + Technical Informations and Error Reports + (another story-file) + +Dalla versione L0.8 KAOS dispone delle seguenti novit…: +- Gestione lineare della grafica (persi 64K di RAM); +- Gestione completa della mappa di gioco con forme multiple; +- Pavimenti e soffitti in texture quadrate e gestione luce, con 5 livelli + di ottimizzazione (ma per me Š ancora lento); +- Fantastico (Š dir poco!) algoritmo di gestione degli oggetti con mappa + separata ed estese capacit… di sovrapposizione (dynamically linked list + with automatic collision updating (C)1997 Valentini Domenico); +- Eccezionale flessibilit… e resistenza alle modifiche (l'ho fatto io !); +- ... + +Dalla 0.83: +- 3D_SoundManager v1.0 DMA with wave desync and ray-casting calculations; +- MemoryManager v1.1 with Page locking and fast reset ( -=đFaster ); +- Enhanced Collision Detection algorithm; +- return of Multi-Player game; +- return of Window resizable (needs testing) & Palette GAMMA correction; + + EHI IT'S A BETA ! Needs to be tested ! + +Info: +- Per me, con la SYNCronizzazione video, dovrebbe andare pi— lento... quindi + puoi toglierla con l'opzione /NOSYNC (se vuoi vedere le opzioni usa /H, ma + certe ancora non funzionano); sto cercando un altro algoritmo per la + sincronizzazione, ma Š assolutamente inutile perchŠ dipende solo dalla + scheda video ! +- La vera lentezza del gioco Š solo nei pavimenti e soffitti, tutto il + resto Š veloce anche senza ottimizzazione; non credo che metter• mai + un'opzione per eliminare il disegno dei pav/sof, ma forse si potrebbe + fare una routine pi— veloce senza texture mapping per i computer dove + la lentezza Š inaccettabile ( <18 fps ); + +---------------------------------------------------------------------------- +STORIA DI UN ERRORE O DI UN VIRUS ? (26/10/96) + (...questo lo devo assolutamente scrivere !) + (se non ti interessa, salta oltre il tratteggio) + +Il fottuto problema del ca..., li mort..., sto str..., porc... l'ho risolto! + L'errore pi— difficile di tutti quelli che mi sono capitati (tempo di + determinazione della soluzione: circa 6 ore complessive). + (ora capisci che intendo per esaurimento di nervi !?) + Il problema stava diviso in due routines assembler del gestore di + memoria e agiva in modo assolutamente incontrollabile, perchŠ dipendeva + dalla configurazione iniziale (casuale) del computer, e siccome questo + si bloccava sempre, il risultato cambiava ad ogni reset del sistema. + L'errore di per s‚ avrebbe comportato solo un'errata scrittura in memoria + ma questo influiva su quasi tutte le funzioni del gioco e quindi l'errore + era ogni volta diverso. Una volta determinato l'errore vero e proprio, + cioŠ "il mandante" l'ho corretto, ma a questo punto il secondo errore Š + corso in aiuto del primo rimischiando le carte ed eludendo ogni tipo di + controlli da me fatti per annientare il primo (sembra una puntata di + "Hack, l'ammazzavirus"). Un errore, oserei dire, Stealth e da + Immunodeficenza prodotta (detto cosŤ sembra proprio un virus). + Solo un'attenta analisi incrociata e l'attacco su pi— fronti, l'elimina- + zione di parti di programma, la creazione di finte aree dati e un + piccolo giro di debug {*blink*} hanno permesso di determinare la causa + prima del male (ma non la seconda !) e in seguito (per induzione) anche + la seconda, con l'ovvia fortuna di averli entrambi dello stesso tipo e + nello stesso modulo ! + Questo tipo di errore Š quello pi— bestiale (ma avviene quasi esclusiva- + mente per l'uso di routines assembler) ed Š provocato dal caricamento di + dati puntatore (far) nel DATA SEGMENT con l'immediato impedimento di + leggere dati globali con l'esatto valore (il compilatore dice che va + tutto bene e invece col cazzo !). Di per s‚ il problema di leggere + i valori corretti delle variabili provoca un malfunzionamento evidente + del modulo e il suo immediato riconoscimento, ma questa volta si Š + creata una "coincidenza di istruzioni" per cui il primo errore provocava + distruzione di dati in memoria (e quindi un malfunzionamento su tutti i + fronti) e il secondo provvedeva a nascondere il primo con la tecnica + stealth di ricoprimento, tipica dei virus informatici. + +Scusa della noiosa interruzione, ma Š per i posteri ! (It will be only ONE !) +---------------------------------------------------------------------------- + +Problemi noti (in questa versione c'Š una soluzione a tutto ! (se p• f…)): +- collisioni in generale tra mostri e muri...; +- quando si Š attaccati ad un mostro, questo non riesce a staccarsi; +- 3d_sound da tarare (cosŤ va bene ?); + si deve anche regolare il fattore di attenuazione dovuto al passaggio del + suono attraverso muri, ecc. +- non ci sono ancora tutte le animazioni; +- alcune collisioni non sono state esaminate (bisogna impostare la + dimensione virtuale degli oggetti coinvolti); +- forzando, si pu• passare tra 2 colonne (Š davvero un problema ?); +- Non c'Š ancora l'editor per la nuova versione (!); +- Non c'Š ancora la gestione dei font lineare (ma Š quasi fatta); +- Non c'Š ancora la gestione delle esplosioni (Š solo simulata per alcuni + oggetti, ma non provoca nessuno spostamento); +- Il Player non muore; +- ...e tutte le cavolate + +Problemi lontani (in ordine di precedenza): +- L'editor; +- Il men—; +- La gestione del mouse o joystick; + +I Suoni: +Ci sono delle regole per la registrazione dei suoni: +- accŠtto ®soloŻ i formati RAW, VOC, WAV a 11,025KHz NON COMPRESSI, MONO e + ad 8 BIT ! (se si decidesse di abbassare la frequenza per tutti o di + ridurre la grandezza dei files a me sta bene (ma l'eco Š bello)); +- Il volume per i suoni (3D) che verranno spazializzati deve essere + globalmente lo stesso (o coerente nel'insieme) e NON deve avere punte in + cui l'onda viene tagliata (l'hai fatto a Teoria dei Segnali ehh ?! (vedi + "-cut" o "Bobbit")); questa cosa Š importante perchŠ non influisce + negativamente solo sulla qualit… del suono, ma anche sul lavoro di + sovrapposizione del 3D_SoundManager !!! + NOTA: I suoni di ambiente come tuoni, gocce (?), ecc. sono trattati in + modo diverso e quindi possono avere volumi anche molto diversi. + +Problema gravissimo: +LA MEMORIA: Il nuovo gestore di memoria riesce a bloccare aree di memoria + con alta priorit… (quelle dei suoni) evitando un continuo + processo di swapping in XMS ma, data la grandezza dei file + sonori, questo impedisce lo spostamento di altri blocchi. + Se gli altri blocchi sono le texture, il problema non Š grave, + ma potrebbe rallentare il gioco su un computer lento (486), + invece se il blocco Š quello relativo ad un'altro suono, cioŠ + di grandi dimensioni, si potrebbe bloccare addirittura il + gioco! (Stiamo lavorando per voi) + Se un suono non entra in memoria, NON VIENE SUONATO ! (Ma in + futuro potrebbe liberarsi...). + + IL PROGRAMMA E' STATO RICOMPILATO OTTIMIZZANDO LA GRANDEZZA + DELL'ESEGUIBILE E NON LA VELOCITA' D'ESECUZIONE !!!!!!!!!!! + + La prossima revisione sar… ottimizzata per memoria a cominciare + dal nuovo gestore (MemoryManager v1.1) e ci• comporter… un + rallentamento delle funzioni di swapping (non apprezzabile + ad occhio, credo) + + + +úúúúúúúúúúúú-----=======đđđđđđđđđđđđđđđđđđđđđđđđđ=======-----úúúúúúúúúúúúúú + 1ř revisione: KAOS1.EXE + +"Dalla qualit… ed evoluzione degli errori direi che la versione 8 di KAOS Š + veramente ad un'altro livello. Ma anche per gli errori dell'ottava gene- + razione c'Š stato rimedio." +Ho gi… sfornato la prima revisione della versione L0.83á (Š proprio vero, +quando le cose funzionano...). In questa Š stata modificata la struttura +dati utilizzata per la gestione del MemoryManager (guadagno di circa 3Kb ! +Ultimamente m'attacco pure ai bit !) e apportate delle modifiche ai +parametri di compilazione per ottenere delle ottimizzazioni per le routines +assembler. +Ho applicato un ulteriore ottimizzazione alle routines di disegno pavimenti/ +soffitti (in totale 6 ottimizzazioni in cascata, di cui quest'ultima fissa). + +Problemi gravi da risolvere subito: +- Le collisioni tra gli oggetti, e intendo tutti tranne il player, devono es- + sere uniformate ad utilizzare l'algoritmo del Player. + DEVI TESTARE L'ALGORITMO DI COLLISIONE DEL PLAYER CON MURI E OGGETTI FERMI + se questo ti va bene allora procedo alla sostituzione generale (ma + attenzione, il nuovo algoritmo Š meno efficiente ed Š una via di mezzo tra + quello stupido e quello intelligente (inaccettabile)); + Modificando questo errore si ovvierebbe anche ad un'altra bestialata che + riguarda l'errata visualizzazione degli oggetti molto vicini ai muri + (prima si tagliavano, ora sono loro a "tagliare" il muro !); +- La modalit… MULTI-PLAYER NON Š stata assolutamente controllata !!! + +Problemi meno gravi: +- Non c'Š ancora la registrazione della configurazione (ma non credo che + serva a molto ora che io lavoro a finestra massima e l'algoritmo di + ricalcolo delle dimensioni Š praticamente istantaneo); + +Ottimizzare, sŤ ma quanto ? +* Gli oggetti mobili (per ora solo i mostri) si attivano solo quando sono +stati visti almeno per una volta e da quel momento si animano per tutta la +loro vita rubando tempo alla CPU anche quando nessuno pu• vederli per un +lungo periodo di tempo ("Se un albero cade in Australia e nessuno pu• +vederlo, allora l'albero Š caduto o no ?")... +Per mostri poco intelligenti (come topi o slimer) potrebbe essere possibile +fornire un controllo sul tempo che Š trascorso dall'ultima volta che sono +stati visti e procedere cosŤ (singolarmente) alla loro disattivazione (nel +senso che non vengono pi— animati fino alla prossima inquadratura da parte +di almeno un giocatore). +Per le torce e i lampadari questo tipo di ottimizzazione Š spinta ai massimi +livelli, bloccando immediatamente l'animazione non appena l'oggetto esce +fuori dal quadro di visione globale. +* Il 3D-îngine riesce a gestire qualsiasi oggetto, per questo potrebbe essere +possibile un'inquadratura separata (fronte/retro), una visione dal punto di +vista del missile che vola, la "modalit… carrello" di BARBOON, ecc. +L'unica restrizione che per ora non intendo elimirare per ragioni di +efficienza Š il fatto che il 3D-îngine non possa gestire al meglio (che si +legge "velocemente") finestre di dimensioni diverse. + +---- Nel KAOS2.EXE c'Š la versione con il 3D_SoundManager tarato bene + (almeno credo); per controllare la veridiciticimiticit… usare ADMAXY + e sparare in tondo... (in entrambe le versioni) e provare poi con i + punti lontani e con quelli nascosti dai muri, sempre girando lo sguardo + mentre il suono Š in esecuzione. + Non credo di aver ancora raggiunto l'uso ottimale di entrambe le + tecniche stereo (per questa versione lo sfasamento si occupa solo + dell'angolo e il volume della distanza e dell'attenuazione, invece + dovrebbe esserci una specie di interazione profondamente matematica...) + +NOTA DEI TEMPI PRESENTI: 'sto gioco 'n finir… mai! +(momento di sconforto) A me m'ha rotto verament'ibball ! + Me comincia a stuf… pure 'l 3D sound !! + PerchŠ dopo non facciamo un programma serio invece + dell'n-esima copiatura ? + PerchŠ perdere tempo con questa roba quando c'Š chi + ti gestisce BSP in 3D al doppio della velocit… con + texture mapping a correzione prospettica e Phong + shading ? + PerchŠ 2 non fa 3 ? + PerchŠ non mettiamo una musica heavy metal nel + gioco ? + PerchŠ non mi va di pensare a come disegnare lo + sfondo ? + PerchŠ per ottenere lo sfondo sul map editor sar… + necessario applicare dei quadrati particolari non + associati a nessuna texture nel gioco ? + PerchŠ non facciamo un gioco di motoscafi come + quello di Federico ? + Ma non era di auto ? + Beh sŤ, ma hai visto come curvano ? + PerchŠ in queste versioni non ho messo i pavimenti + diversi ? + PerchŠ perdo tempo a scrivere queste cazzate quando + devo studiare Fisica II ? + PerchŠ il MemoryManager non funziona per + Windows 95(TM) ? + PerchŠ anche il gioco di Federico non funziona sotto + Windows 95(TM) ? + Cos'Š Windows 95(TM) ? + Cos'Š (TM) ? + Cos'Š ? ? + PerchŠ il MemoryManager vede solo 2M di XMS ? + PerchŠ ho programmato la SB16 in modo diverso dalla + SBPro ? + PerchŠ se riduco la finestra di visualizzazione Š + possibile che il computer si blocchi quando c'Š + un corridoio lungo ? + PerchŠ l'algoritmo di disegno dei pavimenti va pi— + veloce quando i pavimenti cambiano orizzontalmente + rispetto a quando i pavimenti sono visti a strisce + verticali ? + PerchŠ tutti vogliono fare i programmatori e farsi + venire la meningite ? + PerchŠ c'Š ancora chi programma l'Amiga(TM) ? + PerchŠ in casi particolari il MemoryManager v1.1 + non funziona rispetto al suo predecessore ? + PerchŠ non voglio suonare i file sonori direttamente + dalla memoria XMS quando ho quasi la certezza che + questo possa essere fatto ? + PerchŠ non mi sono comprato il compilatore a 32 bit + per non avere pi— problemi di memoria ? + PerchŠ gli altri non si fanno tutti questi + problemi ? + PerchŠ gli alieni di ID4 hanno attaccato la Terra + senza pensarci troppo ? + PerchŠ avevano i tentacoli ? + PerchŠ non facciamo un gioco proiettato al futuro + o uno simile ad "Alone in the Dark" ? + PerchŠ hai continuato a leggere queste domande + se sapevi che erano inutili e senza le risposte ? + PerchŠ hai guardato quanto mancava ancora da + leggere prima della fine del file ? + PerchŠ non usi il RAR per comprimere ? (l'ho messo + nel disco, ma Š nascosto e devi scrivere: + attrib -h a:rar.exe) + PerchŠ prima di masterizzare il tuo hard disk non + esegui l'ottimizzazione del disco ? + PerchŠ in Quake FLY&NOCLIP le torce si vedono + anche nell'altra stanza e i mostri no ? + PerchŠ l'eseguibile del nostro gioco Š cosŤ grosso ? + PerchŠ "Ingegneria del software" e "Informatica + Grafica" sono in alternativa ? + PerchŠ rot(TUO) != 0 ? + PerchŠ mi invento sempre nomi strani per ogni nuova + versione del Kaos di Kaos ? + PerchŠ "Golden Hawk" ? + PerchŠ non ho fatto una mappa 128x128 ? + PerchŠ non Š assolutamente possibile cambiare le + dimensioni di questa mappa ? + PerchŠ sono tanto fiero della mappa degli oggetti ? + PerchŠ ora di C++ Š rimasta solo la gestione degli + oggetti e degli eventi ? + PerchŠ non ho ancora ottimizzato al massimo il + 3D-îngine ? + PerchŠ non ho messo il soldato o le animazioni + delle morti dei mostri ? + PerchŠ ci vuole tanto tempo a fare questa cavolo di + intelligenza dei mostri ? + PerchŠ non si prendono ancora gli oggetti ? + PerchŠ questo file mi ricorda tanto la fine di + "Monkey Island" 1, 2 e "Sam & Max hit the road" ? + PerchŠ "perchŠ" ? + PerchŠ uso il DMA basso anche per la SB16 ? + PerchŠ il sonoro non funziona se non ho impostato + il DMA ad 1 e l'IRQ a 5 ? + PerchŠ sul tuo computer la temporizzazione non + funziona ? + PerchŠ non ho corretto il problema delle torce ? + PerchŠ non ho scritto dalla prima colonna ? + PerchŠ i tuoi due controller hanno fatto conflitto + solo dopo un anno di uso ? + PerchŠ non ho copiato la routine di + autoconfigurazione della scheda sonora dai + sorgenti di Wolf3D ? + PerchŠ termina cosŤ la lista dei perchŠ ? + + Unica risposta: PerchŠ me s• rotto ! + + + -=đNicođ=- diff --git a/Documentazione/Testi/2nd stage/KAOSL85.NIC b/Documentazione/Testi/2nd stage/KAOSL85.NIC new file mode 100644 index 0000000..2720a6d --- /dev/null +++ b/Documentazione/Testi/2nd stage/KAOSL85.NIC @@ -0,0 +1,54 @@ + + Źndomeda KAOS L0.85á + | + -- * --------- + | | \ + | \ + | | + | / /------ / \ _____ __ + | ---- / _____- \ | | / \ | / \ + | \ / | \ / -------- |/ + | \ | | \ / | | + | \ \______/ \ / \______/ | + / + ---------- + Version + + +Cosa c'Š ? +- Hig Performance collision manager (Top Gun version): + finalmente il MIGLIORE gestore di collisioni mai creato: + + veloce di tutti quelli fatti e + preciso nella collisione con i muri, + ma perde colpi in quella con oggetti; + Š gi… disponibile la versione "Gold" dell'algoritmo che permette di + superare questa lacuna, ma serve ? +- 3D_SoundManager v2.0 - rattoppati gli errori alla routine lookray(), + cambiato l'effetto sonoro globale, volumi, aggiunte caratteristiche al + suoni, possibilit… di suonare suoni caricati da hard disk a blocchi + (+ suoni ÷ .MOD). +- MemoryManager v2.0 - nuova routine di allocazione XMS; + ora il gioco funziona anche sotto Windows95(TM) (guadagno di qualche + decina di byte (anche centinaia) di memoria base); +- Ottimizzazione immagini di animazione: + Š possibile ottenere l'animazione dei mostri che attaccano (anche vedendoli + da dietro) senza spreco di memoria ! +- EventManager v1.1 gestione della coda degli eventi con possibilit… di + rifiuto e accodamento dei processi ! (max 64 eventi per ciclo); + introdotti i messaggi "direct" per scambio comunicazioni istantanee. +- Object handle_event() gestisce ora l'EV_BOOM in modo da convalidarlo con + la routine lookray(), cioŠ Š pi— difficile che un oggetto venga colpito + da un'esplosione quando c'Š un muro separatore. +- Migliorate da tutti i punti di vista le routine di visualizzazione e + diffusione password (cheats). + +Sto pensando di... +- configurare la scheda sonora secondo i parametri presenti nell'environment + del DOS (BLASTER=A220 I...), come fa Quake; +- + +Problemi: +- La fottutissima porta 28 !!! + + -=đNicođ=- + + diff --git a/Documentazione/Testi/2nd stage/KAOSL86B.NIC b/Documentazione/Testi/2nd stage/KAOSL86B.NIC new file mode 100644 index 0000000..75cc5c9 --- /dev/null +++ b/Documentazione/Testi/2nd stage/KAOSL86B.NIC @@ -0,0 +1,128 @@ + + + The KAOS l0.86á (2nd revision) + (versione Big Pack) + (hai visto l'eseguibile che Š !?) + + + NON ho voluto scrivere 87 perchŠ mi mancava una cosa... + +Che c'Š: +- nuovi suoni (e certi sono veramente NUOVI, nel senso che li ho trovati in + una mia directory di .Wav ... vedi se funzionano e poi modificali come + vuoi); + ! devi assolutamente accorciare (della met…) il suono di apertura della + porta ! +- praticamente le funzionalit… di gioco ci sono tutte, ma non sono tutte + collegate (ehi, non ho detto che ho fatto il men— o il playback !), per + questo la barra piccola non d… indicazioni, non si possono raccogliere + le munizioni (o meglio: le raccogli ma non ci fai niente), ... +- ho personalmente reinterpretato la mia cheat (ADNICO) per rendere il gioco + un p• pi— "rilassante". +- c'Š il segnapunti, ma Š tutto da "tarare" e personalmente lo eliminerei + insieme ai "bonus punteggio", lascerei invece la grandissima e utilissima + informazione sul numero di morti fatti (lo so Š banale ma...); +- Finalmente ho potuto sfruttare le capacit… di progetto dell'EventManager + (nota: ancora v1.0 !) per gestire i punteggi in modo da non perdere neanche + un morto: + il sistema diffonde nella messaggeria standard anche le informazioni + relative al padrone del messaggio che, oggetti come Fireball (Missile) e + Barile provvedono ad utilizzare ed inoltrare nei propri messaggi; + il risultato Š che i punti effettuati da una reazione a catena che + coinvolge missili, barili, ecc. vanno tutti a chi ha creato l'esplosione + mortale; se entrambi i giocatori sono causa della reazione, allora + i punteggi verranno calcolati in base alla reale percentuale di distru- + zione che ognuno dei due ha provocato, seguendo esattamente il processo + (sequenziale) di diffusione dei messaggi (solo un computer pu• farlo) ! + +- Come avrai notato (suppongo sempre che tu guardi prima il gioco... e + "purtroppo" ho sempre ragione) ci sono anche le faccine... + ...tutte tranne quella che ride (ride solo la mia versione del God Mode, + valla a guardare); +- c'ho messo anche l'urlo di quando viene colpito il player (il suono Š + differenziato a seconda della botta... si sente poco, vedi tu); +- Ho installato la versione Golden Hawk del CollisionManager (se qualche + volta fallisce (vedi Faccia) non Š per colpa sua); +- Il MemoryManager comincia a faticare: + l'altro giorno l'ho incontrato nella stanza delle grate, dove ci sono + tutti i tipi di mostri (quasi) (nota che il soldato e il mouse "nascono" + da una sola informazione, sull'editor attuale) e mentre stavo per + sparare ho deciso di diventare invincibile, allora toccava a lui (MM) + preparare il suono della cheat, ma se la stava vedendo brutta tra passi, + urli, texture e spari ed ha deciso di uccidere il suono. + Non posso licenziarlo, Š il migliore sul mercato ! + + Credo di averlo gi… detto, ma questa versione del MemoryManager Š stata + progettata per gestire grossi blocchi di dati riallocabili, perci• + soffre quando ci sono molti suoni (grosse aree di memoria bloccate) e + piccoli dati (font di scrittura e numerici); ci sarebbe la possibilit… + di intervenire sul processo di bloccaggio della memoria dei suoni, e in + questo modo si riuscirebbe a gestire al meglio la memoria, ma non si + avrebbe la certezza di poter preparare l'output sonoro in tempo su un + computer lento (in realt… non so quanto lento, ma so che sul mio non + ha problemi...); +- Quando il player "becca" salta & guarda in su/gi—. Prova a sparare un + missilone sul muro di fronte. + PER ORA IL PLAYER NON MUORE !!!! +- NON ho voluto mettere il suono delle ossa perchŠ non ci stava bene ed era + troppo lungo (non credo che ce ne possa essere uno adatto...), forse + dovresti cercare un suono per i teschi che rimbalzano. +- E' stata ottimizzata l'allocazione di memoria per le immagini dello + slimer ! +- NUOVA gestione luci (ora non Š pi— necessario mettere le torce a coppia + davanti e dietro un muro, come non Š pi— indispensabile mettere i + lampadari al centro delle stanze !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!) + +Che non c'Š: +- Non ci sono ancora gli oggetti relativi alla gestione dei singoli mostri. +- Non ci sono tutte le faccine; +- Non c'Š la possibilit… di cambiare le armi con i numeri (STO SERIAMENTE + PENSANDO DI ABBANDONARE QUESTA SCELTA) +- Non c'Š un font numerico adatto alla InfoBar grande (penso chŠ sia meglio + fare un'altra serie di numeri pi— alti e della stessa larghezza sullo + stile di Wolf3D, ma che abbiano tutte le sfumature per un effetto 3D + (non importa il colore in questo caso, prendilo fisso !) + + + ---------- Come procede l'editor ? ----------- + +Le scelte (40%) sono state fatte: +- MOUSE OBBLIGATORIO ! +- NON ci saranno i muri reclinabili, c.v.d. + nel senso che non si potranno ruotare. +- Ruoteranno solo gli OGGETTI per i quali Š importante la posizione (per ora + solo i 2 tipi di torcia). +- Sono previste delle maschere di visualizzazione per dare forma alle + texture con funzionalit… particolari (grate, muri diagonali, ecc.). +- E' prevista una visualizzazione speciale per le porte (muri segreti, ecc.) + che verr… scelta in seguito. +- Sar… prevista un'area dinamica di dati alla fine di ogni file di livello + per gestire la diffusione dei massaggi conseguenti all'attivazione (tenta- + tivo di apertura) di una porta/passaggio_segreto. +- Saranno disponibili 16 livelli per file (".LEV" per ora) di cui 4 (gli + ultimi) usati per le sfide (per dafault, ma poi la cosa pu• essere + cambiata con le opzioni di gioco). + Nelle sfide saranno supportati tutti i tipi di mostro (questo era implicito + al fatto di aver aggiunto la voce KILL nella barra piccola), ma solo se + viene scelto nelle opzioni. +- La mappa globale (sempre dell'editor !) viene creata in tempo reale dal + programma utilizzando le texture 8x8 ridotte al formato 2x2 per una mappa + di 128x128 pixels (con 3x3 si arriverebbe a 192x192 che ancora entra nello + schermo, ma copre tutto il resto). + La mappa globale riprodurr… cosŤ fedelmente (tranne l'effetto maschera) + ci• che appare sulla mappa pi— grande (quindi sar… diversa a seconda del + piano scelto) e sar… utilizzata solo per spostarsi in modo veloce. +- Saranno visibili tutte le texture originali (successivamente prese + direttamente dal "Big file"). +- Le informazioni di stato, sulla texture corrente, maschera, piano sono + visualizzate nella parte bassa dello schermo... in qualche modo. +- i tasti sono tutti in alto e cambiano forma (come quelli della radio + formato analogico) per dire quando sono premuti, in modo da risparmiare + sulle informazioni di ambiente (TEXT/LEVEL/ENEMY/...). +- La rotazione di una texture sar… ottenuta doppio-clickando (col mouse) + sulla mappa parziale (quella con i quadrettoni) oppure direttamente + sulla sua raffigurazione sulla linea di stato in modo da poterla duplicare + facilmente. SOLO PER TEXTURES PARTICOLARI (torce) ! + + + -=đNicođ=- diff --git a/Documentazione/Testi/2nd stage/Kaos86.doc b/Documentazione/Testi/2nd stage/Kaos86.doc new file mode 100644 index 0000000..3736f0c Binary files /dev/null and b/Documentazione/Testi/2nd stage/Kaos86.doc differ diff --git a/Documentazione/Testi/2nd stage/Kaosl84.nic b/Documentazione/Testi/2nd stage/Kaosl84.nic new file mode 100644 index 0000000..c29f7dd --- /dev/null +++ b/Documentazione/Testi/2nd stage/Kaosl84.nic @@ -0,0 +1,191 @@ + ů + | + .**********************.ł + .**###################-#ÄÄ*ÄÄ - ú + **### KAOS L0.84á UNREAL # ł** + ř**##################### *|ř + ř**########3D####### **ř. + ř**############# **ř + ř**######### **ř + ř**##### **ř + ř**# **ř + ř**ř + + ("veloce" file d'aggiornamento) + +La versione UNREAL Š quella con pi— roba (e pi— errori) tra le beta finora +rilasciate. E' UNA VERSIONE DI DEBUG non Š Reale !!!! +Molte cose presenti nelle routines "invisibili" di questa vesione non saranno +presenti in quella finale (ce ne sar… una finale ?) + +Modifiche effettuate su: +- MemoryManager (v1.21): controllo area allocazione (debug); +- 3D_SoundManager (v1.2): introduzione dei suoni SFL_FOLLOW che inseguono il + loro creatore (per ora utilizzati solo nell'oggetto Mouse); in questa + versione provvisoria il suono prosegue anche dopo che l'oggetto creatore + Š stato distrutto. + Modifiche introdotte anche nella routine lookray() per controllo attenua- + zione suoni, nella struttura di memorizzazione e nel processo di determi- + mazione dell'indirizzo; +- 3D-îngine AFTERBURNER ! (Anche se Š pi— veloce Š solo una modifica momen- + tanea) Si pu• notare il flickering (a me solo se /NOSYNC Š attivo) dei + riquadri delle parole chiave; la mappa non funziona bene quando la finestra + di gioco non Š a pieno schermo (ma anche quella mappa Š provvisoria); +- Font: inclusi i moduli di gestione dei fonts; sono possibili font di due + colori variabili e font di sfumature di UN colore che possono variare il + colore di base (sfumatura bianco->nero, rosso, verde, giallo, rosa...); +- nuovi oggetti: Ossa e FlOssa; +- riscritto oggetto Enemy per gestire tutti i mostri (per ora Š cosŤ), + animazioni in fase di debug, le altezze devono essere regolate; +- modificato Mouse (derivto di Enemy) per gestire la collisione con il + Player (QUESTA COSA NON MI PIACE, ho provato a frenare il Player quando + sbatte sul topo, ma Š sempre troppo facile ammazzarlo !); +- doormanager: Š visibile in fase di gioco (!) un numero che indica il + numero di porte aperte; per un errore ancora da determinare UNA porta non + funziona come dovrebbe (non Š l'ultima e nemmeno la prima... strano); + E' UN NUOVO GIOCO! TROVA LA PORTA CHE NON FUNZIONA (senza cheat) ! + (Naturalmente dovrai capire da solo perchŠ non funziona); +- game bar: in attesa di fare un oggetto completo che gestisca anche il + multiplayer... beccati questa; +- nuova parola chiave "ADCAPT" per catturare lo schermo. + E' necessario caricare il CAMERA del DPaint in modalit… "/format=f" e + premere la combinazione di tasti scelta (ALT+C = default) quando il + gioco Š in CAPTURE MODE, altrimenti non funziona; dopo aver premuto un + tasto il gioco prosegue. +- nuova opzione di gico (debug only) "/CRAZY" che permette di vedere delle + porte un p• diverse dal solito... naturalmente l'effetto Š possibile + combinarlo anche con muri e grate, ma non si potr… mai(?) avere una porta + a forma di grata (nessun cancello putroppo); in realt… si pu• ottenere + ugualmente questo effetto producendo una forma propria, anche con gestione + discontinua delle sbarre (3D-îngine non ha limiti cosŤ banali...); +- Object handle_event: gestisce ora EV_BOOM, convertendolo in EV_HIT; + questo permette di gestire le esplosioni in modo direzionale (provare + su Barile o Ossa per credere); +- ecc. + +Animazioni: +- FACE: si squaglia poco... e poi non si capisce bene che quello Š il + cervello (dovresti farglielo schizzare per terra); +- MOUSE: sempre mitico! +- SLIMER: Š colpa mia, devo gestire meglio le altezze... e le collisioni, ma + quello Š un campo ancora da esplorare; +- SPIDER: bello, dinamico, preciso, d'eźźetto ! +- BUB: ú ú úúMůOůS-T-R=U=O=SđAđMđEđNđTđEđđđP=E=R=F-E-TůTůOúú ú ú + Forse dovrei fare un oggetto solo per lui (come per il topo) per gestire + al meglio le animazioni che hai fatto (vedi mitragliatrice); +- e SOLDIER ? (ap = attendere prego). + +Problemi noti: +- cominciano a sentirsi i limiti del MemoryManager v1.X (non Š adatto per + gistire blocchi di dimensioni molto piccole (20 byte) e molto grandi + (30Kb) in un programma che richiede dei dati statici (come questo), ma + ancora regge); il MemoryManager verr… usato anche per l'editor (e lŤ non + avr… nessun problema...); + !!! ancora non Š stato trovato l'intoppo che impedisce di allocare memoria + XMS da Windows95(TM), non che mi interessi usarlo con questo sistema + operativo (...) ma potrebbe evitare problemi di EMM386...; +- sto ancora cercando l'algoritmo giusto per gestire le collisioni ! + Quello vecchio (e non so quale tu abbia visto) permetteva ai mostri di + passare tra 2 muri in diagonale; +- in alcuni casi il Barile non "ascolta" pi— i messaggi di "distruzione" + ad esso rivolti; Š un problema altamente risolvibile, ma palloso, che Š + presente in tutte le versioni di Kaos, di Barboon e di Nic3D (questo + l'avevi mai sentito? No? Beh, era il nome della PRE-alfa). Quasi quasi + lo lascerei per ricordare le vecchie versioni... + ...per vedere il problema usare la mitragliatrice; +- quella maledettissima porta ! +- bisogna reimpostare tutti i valori di "effetto di campo" delle esplosioni + sugli altri oggetti (per esempio il Mouse muore troppo facilmente, anche + dietro ad un muro !); +- Lampadario & ADDARK (ap); +- e gli errori della versione precedente che non sono stati corretti. + +Modifiche su richiesta: +- E' veramente necessario fare oggetti derivati di Enemy (mostri) ? + Ora come ora Š possibile gestire anche diversi comportamenti con un solo + oggetto (Enemy); +- Potrei usare la routine "lookray()" per determinare se un oggetto Š stato + veramente investito dall'onda d'urto di un'esplosione, invece di affidarsi + solo alla distanza (potrebbe essere possibile far esplodere dei barili + dietro un muro); naturalmente la routine "lookray()" estesa a tutti gli + oggetti investiti dall'esplosione rallenterebbe il gioco (non si pu• + stimare la quantit…, dato che possono avvenire reazioni a catena tra + oggetti esplosivi); + +Configurazione migliore per utilizzare KAOS L0.84á: +DOS=HIGH,UMB +DEVICE=...\HIMEM.SYS +DEVICE=...\EMM386 NOEMS +... +non credo sia necessario il KEYB + +Questa versione Š predisposta per bloccare un massimo di 4Mb di XMS ! + +QUASI IMPORTANTE: +- ho rimescolato i suoni perchŠ cosŤ mi sembrano adattati bene: + pistola -> "fucil2.wav" + fucile -> "fucil1.wav" + mitra -> "pist1.wav" (per ora) E' NECESSARIO CAMBIARE QUESTO SUONO !!! + il suono del mitra deve essere molto molto breve !!!!!!! + missile -> "missile.wav" + !WARNING! + Il suono associato allo sparo del missile DEVE in realt… essere + composto da 2 suoni: + - il primo di tipo FIXED che rappresenta il rumore conseguente + alla sparo dal bazuca; + - il secondo che proviene dal missile vero e proprio deve + essere un suono di "combustione" mischiato con vento... + questo suono deve essere abbastanza piccolo (quanto lo + riesci a stringere) perchŠ deve essere ripetuto in modo + continuo (si deve quindi poter attaccare in sequenza); + L'effetto di avvicinamento Š gestito automaticamente dal + 3D-SoundManager che ne regola l'effetto 3D in modo da + seguire costantemente l'oggetto missile (Fireball) mentre + si sposta. + porte -> ??? (usa l'opzione "/CRAZY" per avere un'idea di come funzionano + i possibili passaggi segreti) NOTA: il tempo di apertura di una + porta (di qualsiasi tipo essa sia) Š sempre lo stesso, e quindi + il suono unico va bene ugualmente. + oggetti raccolti -> ??? Diversi per armi, bonus,... + vasi che cadono in pezzi -> ??? + ecc. + +---- ULTIM'ORA ---- +Ho aggiustato qualcosa, aggiunto un p• di altri suoni, notato che l'algoritmo +usato per i muri diagonali non Š molto preciso, che c'Š un errore quando si +aprono le porte centrali, che non ci possono essere suoni SFL_FIXED pro- +venienti da un qualsiasi oggetto (perci• verr… cambiato l'effetto degli +spari...), che non riuscir• mai a capire perchŠ quella fottutissima porta +funziona a membro di segugio, che la syncronizzazione rallenta troppo, che +la mia gestione della memoria XMS (che tra l'altro Š quella delle specifiche +3.0) non riesce a "vedere" la memoria lasciata da Windows95(TM) (questo non +Š un problema locale, pu• significare che esiste un algoritmo pi— generale!), +aumentato volume suoni slimer (troppo), speriam sona bene su SB16, +aggiust lamp. & ADDARK, cerc ancor alg. collis., -i -egge ...-ione, ancor +problem grav, bast m $o rot-bal. :-) + + + ú-=đNicođ=-ú + + + + + + + + + + + + + + + + + se sei arrivato fino a qui significa che vuoi + cambiare veramente nome al gruppo: + + The UnReals üReal Universal + Thundershadow IntelliSoźt Ray + Mirror LightShock + diff --git a/Documentazione/Testi/2nd stage/kaosl86.nic b/Documentazione/Testi/2nd stage/kaosl86.nic new file mode 100644 index 0000000..0a715a0 --- /dev/null +++ b/Documentazione/Testi/2nd stage/kaosl86.nic @@ -0,0 +1,109 @@ + + L'editor di KAOS & KAOS L0.86á + + Leggi il file "EDITOR.WRI" con il Write di Windows (!) + o con il WordPad di Windows95 (!!) + + Non mi sono impazzito, farei lo stesso per OS/2 ! + + PerchŠ ci ostiniamo ad usare un .TXT (.NIC) quando sull'hard + disk c'Š sto po po (anche nel senso "pop•") di mega di Windows + che non si usa mai ? + + ??? + + Che ??? + + !!! + +Mi sono appena accorto che il WordPad di Windows95 NON salva in formato Write +di Windows 3.X ma lo legge solamente e lo converte in quello di Word 6.0 ! +... + ... + ...quindi mi tocca scriverlo nel solito formato. +(potevo metterci le immagini e i suoni, cavolo !) + +In attesa che ti installi Word 6.0 nell'hard disk ti scrivo 'sto .NIC +telegrafico + +- meglio armatura acciaio ma controlla immagine di quando colpito che c'ha + colori strani su cintura-teschio; +- sovrapposizione: c'Š errore che non so se aggiusto subito; +- editor: t'ho messo file maschera video, tu puoi cambiare colori e disegni, + ma devi rispettare i quadrati di delimitazone. + + CioŠ: lo schermo Š diviso in ZONE che hanno un funzionalit… ben precisa. + Si pu• cambiare, per esempio forma/colori/ecc. dei pulsanti sopra, + ma l'area ad essi associata per l'immagine e per il mouse sar… sempre + quella che ho disegnato io. Puoi disegnare sopra i quadrati (fare + pulsanti 3D, oppure un disegnetto come ho fatto io nel riquadro + giallino (che devi cambiare perchŠ Š stato fatto solo come esempio)) + puoi persino dare una sfumatura alla barra di stato inferiore, ma + le misure (vertici) devono essere quelle che ho fatto io per le aree + critiche come quelle al centro dello schermo. + + +Serve: +- suono missile doppiato in 2: sparo & rumore di combustione/vento + te ne ho messo uno che avevo (separato dagli altri) da cui puoi prendere + qualcosa se ti piace; +- il suono che io ho messo per l'apertura della porta Š troppo lungo, deve + essere portato alla durata di quello di chiusura eliminando qualche + onda interna al file e non all'inizio o alla fine; +- Ho fatto l'oggetto per la barra di stato, ma non Š finito e per ora + funziona con un solo giocatore (forse lo finisco mentre scrivo questo + file, perci• vedi quello che esce); +- Ho alzato il numero massimo di suoni contemporanei a 16, ma ho dovuto + mettere un fattore di attenuazione dei suoni che aumenta ogni 4 suoni, + quindi Š possibile che certe volte un suono sembri pi— basso (si vede che + ce ne sono tanti lontani...); questa cosa per• forse la tolgo nella + prossima versione; +- anche a me sembra che l'animazione del SOLDIER sia troppo veloce, ma Š + uguale a quella degli altri mostri... quando divider• completamente gli + oggetti (cioŠ ne far• l'intelligenza) potro decidere le differenze; +- serve un suono pi— cupo (frequenza modificata per effetto "sampling") per + il passo del SOLDIER; + +- se riesci a fare un effetto rimbombo (eco ad attacco molto corto) anche + per i suoni degli spari (come per il passo), allora il gioco diventerebbe + veramente mitico ! (In realt…, una volta trovati i numeri giusti potresti + applicare l'effetto a tutti i suoni 3D del gioco, come Quake); + +- !!!WARNING!!! Bisogna cercare un altro nome al gruppo perchŠ il gruppo + Andromeda gi… esiste (e da molto di pi— di noi) e fa intro & ecc. + NON VOGLIAMO CERTO ESSERE CONFUSI CON LORO ! (o forse Š il contrario ?) + + Nell'attesa di trovare un marchio per il gruppo e uno per il gioco ti + chiedo di scegliere un marchio per il tuo nome, che andr… nella pagina + grafica dei CREDITS... il mio marchio "Rayer" l'ho messo nel file "Balls" + a fianco a quello tuo "Max" che potrebbe andare bene (MA RICORDA DI NON + USARE I PRIMI 16 COLORI DELLA PALETTE !!!! Il risultato finale sar… + ottenuto per "fade in" (contrario di dissolvimento) dei due marchi a + fianco ai rispettivi nomi. + +- ho messo anche l'InfoBar per 2 giocatori (ma fa solo da presenza); + PER POTER SCRIVERE I PUNTEGGI (E TUTTO IL RESTO) MI SERVE UN PO' DI + TEMPO PER SCEGLIERE LA SOLUZIONE MIGLIORE. + +- Hai provato ad usare l'opzione /OPENSB (o qualcosa del genere...) ? + Serve per aprire tutti i canali di input della SoundBlaster durante il + gioco, cosŤ credo che sia possibile ascoltare musiche dal CD (ma solo + se hai un programma che funziona in background), ed Š possibile anche + parlare nel microfono; ho fatto tutto ci• perchŠ se qualcuno vuole + "sentire" anche il gioco (e non solo vedere le immagini statiche" Š + cosŤ possibile creare un nastro (poi riconvertibile in .WAV) con tutti + i suoni del gioco (porte, mostri, passi...) e molto di pi— (commenti del + giocatore, musica CD, musica radio (line in),...); + +- NELLA DIRECTORY LBM troverai anche "editor.lbm", ma ancora non ho + ben studiato tutte le opzioni possibili, quindi modifica tutto quello che + NON riguarda i pulsanti... e ricorda Andromeda NON ESISTE (nel senso che + se ne troviamo una non ancora "presa" Š meglio); + +- Usa l'opzione /NOSYNC, Š tutto pi— veloce ! + +- se trovi un passo metallico lo mettiamo al soldato. + + + + -=đNicođ=- diff --git a/Documentazione/Testi/Il ritorno di KAOS.doc b/Documentazione/Testi/Il ritorno di KAOS.doc new file mode 100644 index 0000000..bb7b17a Binary files /dev/null and b/Documentazione/Testi/Il ritorno di KAOS.doc differ diff --git a/Documentazione/Testi/KAOS_2.NIC b/Documentazione/Testi/KAOS_2.NIC new file mode 100644 index 0000000..17d96a5 --- /dev/null +++ b/Documentazione/Testi/KAOS_2.NIC @@ -0,0 +1,39 @@ + + + The Real KAOS + + 2nd edition + +La maggior parte dei problemi Š stata risolta. Esiste un unico ERRORE +GRAVE non ancora individuato (abbastanza raro), che provoca lo sfonda- +mento delle protezioni di Windows95 sulla memoria (naturalmente in DOS +questo errore non viene bloccato dal sistema operativo). + +* Ho messo il fucile: di grandissimo effetto, belle le sfumature ! + Ottimo l'effetto con il lampo ! + (manca per• il fuoco/fumo da attaccargli sopra per sparare); +* manca l'animazione/fuoco per la pistola; +* manca la mitragliatrice; +* manca il bazuca (o gi- di lŤ); +* ho inserito nel .BDF (e nel gioco) entrambe le immagini dei dragoni + (ma a me piace sempre di pi- quella a sfumature di grigio); +* ho riempito il menu (specialmente le "INFO!", ma mi servono le vostre + vere dichiarazioni e i vostri simboli inattaccabili di riconoscimento !); +* ah! Le nuove cheat cominciano per "MN" e non "AD" ! + (in realt... avrei dovuto usare "MM", ma l'ho compilato cosŤ...); + la mia ora serve solo per la resistenza, mentre la "BGOD" serve per + il God-Mode ("BGOD" = "B" God = Be God = Become God); +* TUTTI I NOMI SONO PROTETTI da un controllo CRC-16; +* in questa versione il MultiPlayer Š attivabile, ma ci sono comunque + delle incongruenze in questa modalit...; +* nella modalit... "NO GAME" (quella iniziale) il menu viene forzato (per + ora); +* manca il suono per la morte dei mostri (oppure ce li ho ma non lo so); +* manca il suono dello "Swissshhhhh" da usare per quando i mostri attaccano + da vicino (Slimer, Spider, Soldier); +* manca il suono del passo metallico (c'Š un programma che "metallicizza" i + suoni .WAV tra quelli che mi avevi dato... forse era "CD-FAMILY" ?) da + utilizzare con il Soldier; +* non si potrebbe rimpicciolire il suono del missile mentre vola ? + (AHH ! Era solo una domanda !) + diff --git a/Documentazione/Testi/Kaos64.nic b/Documentazione/Testi/Kaos64.nic new file mode 100644 index 0000000..7f63341 --- /dev/null +++ b/Documentazione/Testi/Kaos64.nic @@ -0,0 +1,64 @@ + + + KAOS_64 Fire + + +1) Estese le funzioni del CanFireActor: + - Š possibile cambiare l'arma pi— velocemente; + - gli algoritmi di sparo, selezione e cambio automatico dovrebbero + funzionare (in caso contrario il gioco di ferma (nel senso: FREEZE)); +2) Ho fatto un livello "The Castle" (nel file FINAL.DLF, ma non Š n‚ un + livello finale e n‚ un livello per la versione finale... non Š niente !); + [ per usarlo, la solita sintassi: "KAOS /ffinal" ] + NOTA: Questo livello contiene MOLTISSIMI oggetti e ambienti complessi + e pertanto potrebbe rallentare il gioco in certe sue parti. + Non Š ancora finito ! +3) Estese le matrici di contenimento oggetti: + - fino a 640 Objects, di cui un massimo di 400 Actors (oggetti animati); + - fino a 128 Objects disegnabili in una singola finestra; + se il numero Š maggiore vengono "tagliati" quelli pi— a destra, ma + potrebbe essere possibile eliminare quelli pi— lontani, anche se + questo richiederebbe pi— tempo. + NOTA: 128 oggetti contemporaneamente Š qualcosa di impossibile ! +4) Generalizzata l'esplosione del Fireball: potrebbe esplodere troppo + presto (nel senso che l'esplosione viene disegnata molto distante dal + punto di contatto) ... si pu• migliorare... +5) Nuovo algoritmo di "reset di avvistamento"; sfrutta le ultime modifiche + apportate per il playback per eliminare la chiamata agli Actors. + Ora tutti gli oggetti sono indipendenti dal punto di vista del "system". +6) Ho fatto in modo che i teschi che volano non spariscano subito; + corretto errore nel calcolo dell'angolazione e dei rimbalzi. + +** il gioco multiplayer non funziona al 100% (il Player morto Š disegnato + male) + +---- In lavorazione ---- +- Spari direzionati in 3D; +- .MID player (o converter); + +---- Stiamo dimenticando qualcosa ? ---- +- Le immagini del Bazooka; +- La BARRA DI STATO con l'immagine della bomba (anche se non ci sar…); +- Il suono delle ossa calpestate; +- Un suono diverso in CHARGE2 per il caricamento del bazooka (una specie + di caricamento di un cannone...); + +---- Hot Shots ---- +- Mi sono divertito a far rimanere attaccati gli spari ai muri, per avere + l'effetto Duke3D e... siccome gli spari hanno la prima immagine molto + piccola, la distorsione non si nota molto e l'effetto Š quasi reale, anche + se non Š possibile per il 3D-îngine gestire pi— di 15 oggetti sullo stesso + quadrato; +- Nella fase di test ho anche fatto in modo che i teschi non si fermassero + mai e ho notato un bellissimo effetto: + - quando il teschio va contro il Player, rimbalzando d… l'idea di una + partita a Ping Pong... ci• Š molto bello; + - potremmo fare in modo che il mostro Face (faccia) spari delle bombette + che esplodono solo contro gli oggetti e rimbalzano se toccano i muri, + in questo modo si potrebbero fare dei corridoi "da suicidio" ! + Se riesco a sfornare un'efficiente routine di fuoco 3D, potrebbe essere + possibile far rimbalzare queste bombette in tutto lo spazio 3D e + quindi fare in modo che sia utilizzata la visione alto/basso. + + + -=đNicođ=- diff --git a/Documentazione/Testi/Kaos65.nic b/Documentazione/Testi/Kaos65.nic new file mode 100644 index 0000000..fa378ea --- /dev/null +++ b/Documentazione/Testi/Kaos65.nic @@ -0,0 +1,68 @@ + + + + KAOS v0.97 + _____ ______ + ######| |######_ + ###| ###||### |### + _### |### |### + ###| |### |### + __ ###||### |### + ###|_### |###_|### + ###### ###### + + +Finalmente stoKaos ha la routine di sparo 3D ! + +(lo so, Š poco, ma sono preso dal Visual C++) + +-------------------------------- + +Mi manca il nuovo font completo di lettere (tutte), simboli speciali, +simboli di punteggiatura, numeri !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +Mi manca il .MID player (stiamo lavorando per noi...) +Prima o poi, bene o male, io suoner• i .MID [a qualsiasi costo !] +Adesso ho tutte le caratteristiche del MID Player a portata di mano, ma non +RIUSCIRO' MAI ad includere la mappa dell'intero set di strumenti MIDI !!!!! +(Attualmente non ho i numeri per ricostruire nemmeno uno strumento MIDI !) + + +[in realt... dovresti anche cambiare la codepage di Windows95 con il programma + ChangeCP contenuto nel CD-ROM ma non installato... ma questa Š un'altra + storia, per ora ti baster... usare un editor DOS a SCHERMO INTERO] + +MA PRIMA... +Prima di creare il MID Player devo scrivere le routine di compressione +real-time per il Big Data File !!!!!!! + +NOTA: La routine di sparo (e anche quella di "vista" per i mostri) Š stata + modificata, e quindi potrebbe NON funzionare ! + Cose da controllare (confrontandole magari con la versione precedente): + - comportamento dei mostri (specialmente degli Slimer); + - comportamento dei missili: + 1 - colpiscono anche quando c'Š un muro in mezzo ? + 2 - si vede l'esplosione da dietro ad una porta ? + 3 - la collisione avviene troppo vicino all'obiettivo ? + ecc. + +ERRORI GRAVI: +Durante i test ho riscontrato due Errori Gravi che per• potrebbero essere +dovuti ad uno stesso bug: +1 - Quando ci si avvicina troppo ad un oggetto (di solito il sangue, perchŠ + Š attraversabile) Windows95 riporta l'esecuzione di un'istruzione non + valida. +2 - In alcuni casi appare un Divide Error. + +COME EFFETTUARE I TEST SOTTO IL CONTROLLO DI PROTEZIONE DI WINDOWS95: +ho incluso un .PIF (di Kaos) gi... configurato per questo, comunque, in linea +generale, l'unica cosa che serve Š impostare nelle Propriet... del programma +l'opzione di visualizzazione in Finestra; in questo modo Š possibile leggere +l'errore di Divide Error nella parte alta della finestra di Kaos che rimarr... +aperta (non Š molto leggibile... devi farci attenzione !). + + + -=đNicođ=- diff --git a/Documentazione/Testi/Kaos66.doc b/Documentazione/Testi/Kaos66.doc new file mode 100644 index 0000000..16129a8 Binary files /dev/null and b/Documentazione/Testi/Kaos66.doc differ diff --git a/Documentazione/Testi/Kaos68.doc b/Documentazione/Testi/Kaos68.doc new file mode 100644 index 0000000..2b24e0b Binary files /dev/null and b/Documentazione/Testi/Kaos68.doc differ diff --git a/Documentazione/Testi/Kaos69.doc b/Documentazione/Testi/Kaos69.doc new file mode 100644 index 0000000..db1daab Binary files /dev/null and b/Documentazione/Testi/Kaos69.doc differ diff --git a/Documentazione/Testi/Kaos70.doc b/Documentazione/Testi/Kaos70.doc new file mode 100644 index 0000000..91c8a86 Binary files /dev/null and b/Documentazione/Testi/Kaos70.doc differ diff --git a/Documentazione/Testi/Kaos70_.doc b/Documentazione/Testi/Kaos70_.doc new file mode 100644 index 0000000..fe4eab5 Binary files /dev/null and b/Documentazione/Testi/Kaos70_.doc differ diff --git a/Documentazione/Testi/Kaos71.doc b/Documentazione/Testi/Kaos71.doc new file mode 100644 index 0000000..82d1b48 Binary files /dev/null and b/Documentazione/Testi/Kaos71.doc differ diff --git a/Documentazione/Testi/Kaos72.rtf b/Documentazione/Testi/Kaos72.rtf new file mode 100644 index 0000000..b2c0e5f --- /dev/null +++ b/Documentazione/Testi/Kaos72.rtf @@ -0,0 +1,786 @@ +{\rtf1\ansi\ansicpg1252\uc1 \deff11\deflang1033\deflangfe1040{\fonttbl{\f0\froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}{\f1\fswiss\fcharset0\fprq2{\*\panose 020b0604020202020204}Arial;} +{\f2\fmodern\fcharset0\fprq1{\*\panose 02070309020205020404}Courier New;}{\f3\froman\fcharset2\fprq2{\*\panose 05050102010706020507}Symbol;}{\f11\fswiss\fcharset0\fprq2{\*\panose 00000000000000000000}MS Sans Serif;} +{\f16\fnil\fcharset0\fprq2{\*\panose 00000000000000000000}Caligula;}{\f17\fnil\fcharset0\fprq2{\*\panose 00000000000000000000}Aladdin;}}{\colortbl;\red0\green0\blue0;\red0\green0\blue255;\red0\green255\blue255;\red0\green255\blue0;\red255\green0\blue255; +\red255\green0\blue0;\red255\green255\blue0;\red255\green255\blue255;\red0\green0\blue128;\red0\green128\blue128;\red0\green128\blue0;\red128\green0\blue128;\red128\green0\blue0;\red128\green128\blue0;\red128\green128\blue128;\red192\green192\blue192;} +{\stylesheet{\widctlpar\adjustright \f11\fs20 \snext0 Normal;}{\*\cs10 \additive Default Paragraph Font;}}{\*\listtable{\list\listtemplateid-1\listsimple{\listlevel\levelnfc0\leveljc0\levelfollow0\levelstartat0\levelspace0\levelindent0{\leveltext +\'01*;}{\levelnumbers;}}{\listname ;}\listid-2}{\list\listtemplateid1754950988\listsimple{\listlevel\levelnfc0\leveljc0\levelfollow0\levelstartat1\levelold\levelspace0\levelindent283{\leveltext\'02\'00.;}{\levelnumbers\'01;}\fi-283\li283 }{\listname +;}\listid2112698339}}{\*\listoverridetable{\listoverride\listid-2\listoverridecount1{\lfolevel\listoverrideformat{\listlevel\levelnfc23\leveljc0\levelfollow0\levelstartat0\levelold\levelspace0\levelindent360{\leveltext\'02\u-3913 ?\'00;}{\levelnumbers +\'02;}\f3\fbias0 }}\ls1}{\listoverride\listid-2\listoverridecount1{\lfolevel\listoverrideformat{\listlevel\levelnfc23\leveljc0\levelfollow0\levelstartat0\levelold\levelspace0\levelindent360{\leveltext\'02\u-3913 ?\'00;}{\levelnumbers\'02;}\f3\fbias0 }} +\ls2}{\listoverride\listid-2\listoverridecount1{\lfolevel\listoverrideformat{\listlevel\levelnfc23\leveljc0\levelfollow0\levelstartat0\levelold\levelspace0\levelindent360{\leveltext\'02\u-3913 ?\'00;}{\levelnumbers\'02;}\f3\fbias0 }}\ls3} +{\listoverride\listid-2\listoverridecount1{\lfolevel\listoverrideformat{\listlevel\levelnfc23\leveljc0\levelfollow0\levelstartat1\levelold\levelspace0\levelindent283{\leveltext\'01\u-3913 ?;}{\levelnumbers;}\f3\fbias0 \fi-283\li283 }}\ls4} +{\listoverride\listid-2\listoverridecount1{\lfolevel\listoverrideformat{\listlevel\levelnfc23\leveljc0\levelfollow0\levelstartat0\levelold\levelspace0\levelindent360{\leveltext\'02\u-3913 ?\'00;}{\levelnumbers\'02;}\f3\fbias0 }}\ls5} +{\listoverride\listid-2\listoverridecount1{\lfolevel\listoverrideformat{\listlevel\levelnfc23\leveljc0\levelfollow0\levelstartat0\levelold\levelspace0\levelindent360{\leveltext\'02\u-3913 ?\'00;}{\levelnumbers\'02;}\f3\fbias0 }}\ls6} +{\listoverride\listid-2\listoverridecount1{\lfolevel\listoverrideformat{\listlevel\levelnfc23\leveljc0\levelfollow0\levelstartat0\levelold\levelspace0\levelindent360{\leveltext\'02\u-3913 ?\'00;}{\levelnumbers\'02;}\f3\fbias0 }}\ls7} +{\listoverride\listid-2\listoverridecount1{\lfolevel\listoverrideformat{\listlevel\levelnfc23\leveljc0\levelfollow0\levelstartat0\levelold\levelspace0\levelindent360{\leveltext\'02\u-3913 ?\'00;}{\levelnumbers\'02;}\f3\fbias0 }}\ls8} +{\listoverride\listid-2\listoverridecount1{\lfolevel\listoverrideformat{\listlevel\levelnfc23\leveljc0\levelfollow0\levelstartat0\levelold\levelspace0\levelindent360{\leveltext\'02\u-3913 ?\'00;}{\levelnumbers\'02;}\f3\fbias0 }}\ls9} +{\listoverride\listid-2\listoverridecount1{\lfolevel\listoverrideformat{\listlevel\levelnfc23\leveljc0\levelfollow0\levelstartat0\levelold\levelspace0\levelindent360{\leveltext\'02\u-3913 ?\'00;}{\levelnumbers\'02;}\f3\fbias0 }}\ls10} +{\listoverride\listid-2\listoverridecount1{\lfolevel\listoverrideformat{\listlevel\levelnfc23\leveljc0\levelfollow0\levelstartat0\levelold\levelspace0\levelindent360{\leveltext\'02\u-3913 ?\'00;}{\levelnumbers\'02;}\f3\fbias0 }}\ls11} +{\listoverride\listid-2\listoverridecount1{\lfolevel\listoverrideformat{\listlevel\levelnfc23\leveljc0\levelfollow0\levelstartat0\levelold\levelspace0\levelindent360{\leveltext\'02\u-3913 ?\'00;}{\levelnumbers\'02;}\f3\fbias0 }}\ls12} +{\listoverride\listid-2\listoverridecount1{\lfolevel\listoverrideformat{\listlevel\levelnfc23\leveljc0\levelfollow0\levelstartat0\levelold\levelspace0\levelindent360{\leveltext\'02\u-3913 ?\'00;}{\levelnumbers\'02;}\f3\fbias0 }}\ls13} +{\listoverride\listid-2\listoverridecount1{\lfolevel\listoverrideformat{\listlevel\levelnfc23\leveljc0\levelfollow0\levelstartat0\levelold\levelspace0\levelindent360{\leveltext\'02\u-3913 ?\'00;}{\levelnumbers\'02;}\f3\fbias0 }}\ls14} +{\listoverride\listid-2\listoverridecount1{\lfolevel\listoverrideformat{\listlevel\levelnfc23\leveljc0\levelfollow0\levelstartat0\levelold\levelspace0\levelindent360{\leveltext\'02\u-3913 ?\'00;}{\levelnumbers\'02;}\f3\fbias0 }}\ls15} +{\listoverride\listid-2\listoverridecount1{\lfolevel\listoverrideformat{\listlevel\levelnfc23\leveljc0\levelfollow0\levelstartat0\levelold\levelspace0\levelindent360{\leveltext\'02\u-3913 ?\'00;}{\levelnumbers\'02;}\f3\fbias0 }}\ls16} +{\listoverride\listid-2\listoverridecount1{\lfolevel\listoverrideformat{\listlevel\levelnfc23\leveljc0\levelfollow0\levelstartat0\levelold\levelspace0\levelindent360{\leveltext\'02\u-3913 ?\'00;}{\levelnumbers\'02;}\f3\fbias0 }}\ls17} +{\listoverride\listid-2\listoverridecount1{\lfolevel\listoverrideformat{\listlevel\levelnfc23\leveljc0\levelfollow0\levelstartat0\levelold\levelspace0\levelindent360{\leveltext\'02\u-3913 ?\'00;}{\levelnumbers\'02;}\f3\fbias0 }}\ls18} +{\listoverride\listid-2\listoverridecount1{\lfolevel\listoverrideformat{\listlevel\levelnfc23\leveljc0\levelfollow0\levelstartat0\levelold\levelspace0\levelindent360{\leveltext\'02\u-3913 ?\'00;}{\levelnumbers\'02;}\f3\fbias0 }}\ls19} +{\listoverride\listid-2\listoverridecount1{\lfolevel\listoverrideformat{\listlevel\levelnfc23\leveljc0\levelfollow0\levelstartat0\levelold\levelspace0\levelindent360{\leveltext\'02\u-3913 ?\'00;}{\levelnumbers\'02;}\f3\fbias0 }}\ls20} +{\listoverride\listid-2\listoverridecount1{\lfolevel\listoverrideformat{\listlevel\levelnfc23\leveljc0\levelfollow0\levelstartat0\levelold\levelspace0\levelindent360{\leveltext\'02\u-3913 ?\'00;}{\levelnumbers\'02;}\f3\fbias0 }}\ls21} +{\listoverride\listid2112698339\listoverridecount0\ls22}}{\info{\title Kaos71 - The Klonation}{\subject News about KAOS}{\author Nico}{\keywords KAOS}{\doccomm in lavorazione da gioved\'ec 14 agosto 1997}{\operator Njc}{\creatim\yr1998\mo6\dy9\hr19\min25} +{\revtim\yr2002\mo4\dy21\hr19\min24}{\version3}{\edmins15}{\nofpages7}{\nofwords3400}{\nofchars19384}{\*\manager Njc}{\*\company Njc Stuff Corp.}{\*\category Programmers Information File}{\nofcharsws0}{\vern89}}\margl1134\margr1134\margt1417\margb1134 +\widowctrl\ftnbj\aendnotes\aftnstart0\hyphhotz0\makebackup\aftnnar\hyphcaps0\viewkind1\viewscale100 \fet0\sectd \linex0\headery709\footery709\colsx709\endnhere\sectdefaultcl {\*\pnseclvl1\pnucrm\pnstart1\pnindent720\pnhang{\pntxta .}}{\*\pnseclvl2 +\pnucltr\pnstart1\pnindent720\pnhang{\pntxta .}}{\*\pnseclvl3\pndec\pnstart1\pnindent720\pnhang{\pntxta .}}{\*\pnseclvl4\pnlcltr\pnstart1\pnindent720\pnhang{\pntxta )}}{\*\pnseclvl5\pndec\pnstart1\pnindent720\pnhang{\pntxtb (}{\pntxta )}}{\*\pnseclvl6 +\pnlcltr\pnstart1\pnindent720\pnhang{\pntxtb (}{\pntxta )}}{\*\pnseclvl7\pnlcrm\pnstart1\pnindent720\pnhang{\pntxtb (}{\pntxta )}}{\*\pnseclvl8\pnlcltr\pnstart1\pnindent720\pnhang{\pntxtb (}{\pntxta )}}{\*\pnseclvl9\pnlcrm\pnstart1\pnindent720\pnhang +{\pntxtb (}{\pntxta )}}\pard\plain \widctlpar\adjustright \f11\fs20 {\f0\lang1040 in lavorazione da luned\'ec 16 febbraio 1998 in parallelo +\par +\par }\pard \qc\widctlpar\adjustright {\b\f0\fs36\lang1040 KAOS }{\b\i\f0\fs36\cf15\lang1040 71}{\b\f0\fs36\cf1\lang1040 {\field{\*\fldinst SYMBOL 174 \\f "Symbol" \\s 18}{\fldrslt\f3\fs36}}}{\b\i\f0\fs36\cf15\lang1040 72 }{\b\i\f0\fs32\cf12\lang1040 +}{ +\b\i\f0\fs36\cf12\lang1040 editor}{\b\i\f0\fs28\cf13\lang1040 +\par }{\f1\cf14\lang1040 \'a91998 The Millennium Group +\par +\par }{\f0\fs36\cf14\lang1040 +\par }\pard \qc\widctlpar\pvpara\phpg\posx10659\posy92\dxfrtext141\dfrmtxtx141\dfrmtxty0\adjustright {\f0\cf14\lang1040 {\*\shppict{\pict{\*\picprop\shplid1025{\sp{\sn shapeType}{\sv 75}}{\sp{\sn fFlipH}{\sv 0}} +{\sp{\sn fFlipV}{\sv 0}}{\sp{\sn fillColor}{\sv 268435473}}{\sp{\sn fFilled}{\sv 0}}{\sp{\sn fLine}{\sv 0}}}\picscalex100\picscaley100\piccropl0\piccropr0\piccropt0\piccropb0 +\picw1693\pich1693\picwgoal960\pichgoal960\pngblip\bliptag-778379331{\*\blipuid d19adfbd3b029d32d7ff74e86f1281ad}89504e470d0a1a0a0000000d49484452000000400000004008030000009db781ec0000000467414d410000b1889598f4a600000300504c544500000000003300 +00660000990000cc0000ff3300003300333300663300993300cc3300ff6600006600336600666600996600cc6600ff9900009900339900669900999900cc9900 +ffcc0000cc0033cc0066cc0099cc00cccc00ffff0000ff0033ff0066ff0099ff00ccff00ff0033000033330033660033990033cc0033ff333300333333333366 +3333993333cc3333ff6633006633336633666633996633cc6633ff9933009933339933669933999933cc9933ffcc3300cc3333cc3366cc3399cc33cccc33ffff +3300ff3333ff3366ff3399ff33ccff33ff0066000066330066660066990066cc0066ff3366003366333366663366993366cc3366ff6666006666336666666666 +996666cc6666ff9966009966339966669966999966cc9966ffcc6600cc6633cc6666cc6699cc66cccc66ffff6600ff6633ff6666ff6699ff66ccff66ff009900 +0099330099660099990099cc0099ff3399003399333399663399993399cc3399ff6699006699336699666699996699cc6699ff99990099993399996699999999 +99cc9999ffcc9900cc9933cc9966cc9999cc99cccc99ffff9900ff9933ff9966ff9999ff99ccff99ff00cc0000cc3300cc6600cc9900cccc00ccff33cc0033cc +3333cc6633cc9933cccc33ccff66cc0066cc3366cc6666cc9966cccc66ccff99cc0099cc3399cc6699cc9999cccc99ccffcccc00cccc33cccc66cccc99cccccc +ccccffffcc00ffcc33ffcc66ffcc99ffccccffccff00ff0000ff3300ff6600ff9900ffcc00ffff33ff0033ff3333ff6633ff9933ffcc33ffff66ff0066ff3366 +ff6666ff9966ffcc66ffff99ff0099ff3399ff6699ff9999ffcc99ffffccff00ccff33ccff66ccff99ccffccccffffffff00ffff33ffff66ffff99ffffccffff +ff000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000166b6431000000 +097048597300000ec400000ec401952b0e1b0000023e49444154789c95976bb2c3200885b372d6c37af893eddc4601791cd25e67d249aae713147c5cf7582894 +b9d5f55dbc8bc8ef00a4dee527c01105007f0a465440ee955391057907a8d8fa3b5a7b6f84abeb9991de3e3f9e8d009af46c83f879adb37a413d67ff8fdeda20 +40d4f3d4ff32e1f9ab037ed55ba980a44f00c10002803e6993014fe30cf89ffe437027aeaeffc501f161b8909eccccf52b4f5678bfdac4870101b6723d4b2db4 +99c9495113ae14c05ae900d980833c7a52131ae061378024bd053a29a019d00159af809d14179a420588018a5ea72602629d0fa018c0fea1a45f263c0010430d +a00c6a00da0006008f0017360bb80362c8e1104c350d009631a02f001a00b30109401180f400712a9eaa0200fa061a01a111d203006717be00800b03c0f645f1 +97f5c369cf7801e434f405e1ac081320184008c0942359b71900d86b4a079c9484001fa798c7d085b0a040800ea28ac5bed8077106f48942b378b6ee0db80100 +107800dc18d04140bfca59915ef3ae01fcc301d580734e821e689be5c28d0025682bc03a09cb3a027cd71f0055c087797249d0e64f0eb811e0794e20720ee3a0 +df006ec501a4b6d494a508b839f4e080b0b1f68dc3f50e48db4b06101f17a2fd0150ce68c17f1dbee841d6c74356dbc0c7180afae19c3800f43bea0b80fe6dc0 +7cd49db328e9e1615b667d75001df765d033d4830bc7048806dc18605981cf062216da49522f5db9bbeffa76edd3e63dbf4c5e6fc1fde26988921d8cba87004578121809cadf2fdf05805b0e8005398097ebff1f27043c68c5e78ac50000000049454e44ae426082}}{\nonshppict +{\pict\picscalex100\picscaley100\piccropl0\piccropr0\piccropt0\piccropb0\picw1693\pich1693\picwgoal960\pichgoal960\wmetafile8\bliptag-778379331\blipupi96{\*\blipuid d19adfbd3b029d32d7ff74e86f1281ad} +010009000003f40900000000d209000000000400000003010800050000000b0200000000050000000c02400040000400000007010400d2090000430f2000cc00 +000040004000000000004000400000000000280000004000000040000000010008000000000000100000c40e0000c40e0000d8000000d8000000000000003300 +00006600000099000000cc000000ff00000000003300330033006600330099003300cc003300ff00330000006600330066006600660099006600cc006600ff00 +660000009900330099006600990099009900cc009900ff0099000000cc003300cc006600cc009900cc00cc00cc00ff00cc000000ff003300ff006600ff009900 +ff00cc00ff00ff00ff0000330000333300006633000099330000cc330000ff33000000333300333333006633330099333300cc333300ff333300003366003333 +66006633660099336600cc336600ff33660000339900333399006633990099339900cc339900ff3399000033cc003333cc006633cc009933cc00cc33cc00ff33 +cc000033ff003333ff006633ff009933ff00cc33ff00ff33ff0000660000336600006666000099660000cc660000ff6600000066330033663300666633009966 +3300cc663300ff66330000666600336666006666660099666600cc666600ff66660000669900336699006666990099669900cc669900ff6699000066cc003366 +cc006666cc009966cc00cc66cc00ff66cc000066ff003366ff006666ff009966ff00cc66ff00ff66ff0000990000339900006699000099990000cc990000ff99 +000000993300339933006699330099993300cc993300ff99330000996600339966006699660099996600cc996600ff9966000099990033999900669999009999 +9900cc999900ff9999000099cc003399cc006699cc009999cc00cc99cc00ff99cc000099ff003399ff006699ff009999ff00cc99ff00ff99ff0000cc000033cc +000066cc000099cc0000cccc0000ffcc000000cc330033cc330066cc330099cc3300cccc3300ffcc330000cc660033cc660066cc660099cc6600cccc6600ffcc +660000cc990033cc990066cc990099cc9900cccc9900ffcc990000cccc0033cccc0066cccc0099cccc00cccccc00ffcccc0000ccff0033ccff0066ccff0099cc +ff00ccccff00ffccff0000ff000033ff000066ff000099ff0000ccff0000ffff000000ff330033ff330066ff330099ff3300ccff3300ffff330000ff660033ff +660066ff660099ff6600ccff6600ffff660000ff990033ff990066ff990099ff9900ccff9900ffff990000ffcc0033ffcc0066ffcc0099ffcc00ccffcc00ffff +cc0000ffff0033ffff0066ffff0099ffff00ccffff00ffffff00d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d77ea8a8a87e7e7e7e7e7e7e7e +d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d77e7e7e7e7ea8a8a87e7e7e7e7e7e7ea8 +a8a8a87ed7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7a8a8a8a8a87e7e7ea8a8a87e7e7e7e7e7e7ea8 +a8a8a87e7e7e7ed7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7a8a8a8a8a8a8a87e7e7e7ea8a8a8a8a8a8a8a8a8a8 +a8a8a8d27e7e7e7e7ed7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7a8a8a8a8a8a8a87ea8a8a8a8a8a8a8a8a8a8a8a8a8a8a8 +a8a8d2d2d27e7e7e7e7e7ed7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d77ea8a8a8a8a8a8a8d2d2d2d2d2a8a8a8a8a8a8a8a8a8a8a8 +a8a8d2d2d2d2d27e7e7e7e7ed7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d77e7e7e7ed2d2a8a8d2d2d2d2d2d2d2a8a8a8a8a8a8a8a8a8a8 +a8a8a8d2d2d2d2d27e7e7e7e7ed7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d77e7e7e7e7e7ed2d2d2d2d2d2d2d2d2d2d2d2d2a8a8a8a8a8a8a8a8 +a8a8a8d2d2d2d2d2a8a87e7e7e7e7ed7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d77e7e7e7e7e7ea8d2d2d2d2d2d2d2d2d2d2d2d2d2a8a8a8a8a8a8a8a8 +a8a8a8a8d2d2d2d2a8a87e7e7e7e7e7ed7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d77e7e7e7e7e7ea8a8a8a8d2d2d2d2d2d2d2d2d2d2d2d2a8a8a8a8a8a8a8 +a8a8a8a8d2d2d2d2d2a8a87e7e7e7e7e7ed7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d77e7e7e7e7e7ea8a8a8a8a8a8a8d2d2d2d2d2d2d2d2d2d2d2a8a8a8a8a8a8 +a8a8a8a8a8d2d2d2d2a8a8a87e7e7e7e7e7ed7d7d7d7d7d7d7d7d7d7d7d7d7d7d77e7e7e7e7e7e7ea8a8a8a8a8a8a8d2d2d2d2d2d2d2d2d2d2d2a8a8a8a8a8a8 +a8a8a8a8a8a8d2d2d2d2a8a8a87e7e7e7e7e7ed7d7d7d7d7d7d7d7d7d7d7d7d7d77e7e7e7e7e7ea8a8a8a8a8a8a8a8a8d2d2d2d2d2d2d2d2d2d2d2a8a8a8a8a8 +a8a8a8a8a8a8d2d2d2d2d2a8a87e7e7e7e7e7ed7d7d7d7d7d7d7d7d7d7d7d7d77e7e7e7e7ea8a8a8a8a8a8a8a8a8a8a8d2d2d2d2d2d2d2d2d2d2d2a8a8a8a8a8 +a8a8a8a8a8a8a8d2d2d2d2a8a8a87e7e7e7e7e7ed7d7d7d7d7d7d7d7d7d7d77e7e7e7e7e7ea8a8a8a8a8a8a8a8a8a8a87ed2d2d27ed2d2d2d27e7e7ea8a8a87e +7e7ea8a8a8a8a8a8d2d2d2a8a8a87e7e7e7e7e7e7ed7d7d7d7d7d7d7d7d7a8a8a87e7e7ea8a8a8a8a8a8a8a8a8a8a8a87ea8a8d27ed2d2d27ed2d2d27ea87ea8 +a8a87ea8a8a8a8a8d2d2d2a8a8a8a87e7e7e7e7e7e7ed7d7d7d7d7d7d7d7a8a8a8a87ea8a8a8a8a8a8a8a8a8a8a8a8a87ea8a8d27ed2d2d27ed2d2d2a8a87ea8 +a8a8a8a8a8a8a8a8a8d2d2d2a8a8a87e7e7e7e7e7e7ed7d7d7d7d7d7d77ea8a8a8a8a8a8a8a8a8a8a8a8a8a8a8a8a8a87ea8a8a87ed2d2d27e7e7e7e7ea87e7e +7e7e7ea8a8a8a8a8a8d2d2d2d2a8a8a87e7e7e7e7e7e7ed7d7d7d7d7d77e7e7e7ed2d2d2a8a8a8a8a8a8a8a8a8a8a8a87ea8a8a87ed2d2d27ed2d2d27ed27ea8 +a8a87ea8a8a8a8a8a8a8d2d2d2d2a8a8a8a87e7e7e7e7ed7d7d7d7d77e7e7e7e7ed2d2d2a8a8a8a8a8a8a8a8a8a8a8a87e7e7ea87e7e7ed2d27e7e7ed2d2d27e +7e7ea8a8a8a8a8a8a8a8a8d2d2d2a8a8a8a8a87e7e7e7e7ed7d7d7d77e7e7e7ea8d2d2d2a8a8a8a8a8a8a8a8a8a8a8a87ea8a8a8a8d2d2d2d2d2d2d2d2d2d2a8 +a8a8a8a8a8a8a8a8a8a8a8d2d2d2a8a8a8a8a8a87e7e7e7ed7d7d7d77e7e7ea8a8d2d2d2a8a8a8a8a8a8a8a8a8a8a8a87ea8a8a8a8a8d2d2d2d2d2d2d2d2d2d2 +a8a8a8a8a8a8a8a8a8a8a8a8d2d2d2a8a8a8a8a8a87e7e7ed7d7d77e7e7e7ea8a8d2d2d2a8a8a8a8a8a8a8a8a8a8a8a8a87e7ea8a8a8d2d2d2d2d2d2d2d2d2d2 +a8a8a8a8a8a8a8a8a8a8a8a8d2d2d2d2a8a8a8a8a87e7e7e7ed7d77e7e7e7ea8a8a8d2d2a8a8a8a8a8a8a8a8a8a8a8a8a8a8a8a8a8a8a8d2d2d2d2d2d2d2d2d2 +d2a8a8a8a8a8a8a8a8a8a8a8d2d2d2d2a8a8a8a8a8a8a8a8a8d7d77e7e7ea8a8a8a8d2d2d2a8a8a8a8a8a8a8a8a8a8a8a8a8a8a8a8a8a8d2d2d2d2d2d2d2d2d2 +d2a8a8a8a8a8a8a8a8a8a8a8d2d2d2d2d2a8a8a8a8a8a8a8a8d7d77e7e7ea8a8a8a8d2d2d2a8a8a8a8a8a8a8a8a8a8d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2 +d2a8a8a8a8a8a8a8a8a8a8a8a8d2d2d2d2d2a8a8a87e7e7e7ed77e7e7e7ea8a8a8a8d2d2d2a8a8a8a8a8a8a8a8a8d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2 +d2d2a8a8a8a8a8a8a8a8a8a8a8d2d2d2d2d2a8a8a87e7e7e7e7e7e7e7e7ea8a8a8a8d2d2d2d2a8a8a8a8a8a87e7e7ed2d27ed2d2d27ed2d2d2d27e7e7ed2d27e +d2d2a8a87e7e7ea8a8a8a8a8a8a8d2d2d2d2d2a8a87e7e7e7e7e7e7e7e7ea8a8a8a8d2d2d2d2a8a8a8a8a87ea8a8d27ed27ed2d2d27ed2d2d27ed2d2d27ed27e +d2d2d27ea8a8a87ea8a8a8a8a8a8d2d2d2d2d2a8a87e7e7e7e7e7e7e7e7ea8a8a8a8a8d2d2d2d2a8a8a8a87ea8a8d2d2d27ed2d2d27ed2d2d27ed2d2d27ed27e +d2d2d2a8a8a87ea8a8a8a8a8a8a8d2d2d2d2d2d2a8a87e7e7e7e7e7e7e7ea8a8a8a8a8d2d2d2d2a8a8a8a87e7e7e7e7ed27ed2d2d27ed2d2d27ed2d2d27ed27e +d2d2d2a87e7ea8a8a8a8a8a8d2d2d2d2d2d2d2d2a8a87e7e7e7e7e7e7e7ea8a8a8a8a8a8d2d2d2d2a8a8a87ea8a8a87ed27ed2d2d27ed2d2d27ed2d2d27ed27e +d2d2d27ea8a8a87ea8a8a8a8d2d2d2d2d2d2d2d2d2a8a87e7e7e7e7e7e7ea8a8a8a8a8a8d2d2d2d2a8a8a8a87e7e7ed2d27e7e7ed27e7e7ed2d27e7e7ed2d27e +7e7ed2a87e7e7ea8a8a8a8a8d2d2d2d2d2d2d2d2d2a8a87e7e7e7e7e7e7ea8a8a8a8a8a8d2d2d2d2a8a8a8a8a8a8a8d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2 +d2d2d2a8a8a8a8a8a8a8a8a8d2d2d2d2d2d2d2d2d2a8a87e7e7e7e7e7e7ea8a8a8a8a8a8d2d2d2d2a8a8a8a8a8a8a8d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2 +d2d2d2d2a8a8a8a8a8a8a8a8d2d2d2d2d2d2d2d2d2a8a87e7e7e7e7e7e7ea8a8a8a8a8a8a8d2d2d2a8a8a8a8a8a8a8a8d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2 +d2d2d2d2a8a8a8a8a8a8a8a8d2d2d2d2d2d2d2d2d2a8d2a8a8a87e7e7e7ea8a8a8a8a8a8a8d2d2d2d2a8a8a8a8a8a8a8a8d2d2d2d2d2d2d2d2d2d2d2a8a8a8a8 +a8a8a8a8a8a8a8a8a8a8a8a8d2d2d2d2d2d2d2d2d2a8d2a8a8a87e7e7e7ea8a8a8a8a8a8a8a8d2d2d2d2a8a8a8a8a8a8a8a8d2d2d2d2d2d2d2d2a8a8a8a8a8a8 +a8a8a8a8a8a8a8a8a8a8a8a8a8d2d2d2d2d2d2d2d2a87e7e7e7ed77e7e7ea8a8a8a8a8a8a8a8d2d2d2d2a8a8a8a8a8a8a8a8a8d2d2d2d2d2d2d2a8a8a8a8a8a8 +a8a8a8a8a8a8a8a8a8a8a8a8a8d2d2d2d2d2d2d2d2a87e7e7ed7d77e7e7ea8a8a8a8a8a8a8a8a8d2d2d2d2a8a8a8a8a8a8a8a8d2d2d2d2d2d2d2d2a8a8a8a8a8 +a8a8a8a8a8a8a8a8a8a8a8a8a8d2d2d2d2d2d2d2d2a87e7e7ed7d77e7e7ea8a8a8a8a8a8a8a8a8a8d2d2d2a8a8a87ea8a8a8a87e7e7ed2d2d27e7e7ea8a87ea8 +a8a8a8a87e7ea8a8a8a8a8a8a8d2d2d2d2d2d2d2a8a87e7e7ed7d77e7e7e7ea8a8a8a8a8a8a8a8a8d2d2d2a8a8a87ea8a8a87ea8d2d27ed27ed2d2d27ea8a87e +a8a8a87ea8a87ea8a8a8a8a8a8d2d2d2d2d2d2d2a87e7e7e7ed7d7d77e7e7ea8a8a8a8a8a8a8a8a8a8d2d2a8a8a87ea8a8a87ea8d2d27ed27ed2d2d27ea8a8a8 +7ea8a8a87e7ea8a8a8a8a8a8a8d2d2d2d2d2d2d2a87e7e7ed7d7d7d77e7e7e7ea8a8a8a8a8a8a8a8a8d2d2d2a8a87ea8a8a87ea8a8d27ed27ed2d2d27ed2a8a8 +a87ea8a8a8a8a8a8a8a8a8a8a8a8d2d2d2d2d2d27e7e7e7ed7d7d7d77e7e7e7e7ea8a8a8a8a8a8a8a8a8d2d2d2a87ea8a8a87ea8a8a87ed27ed2d2d27ed2d2a8 +a8a87ea8a8a8a8a8a8a8a8a8a8a8d2d2d2d2d2a87e7e7e7ed7d7d7d7d77e7e7e7e7ea8a8a8a8a8a8a8a8d2d2d2a87ea8a8a87ea8a8a87ed27ed2d2d27ed2d2d2 +a8a8a87ea8a8a8a8a8a8a8a8a8a8d2d2d2d2d2a8a87e7ed7d7d7d7d7d77e7e7e7e7ea8a8a8a8a8a8a8a8a8d2d2d27ea8a8a87ea8a8a87ed27ed2d2d27ed2d27e +7ea8a8a87ea8a8a8a8a8a8a8a8a8d2d2d2d27ea8a8a87ed7d7d7d7d7d7d77e7e7e7ea8a8a8a8a8a8a8a8a8a8d27e7ea8a8a87ea8a8a87ea87ed2d2d27ed27ed2 +d27ea8a8a87ea8a8a8a8a8a8a8a8a8d2d2d2d2a8a8a8d7d7d7d7d7d7d7d77e7e7e7ea8a8a8a8a8a8a8a8a8a8d2d27ea8a8a8a87e7e7ea8a8a87e7e7ed2d2d27e +7ea8a8a8a8a87ea8a8a8a8a8a8a8a8d2d2a8a8a8a87ed7d7d7d7d7d7d7d7d77e7e7e7ea8a8a8a8a8a8a8a8a8a8d2d2d2a8a8a8a8a8a8a8a8a8d2d2d2d2d2d2d2 +d2d2a8a8a8a8a8a8a8a8a8a8a8a8a8a8d2a8a8a8a8d7d7d7d7d7d7d7d7d7d7d77e7e7e7ea8a8a8a8a8a8a8a8a8d2d2d2a8a8a8a8a8a8a8a8a8a8d2d2d2d2d2d2 +d2d2a8a8a8a8a8a8a8a8a8a8a8a8a8a87ea8a8a8d7d7d7d7d7d7d7d7d7d7d7d7d77e7e7e7ea8a8a8a8a8a8a8a8a8d2d2d2a8a8a8a8a8a8a8a8a8a8d2d2d2d2d2 +d2d2d2a8a8a8a8a8a8a8a8a8a8a8a87e7e7ea8d7d7d7d7d7d7d7d7d7d7d7d7d7d77e7e7e7e7e7ea8a8a8a8a8a8a8a8d2d2d2a8a8a8a8a8a8a8a8a8d2d2d2d2d2 +d2d2d2d2a8a8a8a8a8a8a8a8a8a8a8a8a8a87ed7d7d7d7d7d7d7d7d7d7d7d7d7d7d77e7e7e7e7e7ea8a8a8a8a8a8a8d2d2d2a8a8a8a8a8a8a8a8a8a8d2d2d2d2 +d2d2d2d2a8a8a8a8a8a8a8a8a8a8a8a8a8a8d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d77e7e7e7e7e7ea8a8a8a8a8a8a8d2d2d2a8a8a8a8a8a8a8a8a8a8d2d2d2 +d2d2d2d2d2a8a8a8a8a8a87e7ea8a8a8d2d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d77e7e7e7e7e7ea8a8a8a8a8a8d2d2d2a8a8a8a8a8a8a8a8a8a8a8d2d2 +d2d2d2d2d2d2a8a87e7e7e7e7e7ea8a8d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d77e7e7e7e7e7ea8a8a8a8a8d2d2d2d2d2a8a8a8a8a8a8a8a8a8a8d2 +d2d2d2d2d2d2d2a8a8a87e7e7e7e7ed7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d77e7e7e7e7ea8a8a8a8a8d2d2d2d2d2a8a8a8a8a8a8a8a8a8d2 +d2d2d2d2d2a8a8a8a8a8d2d27ed7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d77e7e7e7e7e7e7ea8a8a8d2d2d2d2d2a8a8a8a8a8a8a8a8a8 +d2d2d2a8a8a8a8a8a8d2d2d2d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d77e7e7e7e7e7e7e7e7e7ed2d2d2d2a8a8a8a8a8a8a8a8a8 +a8a8a8a8a8d2a8a8d2d2d2d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d77e7e7e7e7e7e7e7ed2d27e7e7e7e7e7e7e7e7e7ed2 +a8a8a8a8d2d2d2d2d2d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d77e7e7e7e7e7e7e7e7e7e7e7e7e7e7e7e7e7ed2 +d2d2d2d2d2d2d2d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d77e7e7e7e7e7e7e7e7e7e7e7e7e7e7e7e +7e7ed2d2d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d77e7e7e7e7e7e7e7e7e7e7e7ed7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d70400000007010100030000000000}}}{\f0\fs36\cf14\lang1040 +\par }\pard \qc\widctlpar\adjustright {\f16\fs72\lang1040 Klonation to The Best +\par }{\f16\fs40\cf16\lang1040 without errors\~! +\par }{\f16\fs56\lang1040 {\field{\*\fldinst SYMBOL 175 \\f "Symbol" \\s 28}{\fldrslt\f3\fs56}}}{\f16\fs72\lang1040 +\par }{\f17\fs72\lang1040 Lord of the rings version +\par }{\f16\fs52\cf13\lang1040 Top Speed\~!}{\f16\fs52\lang1040 \rdblquote \rdblquote \rdblquote \rdblquote \rdblquote \rdblquote +\par }{\f1\lang1040 +\par }{\b\f1\lang1040 Dopo la scoperta del pi\'f9 grave problema di KAOS, la rinascita del nuovo KAOS, +\par l\rquote innalzamento ai gradi massimi e la conquista del Marchio; la ricaduta, l\rquote invenzione galattica e la generazione della versione Top Speed. +\par +\par }{\b\f1\lang1040 {\*\shppict{\pict{\*\picprop\shplid1026{\sp{\sn shapeType}{\sv 75}}{\sp{\sn fFlipH}{\sv 0}}{\sp{\sn fFlipV}{\sv 0}}{\sp{\sn fillColor}{\sv 268435473}}{\sp{\sn fFilled}{\sv 0}}{\sp{\sn fLine}{\sv 0}}} +\picscalex65\picscaley61\piccropl0\piccropr0\piccropt0\piccropb0\picw1270\pich1270\picwgoal720\pichgoal720\pngblip\bliptag279887337{\*\blipuid 10aebde9a4d1e28d6e49734c6dd1288c} +89504e470d0a1a0a0000000d494844520000003000000030080300000060dc09b50000000467414d410000b1889598f4a600000300504c544500000000003300 +00660000990000cc0000ff3300003300333300663300993300cc3300ff6600006600336600666600996600cc6600ff9900009900339900669900999900cc9900 +ffcc0000cc0033cc0066cc0099cc00cccc00ffff0000ff0033ff0066ff0099ff00ccff00ff0033000033330033660033990033cc0033ff333300333333333366 +3333993333cc3333ff6633006633336633666633996633cc6633ff9933009933339933669933999933cc9933ffcc3300cc3333cc3366cc3399cc33cccc33ffff +3300ff3333ff3366ff3399ff33ccff33ff0066000066330066660066990066cc0066ff3366003366333366663366993366cc3366ff6666006666336666666666 +996666cc6666ff9966009966339966669966999966cc9966ffcc6600cc6633cc6666cc6699cc66cccc66ffff6600ff6633ff6666ff6699ff66ccff66ff009900 +0099330099660099990099cc0099ff3399003399333399663399993399cc3399ff6699006699336699666699996699cc6699ff99990099993399996699999999 +99cc9999ffcc9900cc9933cc9966cc9999cc99cccc99ffff9900ff9933ff9966ff9999ff99ccff99ff00cc0000cc3300cc6600cc9900cccc00ccff33cc0033cc +3333cc6633cc9933cccc33ccff66cc0066cc3366cc6666cc9966cccc66ccff99cc0099cc3399cc6699cc9999cccc99ccffcccc00cccc33cccc66cccc99cccccc +ccccffffcc00ffcc33ffcc66ffcc99ffccccffccff00ff0000ff3300ff6600ff9900ffcc00ffff33ff0033ff3333ff6633ff9933ffcc33ffff66ff0066ff3366 +ff6666ff9966ffcc66ffff99ff0099ff3399ff6699ff9999ffcc99ffffccff00ccff33ccff66ccff99ccffccccffffffff00ffff33ffff66ffff99ffffccffff +ff000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000166b6431000000 +097048597300000ec400000ec401952b0e1b000000b149444154789cddd6410e80200c04c0feff83fd8e0712a5db965d48f42027233b04698d9a6f0e731be3b9 +335d97c03330bc8a00d68c20091b331ec51ef0639067c8964410b6a181553e013c6206683e02eb9fbe045dc53b90962f9bf08e2adb9981b49d0940b516af84a5 +44d9721968cb1780c4b1d26c7904421e2b4df3b1d2427e0252bc6f0d0ad47cd91a1a10f3e740cd7f07e4fc6fc0ce21bd01f07bc600f699b1d66b404f702aff6b90b1713e87e0021b88a35cae052c030000000049454e44ae426082}}{\nonshppict +{\pict\picscalex65\picscaley60\piccropl0\piccropr0\piccropt0\piccropb0\picw1270\pich1270\picwgoal720\pichgoal720\wmetafile8\bliptag279887337\blipupi96{\*\blipuid 10aebde9a4d1e28d6e49734c6dd1288c} +0100090000037406000000005206000000000400000003010800050000000b0200000000050000000c0230003000040000000701040052060000430f2000cc00 +000030003000000000003000300000000000280000003000000030000000010008000000000000090000c40e0000c40e0000d8000000d8000000000000003300 +00006600000099000000cc000000ff00000000003300330033006600330099003300cc003300ff00330000006600330066006600660099006600cc006600ff00 +660000009900330099006600990099009900cc009900ff0099000000cc003300cc006600cc009900cc00cc00cc00ff00cc000000ff003300ff006600ff009900 +ff00cc00ff00ff00ff0000330000333300006633000099330000cc330000ff33000000333300333333006633330099333300cc333300ff333300003366003333 +66006633660099336600cc336600ff33660000339900333399006633990099339900cc339900ff3399000033cc003333cc006633cc009933cc00cc33cc00ff33 +cc000033ff003333ff006633ff009933ff00cc33ff00ff33ff0000660000336600006666000099660000cc660000ff6600000066330033663300666633009966 +3300cc663300ff66330000666600336666006666660099666600cc666600ff66660000669900336699006666990099669900cc669900ff6699000066cc003366 +cc006666cc009966cc00cc66cc00ff66cc000066ff003366ff006666ff009966ff00cc66ff00ff66ff0000990000339900006699000099990000cc990000ff99 +000000993300339933006699330099993300cc993300ff99330000996600339966006699660099996600cc996600ff9966000099990033999900669999009999 +9900cc999900ff9999000099cc003399cc006699cc009999cc00cc99cc00ff99cc000099ff003399ff006699ff009999ff00cc99ff00ff99ff0000cc000033cc +000066cc000099cc0000cccc0000ffcc000000cc330033cc330066cc330099cc3300cccc3300ffcc330000cc660033cc660066cc660099cc6600cccc6600ffcc +660000cc990033cc990066cc990099cc9900cccc9900ffcc990000cccc0033cccc0066cccc0099cccc00cccccc00ffcccc0000ccff0033ccff0066ccff0099cc +ff00ccccff00ffccff0000ff000033ff000066ff000099ff0000ccff0000ffff000000ff330033ff330066ff330099ff3300ccff3300ffff330000ff660033ff +660066ff660099ff6600ccff6600ffff660000ff990033ff990066ff990099ff9900ccff9900ffff990000ffcc0033ffcc0066ffcc0099ffcc00ccffcc00ffff +cc0000ffff0033ffff0066ffff0099ffff00ccffff00ffffff00d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7 +d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d70000000000 +0000d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7000000000000d7d7d7d7d7d7d7d7d7d7d7d7d7d7 +d7d7d7d7d7d7d7d7d7d7000000d7d7d7d7d7d7d7d7d7d7d7d7d7d7d700000000d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d700000000d7d7 +d7d7d7d7d7d7d7d7d7d7d7d7d7000000d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d700000000d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7000000 +d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d70000d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7000000d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7 +d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7000000d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7 +d7d7d7d7d7d7d7d7d7d7d7d7d7d70000d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d70000 +d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d70000d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7 +d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d70000d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7 +d7d7d7d7d7d7d7d7d7d7d7d7d7d70000d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d70000 +00d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7000000d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7 +d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7000000d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7 +d7d7d7d7d7d7d7d7d7d7d7d7d7d700000000d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d70000 +0000d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d70000000000d7d7d7d7d7d7d7d7d7d7d7d7d7 +d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d70000d7000000d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7 +d7d7d7d7d7d7d7d7d7d7d7d7d7d70000d7d7000000d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d70000 +d7d7d7000000d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d70000d7d7d7d700000000d7d7d7d7d7d7d7d7 +d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d70000d7d7d7d7d700000000d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7 +d7d7d7d7d7d7d7d7d7d7d7d7d7d70000d7d7d7d7d7d700000000d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d70000 +d7d7d7d7d7d7d700000000d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7000000d7d7d7d7d7d7d7d7000000d7d7d7d7 +d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7000000d7d7d7d7d7d7d7d7d700000000d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7 +d7d7d7d7d7d7d7d7d7d7d7d7d7d700000000d7d7d7d7d7d7d7d7d70000000000d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d70000 +000000d7d7d7d7d7d7d7d7d7d700000000d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d70000d7000000d7d7d7d7d7d7d7d7d7d7d700 +000000d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d70000d7d7000000d7d7d7d7d7d7d7d7d7d7d7d7000000d7d7d7d7d7d7d7d7d7d7d7d7 +d7d7d7d7d7d7d7d7d7d7d7d7d7d70000d7d7d7d70000d7d7d7d7d7d7d7d7d7d7d7d700000000d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d70000 +d7d7d7d7d7000000d7d7d7d7d7d7d7d7d7d7d700000000d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d70000d7d7d7d7d7d7000000d7d7d7d7d7d7d7 +d7d7d7d7d7000000d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d70000d7d7d7d7d7d7d7d7000000d7d7d7d7d7d7d7d7d7d7d70000d7d7d7d7d7d7d7d7 +d7d7d7d7d7d7d7d7d7d7d7d7d7d70000d7d7d7d7d7d7d7d7d7000000d7d7d7d7d7d7d7d7d7d7d70000d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d70000 +d7d7d7d7d7d7d7d7d7d7d70000d7d7d7d7d7d7d7d7d7d70000d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d70000d7d7d7d7d7d7d7d7d7d7d7000000d7d7 +d7d7d7d7d7d7d7d70000d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d70000d7d7d7d7d7d7d7d7d7d7d7d7000000d7d7d7d7d7d7d7d7d70000d7d7d7d7d7d7 +d7d7d7d7d7d7d7d7d7d7d7d7d7d70000d7d7d7d7d7d7d7d7d7d7d7d7d70000d7d7d7d7d7d7d7d7d70000d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d70000 +d7d7d7d7d7d7d7d7d7d7d7d7d70000d7d7d7d7d7d70000000000d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d70000d7d7d7d7d7d7d7d7d7d7d7d7000000d7 +d7d7d7d7d70000000000d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7000000d7d7d7d7d7d7d7d7d7d7d700000000d7d7d7d7d7d70000000000d7d7d7d7d7d7 +d7d7d7d7d7d7d7d7d7d7d7d7000000000000d7d7d7d7d7d7d7d7d700000000d7d7d7d7d7d700000000d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d70000000000 +0000d7d7d7d7d7d7d7d7d7000000d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d70400000007010100030000000000}}}{\b\f1\lang1040 +\par }\pard \widctlpar\adjustright {\f1\lang1040 +\par codice colori: +\par {\pntext\pard\plain\f3\fs20 \loch\af3\dbch\af0\hich\f3 \'b7\tab}}\pard \fi-360\li360\widctlpar{\*\pn \pnlvlblt\ilvl0\ls1\pnrnot0\pnf3\pnindent360 {\pntxtb \'b7}}\ls1\adjustright {\f1\lang1040 normale +\par {\pntext\pard\plain\f3\fs20\cf12 \loch\af3\dbch\af0\hich\f3 \'b7\tab}}\pard \fi-360\li360\widctlpar{\*\pn \pnlvlblt\ilvl0\ls2\pnrnot0\pnf3\pnindent360 {\pntxtb \'b7}}\ls2\adjustright {\f1\cf12\lang1040 importante +\par {\pntext\pard\plain\f3\fs20\cf14 \loch\af3\dbch\af0\hich\f3 \'b7\tab}}\pard \fi-360\li360\widctlpar{\*\pn \pnlvlblt\ilvl0\ls3\pnrnot0\pnf3\pnindent360 {\pntxtb \'b7}}\ls3\adjustright {\f1\cf14\lang1040 tecnico +\par }\pard \widctlpar{\*\pn \pnlvlcont\ilvl0\ls0\pnrnot0\pndec }\adjustright {\f1\lang1040 +\par }{\f0\lang1040 INDICE +\par {\pntext\pard\plain\f3 \loch\af3\dbch\af0\hich\f3 \'b7\tab}}\pard \fi-283\li283\widctlpar{\*\pn \pnlvlblt\ilvl0\ls4\pnrnot0\pnf3\pnstart1\pnindent283\pnhang{\pntxtb \'b7}}\ls4\adjustright {\b\f0\fs24\lang1040 Novit\'e0 della versione 72. +\par {\pntext\pard\plain\f3\fs32\cf12 \loch\af3\dbch\af0\hich\f3 \'b7\tab}}\pard \fi-283\li283\widctlpar{\*\pn \pnlvlblt\ilvl0\ls4\pnrnot0\pnf3\pnstart1\pnindent283\pnhang{\pntxtb \'b7}}\ls4\adjustright {\b\f0\fs32\cf12\lang1040 100% errors free\~!!!}{ +\f0\cf12\lang1040 +\par {\pntext\pard\plain\f3\cf14 \loch\af3\dbch\af0\hich\f3 \'b7\tab}}\pard \fi-283\li283\widctlpar{\*\pn \pnlvlblt\ilvl0\ls4\pnrnot0\pnf3\pnstart1\pnindent283\pnhang{\pntxtb \'b7}}\ls4\adjustright {\f0\fs24\cf14\lang1040 Il pi\'f9 + grave problema di KAOS: una quisquiglia.}{\f0\fs24\lang1040 +\par {\pntext\pard\plain\f3\cf14 \loch\af3\dbch\af0\hich\f3 \'b7\tab}}\pard \fi-283\li283\widctlpar{\*\pn \pnlvlblt\ilvl0\ls4\pnrnot0\pnf3\pnstart1\pnindent283\pnhang{\pntxtb \'b7}}\ls4\adjustright {\f0\fs24\cf14\lang1040 +Il problema della divisione per zero: ovvio.}{\f0\fs24\lang1040 +\par {\pntext\pard\plain\f3 \loch\af3\dbch\af0\hich\f3 \'b7\tab}}\pard \fi-283\li283\widctlpar{\*\pn \pnlvlblt\ilvl0\ls4\pnrnot0\pnf3\pnstart1\pnindent283\pnhang{\pntxtb \'b7}}\ls4\adjustright {\b\f0\fs24\lang1040 l'Editor\~?}{\f0\fs22\lang1040 +\par {\pntext\pard\plain\f3\cf12 \loch\af3\dbch\af0\hich\f3 \'b7\tab}}\pard \fi-283\li283\widctlpar{\*\pn \pnlvlblt\ilvl0\ls4\pnrnot0\pnf3\pnstart1\pnindent283\pnhang{\pntxtb \'b7}}\ls4\adjustright {\b\f0\fs24\cf12\lang1040 Cosa manca ?}{\f0\cf12\lang1040 + +\par {\pntext\pard\plain\f3\cf14 \loch\af3\dbch\af0\hich\f3 \'b7\tab}}\pard \fi-283\li283\widctlpar{\*\pn \pnlvlblt\ilvl0\ls4\pnrnot0\pnf3\pnstart1\pnindent283\pnhang{\pntxtb \'b7}}\ls4\adjustright {\b\f0\fs24\cf14\lang1040 +Versione 72... nuovo MemoryManager, nuovi errori.}{\f0\cf14\lang1040 +\par {\pntext\pard\plain\f3\cf12 \loch\af3\dbch\af0\hich\f3 \'b7\tab}}\pard \fi-283\li283\widctlpar{\*\pn \pnlvlblt\ilvl0\ls4\pnrnot0\pnf3\pnstart1\pnindent283\pnhang{\pntxtb \'b7}}\ls4\adjustright {\b\f0\fs24\cf12\lang1040 Configurare il computer per MM v3.4} +{\f0\cf12\lang1040 +\par {\pntext\pard\plain\f3 \loch\af3\dbch\af0\hich\f3 \'b7\tab}}\pard \fi-283\li283\widctlpar{\*\pn \pnlvlblt\ilvl0\ls4\pnrnot0\pnf3\pnstart1\pnindent283\pnhang{\pntxtb \'b7}}\ls4\adjustright {\b\f0\fs24\lang1040 Texture Mapping: ce l\rquote ho.}{ +\f0\cf12\lang1040 +\par {\pntext\pard\plain\f3 \loch\af3\dbch\af0\hich\f3 \'b7\tab}}\pard \fi-283\li283\widctlpar{\*\pn \pnlvlblt\ilvl0\ls4\pnrnot0\pnf3\pnstart1\pnindent283\pnhang{\pntxtb \'b7}}\ls4\adjustright {\b\f0\fs24\lang1040 DirectX: ultime notizie.}{\f0\cf12\lang1040 + +\par }\pard \widctlpar{\*\pn \pnlvlcont\ilvl0\ls0\pnrnot0\pndec }\adjustright {\f0\cf12\lang1040 +\par }{\f0\lang1040 +\par }{\b\f0\fs24\lang1040 Ecco le Super-novit\'e0 della versione 72. +\par }{\f0\lang1040 Nella nuova versione sono state apportate le seguenti modifiche: +\par {\pntext\pard\plain\f3\fs20 \loch\af3\dbch\af0\hich\f3 \'b7\tab}}\pard \fi-360\li360\widctlpar{\*\pn \pnlvlblt\ilvl0\ls5\pnrnot0\pnf3\pnindent360 {\pntxtb \'b7}}\ls5\adjustright {\f0\lang1040 +corretti i problemi di sincronizzazione Save/Playback (non completamente, a parte quelli irrimediabili); +\par {\pntext\pard\plain\f3\fs20 \loch\af3\dbch\af0\hich\f3 \'b7\tab}}\pard \fi-360\li360\widctlpar{\*\pn \pnlvlblt\ilvl0\ls6\pnrnot0\pnf3\pnindent360 {\pntxtb \'b7}}\ls6\adjustright {\f0\lang1040 corretto il problema di disegno dei numeri on- +screen (siamo sicuri\~?); +\par {\pntext\pard\plain\f3\fs20 \loch\af3\dbch\af0\hich\f3 \'b7\tab}}\pard \fi-360\li360\widctlpar{\*\pn \pnlvlblt\ilvl0\ls7\pnrnot0\pnf3\pnindent360 {\pntxtb \'b7}}\ls7\adjustright {\f0\lang1040 corretto l\rquote errore di collisione in memoria; +\par {\pntext\pard\plain\f3\fs20 \loch\af3\dbch\af0\hich\f3 \'b7\tab}}\pard \fi-360\li360\widctlpar{\*\pn \pnlvlblt\ilvl0\ls8\pnrnot0\pnf3\pnindent360 {\pntxtb \'b7}}\ls8\adjustright {\f0\lang1040 corretto l\rquote errore di \ldblquote division by zero +\rdblquote nella routine di fuoco 3D (accadeva in casi veramente rarissimi... \'e8 stato difficile); +\par {\pntext\pard\plain\f3\fs20 \loch\af3\dbch\af0\hich\f3 \'b7\tab}}\pard \fi-360\li360\widctlpar{\*\pn \pnlvlblt\ilvl0\ls9\pnrnot0\pnf3\pnindent360 {\pntxtb \'b7}}\ls9\adjustright {\f0\lang1040 inserito il men\'f9 per la modifica diretta dei tasti (funziona + anche sulla partita in corso); +\par {\pntext\pard\plain\f3\fs20 \loch\af3\dbch\af0\hich\f3 \'b7\tab}}\pard \fi-360\li360\widctlpar{\*\pn \pnlvlblt\ilvl0\ls10\pnrnot0\pnf3\pnindent360 {\pntxtb \'b7}}\ls10\adjustright {\f0\lang1040 +modificato il comportamento dei mostri (adesso sono leggermente pi\'f9 cattivi e veloci); +\par {\pntext\pard\plain\f3\fs20 \loch\af3\dbch\af0\hich\f3 \'b7\tab}}\pard \fi-360\li360\widctlpar{\*\pn \pnlvlblt\ilvl0\ls11\pnrnot0\pnf3\pnindent360 {\pntxtb \'b7}}\ls11\adjustright {\f0\lang1040 modificato lo sparo dello Spider (pi\'f9 + veloce e diffuso, adesso \'e8 molto probabile che colpisca); +\par {\pntext\pard\plain\f3\fs20 \loch\af3\dbch\af0\hich\f3 \'b7\tab}}\pard \fi-360\li360\widctlpar{\*\pn \pnlvlblt\ilvl0\ls12\pnrnot0\pnf3\pnindent360 {\pntxtb \'b7}}\ls12\adjustright {\f0\lang1040 modificate le routine di gestione della t +astiera per il riconoscimento dei codici estesi (adesso si distinguono i tasti di destra da quelli di sinistra e non ci sono pi\'f9 limitazioni per l\rquote uso dei due SHIFT); +\par {\pntext\pard\plain\f3\fs20 \loch\af3\dbch\af0\hich\f3 \'b7\tab}}\pard \fi-360\li360\widctlpar{\*\pn \pnlvlblt\ilvl0\ls13\pnrnot0\pnf3\pnindent360 {\pntxtb \'b7}}\ls13\adjustright {\f0\lang1040 riorganizzato il codice per far occupare meno spazio; +\par {\pntext\pard\plain\f3\fs20 \loch\af3\dbch\af0\hich\f3 \'b7\tab}}\pard \fi-360\li360\widctlpar{\*\pn \pnlvlblt\ilvl0\ls14\pnrnot0\pnf3\pnindent360 {\pntxtb \'b7}}\ls14\adjustright {\f0\lang1040 corretto un bug di doppia inizializ +zazione del DMA nel 3DSoundManager (adesso \'e8 sicuro che non ci saranno discontinuit\'e0 di suono [tranne quando si \'e8 in fase di caricamento e il sistema degrada...] ); +\par {\pntext\pard\plain\f3\fs20 \loch\af3\dbch\af0\hich\f3 \'b7\tab}}\pard \fi-360\li360\widctlpar{\*\pn \pnlvlblt\ilvl0\ls15\pnrnot0\pnf3\pnindent360 {\pntxtb \'b7}}\ls15\adjustright {\f0\lang1040 nuovo MemoryManager v3.4\~ +: in condizioni particolari riesce ad aumentare la quantit\'e0 di memoria \ldblquote }{\f0\ul\lang1040 convenzionale}{\f0\lang1040 \rdblquote , anche di 150Kb\~! +\par {\pntext\pard\plain\f3\fs20 \loch\af3\dbch\af0\hich\f3 \'b7\tab}}\pard \fi-360\li360\widctlpar{\*\pn \pnlvlblt\ilvl0\ls16\pnrnot0\pnf3\pnindent360 {\pntxtb \'b7}}\ls16\adjustright {\f0\lang1040 +SCOPERTO NUOVO TRUCCO ASSEMBLER: per ora ha portato ad una profonda ottimizzazione delle routine di disegno texture 3D (ottimizzazione massima) e oggetti (veloce, ma non il massimo); +\par {\pntext\pard\plain\f3\fs20 \loch\af3\dbch\af0\hich\f3 \'b7\tab}}\pard \fi-360\li360\widctlpar{\*\pn \pnlvlblt\ilvl0\ls17\pnrnot0\pnf3\pnindent360 {\pntxtb \'b7}}\ls17\adjustright {\f0\lang1040 SUPER-ottimizzazione delle routine + di rendering dei pavimenti e soffitti: il risultato finale \'e8 una maggiore velocit\'e0 d\rquote esecuzione, ma la delicatezza dell\rquote +ottimizzazione (utilizzo dello stack segment e disabilito le interruzioni per evitare conflitti) lo rende estremamente pericoloso e forse controproducente per i caricamenti da disco; +\par {\pntext\pard\plain\f3\fs20 \loch\af3\dbch\af0\hich\f3 \'b7\tab}}\pard \fi-360\li360\widctlpar{\*\pn \pnlvlblt\ilvl0\ls18\pnrnot0\pnf3\pnindent360 {\pntxtb \'b7}}\ls18\adjustright {\f0\lang1040 regolato lo scrolling dello sfondo (montagne) perch\'e9 + era troppo veloce rispetto quello della prospettiva con visuale a 90\'b0; +\par {\pntext\pard\plain\f3\fs20 \loch\af3\dbch\af0\hich\f3 \'b7\tab}}\pard \fi-360\li360\widctlpar{\*\pn \pnlvlblt\ilvl0\ls19\pnrnot0\pnf3\pnindent360 {\pntxtb \'b7}}\ls19\adjustright {\f0\lang1040 +aumentata la potenza luminosa di lampadari, torce, ecc. (in questo modo saranno necessari molti meno oggetti del genere per illuminare i livelli). +\par {\pntext\pard\plain\f3\fs20 \loch\af3\dbch\af0\hich\f3 \'b7\tab}}\pard \fi-360\li360\widctlpar{\*\pn \pnlvlblt\ilvl0\ls20\pnrnot0\pnf3\pnindent360 {\pntxtb \'b7}}\ls20\adjustright {\f0\lang1040 +Multi Sound System: modificato il 3DSoundManager per gestire i suoni 3D di tutti i Player nelle modalit\'e0 MultiPlayer; il massimo numero di suoni gestibili contemporaneamente \'e8 stato aumentato a 24. +\par {\pntext\pard\plain\f3\fs20 \loch\af3\dbch\af0\hich\f3 \'b7\tab}}\pard \fi-360\li360\widctlpar{\*\pn \pnlvlblt\ilvl0\ls21\pnrnot0\pnf3\pnindent360 {\pntxtb \'b7}}\ls21\adjustright {\f0\lang1040 +KAOS-MODE: attivate alcune funzioni del Kaos Mode, tra le quali: Missile che devia, spari dei nemici che seguono l\rquote obiettivo; +\par }\pard \widctlpar\adjustright {\f0\lang1040 +\par +\par +\par }{\b\f0\fs48\cf12\lang1040 100% errors free\~!!! +\par }{\f0\fs24\lang1040 We reached the 100% errors free final product\~! +\par All we\rquote ve to do is the extension to the final version\~! +\par Years over years of testing, melting, spotting, fishing, trainging, splitting, shifting, reading, jpegging, writing, fulling & bouncing has permitted the global unbugging\~! +\par No more crash-bugs\~! +\par No more nothing\~! +\par We\rquote re at the end of the project\~! +\par We\rquote re at the 100% errors free final status, granted by NicoSoft\rquote s Test \rquote 98. +\par More of 50 hours of complete testing and 10 hours of intensive zone-level testing. +\par All for the best. +\par Posso affermare con una certezza del 99,999% che questa versione non ha errori da crash\~! +\par NOTA: ci sono sicuramente altri bug, ma alcuni sono stati lasciati volutamente perch\'e9 fanno guadagnare memoria e/o velocit\'e0 (es.: le cornici di visualizzazione a volte spariscono se c\rquote \'e8 il men\'f9 (M), un suono lungo ma lontano pu\'f2 + terminare prima della sua fine effettiva (MV), a volte rimangono dei puntini fantasma all\rquote incrocio tra muri e pavimento in corridoi lunghi o dopo una porta (V); tutti questi sono risolvibili, ma non conviene risolverli). +\par }{\b\f0\fs24\cf6\lang1040 +\par }{\f0\lang1040 {\*\shppict{\pict{\*\picprop\shplid1027{\sp{\sn shapeType}{\sv 75}}{\sp{\sn fFlipH}{\sv 0}}{\sp{\sn fFlipV}{\sv 0}}{\sp{\sn fillColor}{\sv 268435473}}{\sp{\sn fFilled}{\sv 0}}{\sp{\sn fLine}{\sv 0}}} +\picscalex100\picscaley100\piccropl0\piccropr0\piccropt0\piccropb0\picw635\pich635\picwgoal360\pichgoal360\pngblip\bliptag167900747{\*\blipuid 0a01f64b60c49c2a507664939e345182} +89504e470d0a1a0a0000000d4948445200000018000000180803000000d7a9cdca0000000467414d410000b1889598f4a600000300504c544500000080000000 +8000808000000080800080008080c0c0c0808080ff000000ff00ffff000000ffff00ff00ffffffffff0000000000000000000000000000000000000000000000 +00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000d975d8c4000000 +097048597300000ec400000ec401952b0e1b0000007849444154789c85d14b0ec0200804d0315da02bee7fdb8af8197fedac0c2f1805e825a063ce0990520ad8 +c1ea2c0ce104561721f983525725618871036fc8df18421081b88037188c1602016486fa242da36af205ad5e5385c1a7de6134d475b860bda983ed41e63c26f005ad310817508443509e7b88ea0bd1e415991803c0e60000000049454e44ae426082}}{\nonshppict +{\pict\picscalex100\picscaley100\piccropl0\piccropr0\piccropt0\piccropb0\picw635\pich635\picwgoal360\pichgoal360\wmetafile8\bliptag167900747\blipupi96{\*\blipuid 0a01f64b60c49c2a507664939e345182} +010009000003f40000000000d200000000000400000003010800050000000b0200000000050000000c02180018000400000007010400d2000000430f2000cc00 +000018001800000000001800180000000000280000001800000018000000010004000000000020010000c40e0000c40e00001000000010000000000000008000 +0000ff00000000008000800080000000ff00ff00ff0000800000808000000080800080808000c0c0c00000ff0000ffff000000ffff00ffffff00ff0000000000 +0000000000fff0333333333333333333330f0355555555555555555555300555555555555555555555300555bbbbbbbbbbbbbbb95530f0553bffffffffffffb5 +530ff0553bfffff00fffffb5530fff0553bffff00ffffb5530ffff0553bffffffffffb5530fffff0553bfff00fffb5530ffffff0553bfff00fffb5530fffffff +0553bfb00bfb5530ffffffff0553bfa00afb5530fffffffff0553ba00ab5530ffffffffff0553bf00fb5530fffffffffff0553baab5530ffffffffffff0553bf +fb5530fffffffffffff0553bb5530ffffffffffffff0553bb5530fffffffffffffff05535530ffffffffffffffff05555530fffffffffffffffff055530fffffffffffffffffff0000ffffffffffffffffffffffffffffffffff0400000007010100030000000000}}}{\f0\lang1040 +\par Forse c\rquote era qualche problema con le texture dei pavimenti (con sangue); ho l'impressione che NON siano state centrate: quando una texture cambia, sembra come se traslasse da una parte !!! +\par Forse ho corretto il problema o forse no, nel senso che non ho fatto pi\'f9 caso a cose del genere; dovresti controllare se le texture sono centrate, oppure giocare in modalit\'e0 \ldblquote /slow\rdblquote + e controllare le texture dei pavimenti che cambiano in texture con sangue. +\par }{\b\f0\lang1040 Ogni texture deve essere posizionata PRECISAMENTE alle coordinate 0-64-128-192-ecc. sia in verticale che in orizzontale !!! +\par }{\f0\lang1040 +\par }{\f0\fs24\cf14\lang1040 Il pi\'f9 grave problema di KAOS: una quisquiglia.}{\f0\fs24\lang1040 +\par }{\f0\lang1040 Oggi 16 febbraio 1998 nasce una nuova versione del Kaos\~perch\'e9 \'e8 stato risolto il problema principale ! +\par IL PROBLEMA: +\par Durante una sessione di salvataggio di circa 5 minuti il gioco ha funzionato perfettamen +te, ma con il passare del tempo mi sono accorto che nel 60% dei casi quella registrazione non veniva riprodotta fino alla fine per un problema di sovrapposizione di dati in memoria che sfociava in un errore di \ldblquote recall() - ID out of range +\rdblquote uno degli errori pi\'f9 inconsueti che possono essere incontrati. +\par L\rquote ANALISI: +\par Ovviamente un problema di recall non \'e8 determinabile direttamente dal programma, perch\'e9 presuppone una modifica non volontaria di una qualsiasi area dati nel programma (UNA QUALSIASI AREA DATI\~!) +\par Dall\rquote analisi delle chiamate alla funzione recall() sono giunto alla conclusione che il richiamo fasullo era quello di un suono (anche perch\'e9 + prima di esplodere, il gioco suonava male). Quindi era fatta, era solo necessario scoprire chi era stato l\rquote artefice della \ldblquote collisione\rdblquote dei dati in grado di distruggere la tabella dei suoni... +\par Tutti gli indizi portavano al MemoryManager, cio\'e8 l\rquote unico in grado di spostare grandi quantit\'e0 di memoria senza nessun possibile controllo. Purtroppo \'e8 umanamente impossibile controllare l\rquote +operato del MemoryManager e quindi le ricerche si sono bloccate... per molto tempo. +\par LA RICERCA: +\par Pochi giorni fa ho scritto una serie di funzioni di debugging automatico all\rquote interno del MemoryManager e l\rquote ho usate in collaborazione con una funzione +check_collision() presente nel SoundManager. La cosa sembrava funzionare, nel senso che la check_collision() riusciva a determinare (a grandi linee) il punto in cui si verificava l\rquote errore di collisione dati, ma il risultato non era leggibile prech +\'e9 i dati di output della funzione di controllo stessa erano stati \ldblquote corrotti\rdblquote . Praticamente si era in presenza di un errore a propagazione e bisognava procedere all\rquote +indietro per determinarne la causa scatenante. Dal tabulato fornito dal MemoryManager sarebbe dovuto scaturire (!) l\rquote +istante di gioco in cui si verificava un possibile spostamento sospetto di dati e un conseguente malfunzionamento globale ad esso successivo. +\par Con grande sorpresa mi sono accorto che il MemoryManager non riscontrava nessuna irregolarit\'e0 negli istanti precedenti il grande botto, perci\'f2 ho cominciato a convincermi del fatto che poteva non essere il MemoryManager (tra l\rquote altro gi\'e0 + pesantemente controllato nelle precedenti versioni e mai pi\'f9 modificato) a scatenare il putiferio del Kaos\~! +\par Cominciai a suddividere il programma in zone controllate da una routine di check_collision() sempre pi\'f9 furba e che fosse in grado di riportare esattamente la zona d\rquote +errore; procedendo per approssimazioni successive e confidando molto sulla fortuna capitatami, e cio\'e8 sul fatto che in fase di Playback il gioco si bloccava sempre con lo stesso messaggio d\rquote +errore del check_collision(), riuscii a trovare un hot-point. +\par Infine la sorpresa: il casino veniva da un Actor. La sorpresa stava nel fatto che gli Actors sono g +li unici oggetti che si muovono nel gioco e che sono visibili, ma non sono loro a disegnare se stessi, e quindi il problema non era nemmeno dovuto al 3D-Engine, che era l\rquote unico rimasto in grado di occuparsi di spostamento di dati in memoria. +\par Il problema doveva quindi essere creato da un errore di memorizzazione (diretta) in un array; un semplice array\~!? +\par Il primo Actor di cui ho sospettato \'e8 stato il Player (\'e8 praticamente l\rquote oggetto pi\'f9 grande tra tutti gli Actors) e infatti il problema veniva direttamente da una delle parti modificate pi\'f9 + di recente, dalla chiamata al Play3DSound(), ovvero di nuovo dal SoundManager\~!!! Praticamente avevo capito che il problema si verificava nel SoundManager, ma non ho controllato le due funzioni pi\'f9 innoque di tutto il file: le PlaySound()\~!!! + +\par LA SOLUZIONE: +\par Raggiunta la funzione, il problema \'e8 stato sgamato quasi subito, ma tutto questo \'e8 stato un grande colpo di fortuna, perch\'e9 l\rquote unico modo per ottenere quel poblema era di saturare il buffer dei suoni e richiedere un suono + che non fosse un OVERSOUND: un caso pi\'f9 unico che raro, dato che l\rquote unico NON-OVERSOUND \'e8 il passo del Player\~!!! +\par }{\f0\fs22\lang1040 +\par }{\f0\fs24\cf14\lang1040 Il problema della divisione per zero: ovvio.}{\f0\fs24\lang1040 +\par }{\f0\lang1040 Questo problema si \'e8 verificato quasi subito, dopo l\rquote introduzione della routine di fuoco 3D. Era facile immaginare che in quella routine potesse celarsi una divisione ai limiti della precisione (32 bit), ma la difficolt\'e0 + di controllo su quella routine la rendeva praticamente inattaccabile, e con essa anche l\rquote errore. +\par Dopo la scoperta dell\rquote errore di collisione in memoria (che tra l\rquote altro \'e8 un errore molto pi\'f9 semplice di questo) ho voluto provare ad eliminare quello che era l\rquote +ultimo baluardo per la conquista della perfezione assoluta (...troppo). +\par Tutto ci\'f2 che c\rquote era nella parte iniziale della routine era un insieme di calcoli utilizzati esclusivamente per velocizzare la routine di sparo e di poca utilit\'e0 pratiche e visiva; non c\rquote \'e8 bisogno di dire che l\rquote +errore era proprio l\'ec, dove non si poteva avere nessun riscontro visivo della falla. Si tratta fondamentalmente di una divisione per la tangente di un angolo non nullo compreso tra -30 e +30 gradi circa: l\rquote angolo era s\'ec + non nullo, ma era comunque troppo piccolo per permettere alla tangente di non mandare in overflow il risultato della divisione... +\par Tengo a precisare che di solito non cado in errori cos\'ec stupidi ma devo ammettere che, pur avendo intuito da subito l\rquote entit\'e0 del problema, non riesco ancora adesso a capire la causa \ldblquote vera\rdblquote + di una tale risposta da parte del processore ad operazioni comunque fattibili. Forse dovrei prendermela anche con il compilatore...}{\f0\fs24\lang1040 +\par }{\f0\fs22\lang1040 +\par }{\b\f0\fs24\lang1040 l'Editor\~?}{\f0\fs22\lang1040 +\par }{\f0\lang1040 E\rquote possibile cominciare a disegnare i livelli (purtroppo non ho avuto il tempo di aggiungere le funzioni all'editor, perci\'f2 bisogna fare attenzione a non premere involontariamente dei tasti distruttivi). +\par I livelli creati saranno compatibili con la versione definitiva solo se non verranno aggiunte nuove texture !!! +\par E' comunque possibile aggiungere un numero maggiore di sfondi e opzioni particolari. +\par NON HO INCLUSO IL PERIODO DI TEMPO PER IL KAOS-MODE, perch\'e9 sarebbe un p\'f2 + complicato... per ora facciamo in modo che i livelli siano progettati in modo da permettere l'accesso all'AntiKaos in un tempo fisso (1,2,3,... minuti, decidi tu) [ il gioco NON deve essere finalizzato alla ricerca di questo inutile oggetto ! ] +\par +\par }{\b\f0\fs24\cf12\lang1040 Cosa manca ?}{\f0\cf12\lang1040 +\par }{\f0\lang1040 Io sto perdendo un p\'f2 di tempo con l'episodio Final, ma adesso comincer\'f2 a progettare alcuni livelli per la versione Shareware (e uno per la modalit\'e0 }{\b\f0\lang1040 competitive}{\f0\lang1040 ). +\par NOTA: nei miei livelli sar\'e0 molto curata la parte estetica e la coerenza d'ambiente, lasciando da parte la giocabilit\'e0 e la strategia di gioco... mi aspetto che tu NON faccia lo stesso. +\par +\par Questo \'e8 l\rquote elenco dei problemi rimasti insoluti, o di quelli la cui soluzione \'e8 andata persa: +\par +\par {\pntext\pard\plain\fs20 \hich\af0\dbch\af0\loch\f0 1.\tab}}\pard \fi-283\li283\widctlpar{\*\pn \pnlvlbody\ilvl0\ls22\pnrnot0\pndec\pnstart1\pnindent283\pnhang{\pntxta .}}\ls22\adjustright {\f0\lang1040 Che ne facciamo del Kaos-mod +e in Shareware ??? Per ora ho disabilitato l'attivazione (che tra l'altro non provoca niente... ora). +\par {\pntext\pard\plain\fs20 \hich\af0\dbch\af0\loch\f0 2.\tab}}\pard \fi-283\li283\widctlpar{\*\pn \pnlvlbody\ilvl0\ls22\pnrnot0\pndec\pnstart1\pnindent283\pnhang{\pntxta .}}\ls22\adjustright {\f0\lang1040 Che ne facciamo del soldo piccolo ??? Sar\'e0 + il Grande Segreto di Kaos, svelato solo alla fine della versione Shareware ???! +\par {\pntext\pard\plain\fs20 \hich\af0\dbch\af0\loch\f0 3.\tab}}\pard \fi-283\li283\widctlpar{\*\pn \pnlvlbody\ilvl0\ls22\pnrnot0\pndec\pnstart1\pnindent283\pnhang{\pntxta .}}\ls22\adjustright {\f0\lang1040 Perch\'e9 il soldo grande \'e8 anco +ra un soldo grande ??? Ormai \'e8 arrivato il momento di cambiare la figura con qualcosa di pi\'f9 tecnologico o mistico (un amuleto del Kaos... con il fuoco dentro) ! +\par {\pntext\pard\plain\fs20 \hich\af0\dbch\af0\loch\f0 4.\tab}}\pard \fi-283\li283\widctlpar{\*\pn \pnlvlbody\ilvl0\ls22\pnrnot0\pndec\pnstart1\pnindent283\pnhang{\pntxta .}}\ls22\adjustright {\f0\lang1040 Serve un\rquote immagine per l\rquote +inizio del KAOS-mode (cosa devo farci col Kaos-mode\~?). +\par {\pntext\pard\plain\fs20 \hich\af0\dbch\af0\loch\f0 5.\tab}}\pard \fi-283\li283\widctlpar{\*\pn \pnlvlbody\ilvl0\ls22\pnrnot0\pndec\pnstart1\pnindent283\pnhang{\pntxta .}}\ls22\adjustright {\f0\lang1040 Servono i num +eri in formato gigante (per il font grande, quello rosso). +\par {\pntext\pard\plain\fs20 \hich\af0\dbch\af0\loch\f0 6.\tab}}\pard \fi-283\li283\widctlpar{\*\pn \pnlvlbody\ilvl0\ls22\pnrnot0\pndec\pnstart1\pnindent283\pnhang{\pntxta .}}\ls22\adjustright {\f0\lang1040 +Manca il supporto per mouse e/o joystick, ma forse non ci sar\'e0 mai. +\par {\pntext\pard\plain\fs20 \hich\af0\dbch\af0\loch\f0 7.\tab}}\pard \fi-283\li283\widctlpar{\*\pn \pnlvlbody\ilvl0\ls22\pnrnot0\pndec\pnstart1\pnindent283\pnhang{\pntxta .}}\ls22\adjustright {\f0\lang1040 Mancano le immagini delle pietre nell\rquote +acqua (pavimento). +\par {\pntext\pard\plain\fs20 \hich\af0\dbch\af0\loch\f0 8.\tab}}\pard \fi-283\li283\widctlpar{\*\pn \pnlvlbody\ilvl0\ls22\pnrnot0\pndec\pnstart1\pnindent283\pnhang{\pntxta .}}\ls22\adjustright {\f0\lang1040 +Gli Slimer non funzionano bene (credo che provochino incongrueze in fase di Playback, ma potrebbero anche essere gli altri). +\par {\pntext\pard\plain\fs20 \hich\af0\dbch\af0\loch\f0 9.\tab}}\pard \fi-283\li283\widctlpar{\*\pn \pnlvlbody\ilvl0\ls22\pnrnot0\pndec\pnstart1\pnindent283\pnhang{\pntxta .}}\ls22\adjustright {\f0\lang1040 +Gli Slimer non sfruttano ancora il fatto di poter volare in alto. +\par {\pntext\pard\plain\fs20 \hich\af0\dbch\af0\loch\f0 10.\tab}}\pard \fi-283\li283\widctlpar{\*\pn \pnlvlbody\ilvl0\ls22\pnrnot0\pndec\pnstart1\pnindent283\pnhang{\pntxta .}}\ls22\adjustright {\f0\lang1040 +Manca il disegno della bomba in tutte le posizioni, e manca la regolazione della lunghezza di tiro in base all\rquote inclinazione. +\par {\pntext\pard\plain\fs20 \hich\af0\dbch\af0\loch\f0 11.\tab}}\pard \fi-283\li283\widctlpar{\*\pn \pnlvlbody\ilvl0\ls22\pnrnot0\pndec\pnstart1\pnindent283\pnhang{\pntxta .}}\ls22\adjustright {\f0\lang1040 Manca l\rquote imma +gine (veramente tutta la sequenza) della chiave anti-Kaos. +\par {\pntext\pard\plain\fs20 \hich\af0\dbch\af0\loch\f0 12.\tab}}\pard \fi-283\li283\widctlpar{\*\pn \pnlvlbody\ilvl0\ls22\pnrnot0\pndec\pnstart1\pnindent283\pnhang{\pntxta .}}\ls22\adjustright {\f0\lang1040 I numeri on-screen lampeggiano ancora (in modalit +\'e0 slow \'e8 sicuro, altrimenti non si nota...). +\par {\pntext\pard\plain\fs20 \hich\af0\dbch\af0\loch\f0 13.\tab}}\pard \fi-283\li283\widctlpar{\*\pn \pnlvlbody\ilvl0\ls22\pnrnot0\pndec\pnstart1\pnindent283\pnhang{\pntxta .}}\ls22\adjustright {\f0\lang1040 +La texture del muro con gli archetti non ha il sangue (in teoria non dovrebbe averlo, ma in pratica ris +ulta impossibile metterlo nella parte sottostante... dovrebbe essere necessario aggiungere spazi virtuali nel programma, ma devo considerare le ripercussioni sull\rquote editor dei livelli) +\par {\pntext\pard\plain\fs20 \hich\af0\dbch\af0\loch\f0 14.\tab}}\pard \fi-283\li283\widctlpar{\*\pn \pnlvlbody\ilvl0\ls22\pnrnot0\pndec\pnstart1\pnindent283\pnhang{\pntxta .}}\ls22\adjustright {\f0\lang1040 +Il Bonus adesso, oltre a dare forza, carica anche le armi... tolgo questa funzione\~o va bene cos\'ec ? +\par {\pntext\pard\plain\fs20 \hich\af0\dbch\af0\loch\f0 15.\tab}}\pard \fi-283\li283\widctlpar{\*\pn \pnlvlbody\ilvl0\ls22\pnrnot0\pndec\pnstart1\pnindent283\pnhang{\pntxta .}}\ls22\adjustright {\f0\lang1040 Credo che il men\'f9 \ldblquote New Game\rdblquote + sia poco comprensibile, forse dovrei mettere dei pulsanti per scegliere le modalit\'e0 di gioco\~in modo diverso ? +\par {\pntext\pard\plain\fs20 \hich\af0\dbch\af0\loch\f0 16.\tab}}\pard \fi-283\li283\widctlpar{\*\pn \pnlvlbody\ilvl0\ls22\pnrnot0\pndec\pnstart1\pnindent283\pnhang{\pntxta .}}\ls22\adjustright {\f0\lang1040 Il suono dell\rquote attacco dello Slimer \'e8 + troppo simile (\'e8 uguale) a quello del Soldier (bisognerebbe cambiarlo); +\par {\pntext\pard\plain\fs20 \hich\af0\dbch\af0\loch\f0 17.\tab}}\pard \fi-283\li283\widctlpar{\*\pn \pnlvlbody\ilvl0\ls22\pnrnot0\pndec\pnstart1\pnindent283\pnhang{\pntxta .}}\ls22\adjustright {\f0\lang1040 +Il suono del veleno dello Spider che sbatte sui muri \'e8 troppo simile (\'e8 uguale) a quello dello sparo dello Slimer, ma non dovrebbe essere cos\'ec: il suono dovrebbe essere come uno schizzo di fango che si spiaccica per terra, e magari anch +e il rumore di qualcosa che \ldblquote frigge\rdblquote subito dopo. +\par {\pntext\pard\plain\fs20 \hich\af0\dbch\af0\loch\f0 18.\tab}}\pard \fi-283\li283\widctlpar{\*\pn \pnlvlbody\ilvl0\ls22\pnrnot0\pndec\pnstart1\pnindent283\pnhang{\pntxta .}}\ls22\adjustright {\f0\lang1040 +Ho cercato di evitare una specie di classifica, ma ora credo che non si possa pi\'f9 evitare... si potrebbe per\'f2 fare una classifica basata sulla violenza-mira-ecc. e non sui punti. +\par }\pard \widctlpar\adjustright {\f0\lang1040 +\par Spero di sbagliarmi, ma credo di aver capito che non si pu\'f2 + suonare il file .MID direttamente dal sintetizzatore FM della scheda (senza conoscere i valori degli strumenti General MIDI). Dovrebbe essere necessario caricare un driver della SoundBlaster... ma cos\'ec la cosa non mi piace pi\'f9. +\par +\par }{\b\f0\fs28\cf14\lang1040 Versione 72... nuovo MemoryManager, nuovi errori.}{\f0\fs28\cf14\lang1040 +\par }{\f0\lang1040 Siamo arrivati alla versione 3.4 del MemoryManager\~! +\par Questa versione \'e8 anche in grado di gestire 1 UMB (Upper Memory Block), in modo da aumentare la quantit\'e0 di memoria accessibile direttamente. +\par Il nuovo MemoryManager v3.4 ha portato un nuovo errore, ancora un errore impossibile\~! +\par Quando si cerca di disegnare una texture presa dalla memoria superiore il 3D-Engine non riesce a disegnarla correttamente se non quando \'e8 estremamente vicina all\rquote osservatore. Questo problema pu\'f2 verificarsi solo a causa dell\rquote +elevato valore del segmento di un puntatore di memoria superiore, ma la cosa pi\'f9 strana \'e8 che nessuna routine di disegno usa in qualche modo il segmento in questione\~! Mi sono accertato che per quanto riguarda l\rquote offset (che invece \'e8 + usato) la situazione sia regolare (\'e8 lo \'e8, anche di pi\'f9 degli altri casi). +\par Questo sembra essere un\rquote altro problema non risolubile... +\par RISOLTO\~!\~!\~!\~! +\par E\rquote incredibile\~! C\rquote era un\rquote errore nelle routine di disegno dei muri\~!\~!\~!\~!\~! (in tutti i test non era MAI venuto fuori un errore di visualizzazione, ma forse non era quello lo scopo dei test) +\par Adesso funziona\~! +\par +\par }{\b\f0\fs28\cf12\lang1040 Configurare il computer per MM v3.4}{\f0\fs28\cf12\lang1040 +\par }{\f0\lang1040 Il nuovo motore del MemoryManager v3.4 pu\'f2 raggiungere alte quantit\'e0 di memoria solo per una configurazione ben precisa del computer. +\par La prima cosa da fare \'e8 disabilitare l\rquote uso da parte del DOS degli UMB [DOS=NOUMB (che \'e8 anche il default)]. +\par La seconda cosa da fare \'e8 che siano presenti entrambi i gestori di memoria XMS e EMS, in particolare la migliore configurazione per l\rquote Emm386 \'e8 NOEMS, ma va bene anche RAM. +\par +\par La configurazione ottima \'e8 pertanto (nel config.sys)\~: +\par +\par }{\f2\lang1040 DOS=HIGH +\par DEVICE=C:\\WINDOWS\\Himem.sys /TestMem:OFF +\par DEVICE=C:\\WINDOWS\\Emm386.exe NOEMS +\par }{\f0\lang1040 +\par (Questa configurazione va molto bene sia per Windows95 che per DOS, anche se in questo secondo caso si dovrebbe cambiare il nome della directory in C:\\DOS\\...) +\par +\par +\par }{\b\f0\fs28\lang1040 Texture Mapping: ce l\rquote ho.}{\f0\fs28\cf12\lang1040 +\par }{\f0\lang1040 Ho studiato un algoritmo ultraveloce per il texture mapping (esponenzialmente pi\'f9 veloce di quello usato da Federico). +\par Naturalmente tutto ci\'f2 non c\rquote entra niente con Kaos, ma stavolta si pu\'f2 fare qualcosa di veramente Ok. +\par Zac ha detto che mi avrebbe fatto provare il compilatore Watcom v11 che \'e8 in grado di compilare programmi in modalit\'e0 protetta full 32-bit\~ +(con il DOS4GW.EXE) !!! Se metti tutto questo a fianco ad una routine di texture mapping (progettata per i 32 bit) ottieni un motore grafico che \'e8 una bomba... e stavolta potrebbe essere un vero 3D\~! +\par Un altro problema che verrebbe superato \'e8 quello della modalit\'e0 grafica: oltre al fatto di poter gestire direttamente schede grafiche compatibili 3DFX (che non abbiamo, perci\'f2 chissene frega), }{\f0\ul\lang1040 potrebbe}{\f0\lang1040 essere pi +\'f9 semplice l\rquote uso della SuperVGA (in modalit\'e0 lineare). Ho momentaneamente scartato le DirectX perch\'e9 sono una grande rottura... e poi sembra che non diano gli stessi risultati su tutte le schede grafiche (mmah), ma forse controller\'f2 + la cosa personalmente. +\par L\rquote unico problema \'e8 che non so ancora come scrivere una routine di texture mapping con correzione prospettica... e ci\'f2 \'e8 grave, specialmente per un gioco 3D; se invece si parla di un gioco 2D, allora si pu\'f2 + fare, e credo che anche il gestore di memoria di Kaos vada bene... +\par Kaos \'e8 servito a qualcosa: +\par {\pntext\pard\plain\f3\fs20 \loch\af3\dbch\af0\hich\f3 \'b7\tab}}\pard \fi-283\li283\widctlpar{\*\pn \pnlvlblt\ilvl0\ls4\pnrnot0\pnf3\pnstart1\pnindent283\pnhang{\pntxtb \'b7}}\ls4\adjustright {\f0\lang1040 +ha una routine di gestione della tastiera veramente potente; +\par {\pntext\pard\plain\f3\fs20 \loch\af3\dbch\af0\hich\f3 \'b7\tab}}\pard \fi-283\li283\widctlpar{\*\pn \pnlvlblt\ilvl0\ls4\pnrnot0\pnf3\pnstart1\pnindent283\pnhang{\pntxtb \'b7}}\ls4\adjustright {\f0\lang1040 ha un gestore di memoria (segmentata) che pu\'f2 + essere portato anche sui 32bit, ma questa volta senza tutti gli inconvenienti della memoria XMS e degli UMB; +\par {\pntext\pard\plain\f3\fs20 \loch\af3\dbch\af0\hich\f3 \'b7\tab}}\pard \fi-283\li283\widctlpar{\*\pn \pnlvlblt\ilvl0\ls4\pnrnot0\pnf3\pnstart1\pnindent283\pnhang{\pntxtb \'b7}}\ls4\adjustright {\f0\lang1040 +ha un gestore di suoni 3D formidabile (per essere scritto in C); +\par {\pntext\pard\plain\f3\fs20 \loch\af3\dbch\af0\hich\f3 \'b7\tab}}\pard \fi-283\li283\widctlpar{\*\pn \pnlvlblt\ilvl0\ls4\pnrnot0\pnf3\pnstart1\pnindent283\pnhang{\pntxtb \'b7}}\ls4\adjustright {\f0\lang1040 ha un gestore d\rquote eventi che potr +ebbe essere utile altrove; +\par {\pntext\pard\plain\f3\fs20 \loch\af3\dbch\af0\hich\f3 \'b7\tab}}\pard \fi-283\li283\widctlpar{\*\pn \pnlvlblt\ilvl0\ls4\pnrnot0\pnf3\pnstart1\pnindent283\pnhang{\pntxtb \'b7}}\ls4\adjustright {\f0\lang1040 +ha due routine di compressione/decompressione simil-RLE (tipo .LBM) efficientissime (assembler puro); +\par {\pntext\pard\plain\f3\fs20 \loch\af3\dbch\af0\hich\f3 \'b7\tab}}\pard \fi-283\li283\widctlpar{\*\pn \pnlvlblt\ilvl0\ls4\pnrnot0\pnf3\pnstart1\pnindent283\pnhang{\pntxtb \'b7}}\ls4\adjustright {\f0\lang1040 ha una sottoroutine per lo shading che \'e8 + velocissima e non occupa memoria (anche se necessita della famosa palette ordinata); +\par {\pntext\pard\plain\f3\fs20 \loch\af3\dbch\af0\hich\f3 \'b7\tab}}\pard \fi-283\li283\widctlpar{\*\pn \pnlvlblt\ilvl0\ls4\pnrnot0\pnf3\pnstart1\pnindent283\pnhang{\pntxtb \'b7}}\ls4\adjustright {\f0\lang1040 h +a delle routine di trasferimento dati di altissimo livello. +\par }\pard \widctlpar{\*\pn \pnlvlcont\ilvl0\ls0\pnrnot0\pndec }\adjustright {\f0\lang1040 +\par HO CONTROLLATO (approssimativamente) la faccenda relativa alle DirectX e sono giunto alla momentanea conclusione che il problema principale arriva dalle Direct3D (che sfruttano i nuovi acceleratori 3D). Volendo scartare l\rquote uso delle Direct3D, si pu +\'f2 sempre ottenere un gioco in texture mapping, ma gli algoritmi bisogna farseli da soli; questa \'e8 anche la soluzione scelta per la versione beta di Quake2, ma spero che non sia per questo motivo che il gioco \'e8 rallentato. +\par TOTALE: il compilatore che ho va pi\'f9 che bene per fare un gioco usando le DirectX e soprattutto senza problemi di memoria; l\rquote unico guaio \'e8 che per fare un gioco con questo compilatore usando l\rquote assembler sar\'e0 + neessario che impari a lavorare in modalit\'e0 protetta... +\par +\par }\pard \widctlpar\box\brdrsh\brdrs\brdrw15\brsp20 \pvpara\posy0\dxfrtext141\dfrmtxtx141\dfrmtxty0{\*\pn \pnlvlcont\ilvl0\ls0\pnrnot0\pndec }\adjustright \shading500 {\b\f0\fs28\lang1040 DirectX: ultime notizie.}{\f0\fs28\lang1040 +\par }\pard \qj\widctlpar\box\brdrsh\brdrs\brdrw15\brsp20 \pvpara\posy0\dxfrtext141\dfrmtxtx141\dfrmtxty0{\*\pn \pnlvlcont\ilvl0\ls0\pnrnot0\pndec }\adjustright \shading500 {\f0\lang1040 Ho guardato le DirectX e sono giunto alla conclusione che sono +\ldblquote un invito alla programmazione di giochi\rdblquote (indipendentemente dalla velocit\'e0 effettiva del prodotto finale rispetto ad un equivalente gioco DOS). +\par Tutti i problemi avuti durante la progettazione e programmazione di Kaos verrebbero superati in un batter d\rquote occhio, e altri problemi sorgerebbero dove non ce ne dovrebbero essere. +\par }{\b\f0\lang1040 PROBLEMI RISOLTI: +\par {\pntext\pard\plain\f3\fs20 \loch\af3\dbch\af0\hich\f3 \'b7\tab}}\pard \qj\fi-283\li283\widctlpar\box\brdrsh\brdrs\brdrw15\brsp20 \pvpara\posy0\dxfrtext141\dfrmtxtx141\dfrmtxty0{\*\pn \pnlvlblt\ilvl0\ls4\pnrnot0\pnf3\pnstart1\pnindent283\pnhang +{\pntxtb \'b7}}\ls4\adjustright \shading500 {\b\i\f0\lang1040 Memoria}{\f0\lang1040 : con un\rquote applicazione progettata per WIN32 non i sono pi\'f9 problemi di memoria (se manca c\rquote \'e8 + quella virtuale), e lo stesso per quanto riguarda la modalit\'e0 protetta, dato che l\rquote assembler nel Visual C++ funziona quasi esclusivamente per la gestione e l\rquote ottimizzazione di procedure a 32 bit; +\par {\pntext\pard\plain\f3\fs20 \loch\af3\dbch\af0\hich\f3 \'b7\tab}}\pard \qj\fi-283\li283\widctlpar\box\brdrsh\brdrs\brdrw15\brsp20 \pvpara\posy0\dxfrtext141\dfrmtxtx141\dfrmtxty0{\*\pn \pnlvlblt\ilvl0\ls4\pnrnot0\pnf3\pnstart1\pnindent283\pnhang +{\pntxtb \'b7}}\ls4\adjustright \shading500 {\b\i\f0\lang1040 Risoluzione Video}{\f0\lang1040 : le DirectDraw premettono di gestire tutte le modalit\'e0 video pi\'f9 utili (persino quelle in modalit\'e0 + X...), comprese naturalmente tutte quelle della SVGA con linear framebuffer, etc. +\par {\pntext\pard\plain\f3\fs20 \loch\af3\dbch\af0\hich\f3 \'b7\tab}}\pard \qj\fi-283\li283\widctlpar\box\brdrsh\brdrs\brdrw15\brsp20 \pvpara\posy0\dxfrtext141\dfrmtxtx141\dfrmtxty0{\*\pn \pnlvlblt\ilvl0\ls4\pnrnot0\pnf3\pnstart1\pnindent283\pnhang +{\pntxtb \'b7}}\ls4\adjustright \shading500 {\b\i\f0\lang1040 Palette}{\f0\lang1040 : lo shading \'e8 gestito direttamente dalle DirectX, ma questa cosa potrebbe non essere necessaria; +\par {\pntext\pard\plain\f3\fs20 \loch\af3\dbch\af0\hich\f3 \'b7\tab}}\pard \qj\fi-283\li283\widctlpar\box\brdrsh\brdrs\brdrw15\brsp20 \pvpara\posy0\dxfrtext141\dfrmtxtx141\dfrmtxty0{\*\pn \pnlvlblt\ilvl0\ls4\pnrnot0\pnf3\pnstart1\pnindent283\pnhang +{\pntxtb \'b7}}\ls4\adjustright \shading500 {\b\i\f0\lang1040 MIDI}{\f0\lang1040 : \'e8 sicuramente la cosa pi\'f9 facile da risolvere, perch\'e9 bastano due chiamate ai driver MCI di Windows95 ed \'e8 tutto fatto; da notare che il problema pi\'f9 + grosso sotto DOS \'e8 quello pi\'f9 insignificante sotto Windows95; +\par {\pntext\pard\plain\f3\fs20 \loch\af3\dbch\af0\hich\f3 \'b7\tab}}\pard \qj\fi-283\li283\widctlpar\box\brdrsh\brdrs\brdrw15\brsp20 \pvpara\posy0\dxfrtext141\dfrmtxtx141\dfrmtxty0{\*\pn \pnlvlblt\ilvl0\ls4\pnrnot0\pnf3\pnstart1\pnindent283\pnhang +{\pntxtb \'b7}}\ls4\adjustright \shading500 {\b\i\f0\lang1040 Suoni3D}{\f0\lang1040 : oltre naturalmente a tutti i vantaggi offerti dalle DirectSound per il suono mixato multicanale, c\rquote \'e8 naturalmente l\rquote +enorme vantaggio del calcolo automatico degli effetti 3D effettuato dalle stesse procedure; +\par {\pntext\pard\plain\f3\fs20 \loch\af3\dbch\af0\hich\f3 \'b7\tab}}\pard \qj\fi-283\li283\widctlpar\box\brdrsh\brdrs\brdrw15\brsp20 \pvpara\posy0\dxfrtext141\dfrmtxtx141\dfrmtxty0{\*\pn \pnlvlblt\ilvl0\ls4\pnrnot0\pnf3\pnstart1\pnindent283\pnhang +{\pntxtb \'b7}}\ls4\adjustright \shading500 {\b\i\f0\lang1040 Controlli}{\f0\lang1040 : con le DirectInput \'e8 possibile gestire facilmente Tastiera (come gi\'e0 + facevo io), Mouse (come si sarebbe potuto fare), Joystick (come avrei potuto fare io se ne avessi comprato uno per fare un test), etc. +\par {\pntext\pard\plain\f3\fs20 \loch\af3\dbch\af0\hich\f3 \'b7\tab}}\pard \qj\fi-283\li283\widctlpar\box\brdrsh\brdrs\brdrw15\brsp20 \pvpara\posy0\dxfrtext141\dfrmtxtx141\dfrmtxty0{\*\pn \pnlvlblt\ilvl0\ls4\pnrnot0\pnf3\pnstart1\pnindent283\pnhang +{\pntxtb \'b7}}\ls4\adjustright \shading500 {\b\i\f0\lang1040 MultiPlayer}{\f0\lang1040 : a quanto pare le DirectPlay possono gestire giocatori in rete e connessi via modem senza troppa fatica, ma sinceramente non mi sono documentato troppo; +\par {\pntext\pard\plain\f3\fs20 \loch\af3\dbch\af0\hich\f3 \'b7\tab}}\pard \qj\fi-283\li283\widctlpar\box\brdrsh\brdrs\brdrw15\brsp20 \pvpara\posy0\dxfrtext141\dfrmtxtx141\dfrmtxty0{\*\pn \pnlvlblt\ilvl0\ls4\pnrnot0\pnf3\pnstart1\pnindent283\pnhang +{\pntxtb \'b7}}\ls4\adjustright \shading500 {\b\i\f0\lang1040 Texture mapping}{\f0\lang1040 : \'e8 inutile dire che le Direct3D forniscono tutto ci\'f2 che serve per gestire il 3D, ma la cosa pi\'f9 interessante \'e8 che ci sono due modalit\'e0 + di utilizzo delle Direct3D: \ldblquote immediate\rdblquote per utilizzare tutte le routine a basso livello (non proprio basso...) e \ldblquote retained\rdblquote per gestire le cose a livell \lquote +e megabait senza il bisogno di scrivere il 3D engine (non credo per\'f2 che il risparmio in questo senso porti a qualcosa di positivo); +\par {\pntext\pard\plain\f3\fs20 \loch\af3\dbch\af0\hich\f3 \'b7\tab}}\pard \qj\fi-283\li283\widctlpar\box\brdrsh\brdrs\brdrw15\brsp20 \pvpara\posy0\dxfrtext141\dfrmtxtx141\dfrmtxty0{\*\pn \pnlvlblt\ilvl0\ls4\pnrnot0\pnf3\pnstart1\pnindent283\pnhang +{\pntxtb \'b7}}\ls4\adjustright \shading500 {\b\i\f0\lang1040 MOD Player}{\f0\lang1040 : per questo il problema \'e8 + ancora grande, ma una volta superato lo scoglio della gestione della memoria e dei suoni mixati allora si riduce tutto ad una semplice decodifica del formato audio; +\par {\pntext\pard\plain\f3\fs20 \loch\af3\dbch\af0\hich\f3 \'b7\tab}}\pard \qj\fi-283\li283\widctlpar\box\brdrsh\brdrs\brdrw15\brsp20 \pvpara\posy0\dxfrtext141\dfrmtxtx141\dfrmtxty0{\*\pn \pnlvlblt\ilvl0\ls4\pnrnot0\pnf3\pnstart1\pnindent283\pnhang +{\pntxtb \'b7}}\ls4\adjustright \shading500 {\b\i\f0\lang1040 Progettazione 3D}{\f0\lang1040 : le strutture dati delle Direct3D sono compatibili (previa conversione di formato) con quelle del 3DStudio, senza nessuna modifica, anche per le texture (credo). + +\par }\pard \qj\widctlpar\box\brdrsh\brdrs\brdrw15\brsp20 \pvpara\posy0\dxfrtext141\dfrmtxtx141\dfrmtxty0{\*\pn \pnlvlcont\ilvl0\ls0\pnrnot0\pndec }\adjustright \shading500 {\b\f0\lang1040 PROBLEMI DA CONSIDERARE (ANCORA...): +\par {\pntext\pard\plain\f3\fs20 \loch\af3\dbch\af0\hich\f3 \'b7\tab}}\pard \qj\fi-283\li283\widctlpar\box\brdrsh\brdrs\brdrw15\brsp20 \pvpara\posy0\dxfrtext141\dfrmtxtx141\dfrmtxty0{\*\pn \pnlvlblt\ilvl0\ls4\pnrnot0\pnf3\pnstart1\pnindent283\pnhang +{\pntxtb \'b7}}\ls4\adjustright \shading500 {\b\i\f0\lang1040 Controllo frames}{\f0\lang1040 : credo che ci siano delle procedure gi\'e0 pronte atte allo scopo, ma non le ho ancora viste; +\par {\pntext\pard\plain\f3\fs20 \loch\af3\dbch\af0\hich\f3 \'b7\tab}}\pard \qj\fi-283\li283\widctlpar\box\brdrsh\brdrs\brdrw15\brsp20 \pvpara\posy0\dxfrtext141\dfrmtxtx141\dfrmtxty0{\*\pn \pnlvlblt\ilvl0\ls4\pnrnot0\pnf3\pnstart1\pnindent283\pnhang +{\pntxtb \'b7}}\ls4\adjustright \shading500 {\b\i\f0\lang1040 Gestione degli eventi di gioco}{\f0\lang1040 : \'e8 possibile che si debba utilizzare il gestore d\rquote +eventi del sistema operativo... e non credo che sia una cosa positiva, almeno per un programmatore DOS; +\par {\pntext\pard\plain\f3\fs20 \loch\af3\dbch\af0\hich\f3 \'b7\tab}}\pard \qj\fi-283\li283\widctlpar\box\brdrsh\brdrs\brdrw15\brsp20 \pvpara\posy0\dxfrtext141\dfrmtxtx141\dfrmtxty0{\*\pn \pnlvlblt\ilvl0\ls4\pnrnot0\pnf3\pnstart1\pnindent283\pnhang +{\pntxtb \'b7}}\ls4\adjustright \shading500 {\b\i\f0\lang1040 Gestione dei processi}{\f0\lang1040 : potrebbe essere necessario usare le GUI di Windows95 per effettuare le impostazioni di gioco, e ci\'f2 \'e8 + molto difficile per me a meno di non passare per le Microsoft Foundation Classes (MFC), ma in questo caso si avrebbe un gioco enorme (le MFC occupano spazio, anche se possono esse +re usate come librerie dinamiche); una cosa molto utile potrebbe essere il salvataggio del gioco... ma non credo che si debbano scomodare le MFC per questo (o almeno \'e8 quello che penso ora...); +\par {\pntext\pard\plain\f3\fs20 \loch\af3\dbch\af0\hich\f3 \'b7\tab}}\pard \qj\fi-283\li283\widctlpar\box\brdrsh\brdrs\brdrw15\brsp20 \pvpara\posy0\dxfrtext141\dfrmtxtx141\dfrmtxty0{\*\pn \pnlvlblt\ilvl0\ls4\pnrnot0\pnf3\pnstart1\pnindent283\pnhang +{\pntxtb \'b7}}\ls4\adjustright \shading500 {\b\i\f0\lang1040 Il Gioco}{\f0\lang1040 : che tipo di gioco ci servir\'e0 ? 2D o 3D\~? In caso di \ldblquote 3D\rdblquote , riuscir\'f2 mai a far funzionare le Direct3D in Immediate Mode\~ +con il mio 3D engine ? Chi si occuper\'e0 di disegnare tonnellate di immagini anche in alta risoluzione se necessario\~? Chi far\'e0 i suoni e/o le musiche\~? Comincio veramente a pensare che la programmazione del gioco sia ora la parte pi\'f9 + facile.\line Vuoi diventare anche tu programmatore del nuovo gioco\~? Unisciti ai Windo-boys, ma poi il resto chi lo fa\~?. +\par }\pard \widctlpar\adjustright {\f0\lang1040 +\par +\par }\pard \widctlpar\tx6674\adjustright {\f1\lang1040 \tab }{\pard\plain \widctlpar\tx6674\adjustright \f1\fs20\lang1040 {\object\objemb\objw570\objh380{\*\objclass Word.Picture.8}{\*\objdata 01050000020000000f000000576f72642e506963747572652e380000000000 +0000000000660000 +d0cf11e0a1b11ae1000000000000000000000000000000003e000300feff0900060000000000000000000000010000000100000000000000001000000200000001000000feffffff0000000000000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +fffffffffffffffffdffffff0c000000feffffff0d00000005000000060000000700000008000000090000000a0000000b000000feffffff180000000e0000000f000000feffffff11000000120000001300000014000000150000001600000017000000feffffff290000001a0000001b0000001c0000001d0000001e00 +00001f00000020000000feffffff22000000230000002400000025000000260000002700000028000000fefffffffeffffff2b0000002c0000002d0000002e0000002f0000003000000031000000feffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffff52006f006f007400200045006e00740072007900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000016000500ffffffffffffffff040000000709020000000000c00000000000004600000000000000000000000020f0 +f66f59e9c10103000000400700000000000001004f006c00650000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a000201ffffffffffffffffffffffff00000000000000000000000000000000000000000000000000000000 +0000000000000000000000001400000000000000030050004900430000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a0002010100000003000000ffffffff0000000000000000000000000000000000000000000000000000 +00000000000000000000010000004c00000000000000440061007400610000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a000201ffffffffffffffffffffffff000000000000000000000000000000000000000000000000 +000000000000000000000000040000000010000000000000feffffff02000000feffffff0400000005000000060000000700000008000000090000000a0000000b0000000c0000000d0000000e0000000f000000100000001100000012000000130000001400000015000000160000001700000018000000feffffff1a00 +0000fefffffffefffffffeffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff010000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004c0000000000000001040800ed0300009e0200003a0200007c0100000000 +0000000000000000000000000000e8030000e8030000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800ed039e020000010009000003a00200000300c201000000001400 +000026060f001e00ffffffff040014000000576f72640e004d6963726f736f667420576f7264050000000b0200000000050000000c0226005f000d000000fb02000000000000000000000000000000000001000c040000002d010000040000000201010015000000fb02ecff000000000000900100000000040000125469 +6d6573204e657720526f6d616e003475040000002d01010005000000090200000000040000000201010004000000020101000400000002010100030000001e0007000000160427005f0000000000040000000201010010000000fb02ecff00000000000090010000000004000022417269616c00ac81040000002d010200 +030000001e0007000000160426005f0000000000030000001e00070000001204260025005f005e001004000044000800f803a5020000000000000000000000000000000040028001d303c9030000000000000000200400000000000000000000000000000000000000000000010009000003e60100000000c20100000000 +050000000b0200000000050000000c022000300005000000090200000000050000000102ffffff000400000007010300c2010000430f2000cc000000200030000000000020003000000000002800000030000000200000000100040000000000000300000000000000000000100000001000000000000000000080000080 +000000808000800000008000800080800000c0c0c000808080000000ff0000ff000000ffff00ff000000ff00ff00ffff0000ffffff00ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0ffff00000fffffffffffffffffffffffffffffffffffff078000777770fffffffffffffffffff +ffffffffffffffff07077778000078ffffffffffffffffffffffffffffffffff870000000000078fffffffffffffffffffffffff0000000ff8700087f7800070f00000fffffffffffffffff077777770ff877888877000f08777770ffffffffffffffff0700000878f088000087000f878000878ffffffffffffffff8780 +0008708700000f7008f7000000878ffffffffffffffff8700000f87000008f7007f80000000f7ffffffffffffffff8780000f870000077800f7008ffff8f7fffffffffffffffff870000f7000000f7000f700ff777f7ffffffffffffffffff870008f7000000f7000f700ff70078ffffffffffffffffff87000f70007000 +f7000f7008f700078fffffffffffffffff87000f70007000f7000ff80077700f7fffffffffffffffff87008700077000f70007f70000008f7fffffffffffff00ff070077000770007f7000f0780008f7fffffffffffff0770f07007000f870008f77778f07ffff7ffffffffffffff8707007007000f870008f70077ff887 +77ffffffffffffffff87070700000f8870000f700f7fffffffffffffffffffffff07087700000f8870000f77ff7fffffffffffffffffffffff0700f70000f8f870000ff777fffffffffffffffffffffff07808780000f7f070000f7ffffffffffffffffffffffffff0700f70000f8ff070008f7fffffffffffffffffffff +fffff8700770008f7f0070008f7ffffffffffffffffffffffffff878000000f7f0770008f7ffffffffffffffffffffffffffff8780008f7f0700088f7ffffffffffffffffffffffffffffff87ffff7fff87ffff7ffffffffffffffffffffffffffffffff87777fffff87777fffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff030000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003004d00450054004100000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000000000000000000000000c0002010200000008000000ffffffff00000000000000000000000000000000000000000000000000000000000000000000000003000000480500000000000031005400610062006c0065000000000000000000 +00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000e000201ffffffffffffffffffffffff000000000000000000000000000000000000000000000000000000000000000000000000100000000010000000000000010043006f006d0070004f0062006a000000 +00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000120002000500000007000000ffffffff00000000000000000000000000000000000000000000000000000000000000000000000019000000690000000000000003004f0062006a0049006e0066006f00 +00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000012000201ffffffffffffffffffffffff0000000000000000000000000000000000000000000000000000000000000000000000001b0000000400000000000000050000000c0225005e0005000000 +0b0200000000050000000b0200000000050000000c0220003000050000000b020000000005000000090200000000050000000102ffffff000400000007010300c2010000430f2000cc0000002000300000000000200030000000000028000000300000002000000001000400000000000003000000000000000000001000 +00001000000000000000000080000080000000808000800000008000800080800000c0c0c000808080000000ff0000ff000000ffff00ff000000ff00ff00ffff0000ffffff00ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0ffff00000ffffffffffffffffffffffffffffffffffff +f078000777770fffffffffffffffffffffffffffffffffff07077778000078ffffffffffffffffffffffffffffffffff870000000000078fffffffffffffffffffffffff0000000ff8700087f7800070f00000fffffffffffffffff077777770ff877888877000f08777770ffffffffffffffff0700000878f0880000870 +00f878000878ffffffffffffffff87800008708700000f7008f7000000878ffffffffffffffff8700000f87000008f7007f80000000f7ffffffffffffffff8780000f870000077800f7008ffff8f7fffffffffffffffff870000f7000000f7000f700ff777f7ffffffffffffffffff870008f7000000f7000f700ff70078 +ffffffffffffffffff87000f70007000f7000f7008f700078fffffffffffffffff87000f70007000f7000ff80077700f7fffffffffffffffff87008700077000f70007f70000008f7fffffffffffff00ff070077000770007f7000f0780008f7fffffffffffff0770f07007000f870008f77778f07ffff7fffffffffffff +f8707007007000f870008f70077ff88777ffffffffffffffff87070700000f8870000f700f7fffffffffffffffffffffff07087700000f8870000f77ff7fffffffffffffffffffffff0700f70000f8f870000ff777fffffffffffffffffffffff07808780000f7f070000f7ffffffffffffffffffffffffff0700f70000f +8ff070008f7ffffffffffffffffffffffffff8700770008f7f0070008f7ffffffffffffffffffffffffff878000000f7f0770008f7ffffffffffffffffffffffffffff8780008f7f0700088f7ffffffffffffffffffffffffffffff87ffff7fff87ffff7ffffffffffffffffffffffffffffffff87777fffff87777fffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff040000002701ffff040000002701ffff040000002d0101000400000002010100040000002701ffff04000000 +2d01000003000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100feff030a0000ffffffff0709020000000000c00000000000004618000000496d6d6167696e65204d6963726f736f667420576f7264000a000000 +4d53576f7264446f63000f000000576f72642e506963747572652e3800f439b271000000000000000000000000000000000000000000000000000000000000000000000000000300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +000000000000000000000400000001000000ffffffff0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000012000f000a0001005b000f00020000000000000026000040f1ff02002600000007004e006f0072006d0061006c00650000000200000004006d4810040000000000000000000000000000000000004e004140f2ffa1004e0000001f00430061007200610074007400650072006500200070007200 +650064006500660069006e00690074006f002000700061007200610067007200610066006f0000000000000000000000000000000000030000000700000001000000000000000000ffffffff020400000000000001000000000000000000ffffffff0000000000000000000000000300000006000000000000000000ffff +0000000000000000070000000600000c00000000ffffffff010000000420ffff01000000000000000000070000000000000000000004000007040000030000000004000007040000040000000004000006040000050000000f0000f038000000000006f01800000003040000020000000200000001000000010000000300 +000040001ef110000000ffff00000000ff0080808000f7000010000f0002f00c010000100008f00800000002000000020400000f0003f0aa0000000f0004f028000000010009f0100000000000000000000000000000000000000002000af00800000000040000050000000f0004f07200000012000af008000000020400 +00000a000093000bf036000000800000000100810000000000820000000000830000000000840000000000bf0100001000cb0100000000ff01000008003f0200000200000010f00400000000000000000011f0040000000100000000000df004000000000001000f0004f04200000012000af00800000001040000000e00 +0053000bf01e000000bf0100001000cb0100000000ff01000008000403090000003f0301000100000011f0040000000100000000000000070000000204000045260000a52600007b2800001b2800006a000000000000000000020000000800000007000700ff404550534f4e205374796c757320434f4c4f522037343020 +2855534229004550555342313a004550494a4e4c3230004550534f4e205374796c757320434f4c4f5220373430004550534f4e205374796c757320434f4c4f52203734302028555342290000000000042602940026010f8b8007010009009a0b340800000100070068010200000068010000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000200000001000000200100000000000000000000444c4c4e616d6531363d455049475545334e2e444c4c00000000000000000000444c4c4e616d6533323d45504944413233302e444c4c00000000 +0000000000004550534f4e205374796c757320434f4c4f522037343000000000000000000000000302006801680101000000000000000001000009004c0b810f4c0b810f640068016801a00b71102a002a002a00c600a00b71102a002a002a00c600000000001400000000000000000032000000ff000000000000000000 +0000000001000000000003000000010000000000010004000600020000000000000002000000000000000000000000000400000000000000000000000000000000000000000000000000000034089a0b0100000000000000000000000000000000000000000000000000000000004550534f4e205374796c757320434f4c +4f52203734302028555342290000000000042602940026010f8b8007010009009a0b3408000001000700680102000000680100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000200000001000000200100000000 +000000000000444c4c4e616d6531363d455049475545334e2e444c4c00000000000000000000444c4c4e616d6533323d45504944413233302e444c4c000000000000000000004550534f4e205374796c757320434f4c4f522037343000000000000000000000000302006801680101000000000000000001000009004c0b +810f4c0b810f640068016801a00b71102a002a002a00c600a00b71102a002a002a00c600000000001400000000000000000032000000ff0000000000000000000000000001000000000003000000010000000000010004000600020000000000000002000000000000000000000000000400000000000000000000000000 +000000000000000000000000000034089a0b010000000000000000000000000000000000000000000000000000000000008001000000000000000000083c13010000000000000000000000000000000000000000021000000000000000070000006000000800400000030000004716900100000202060305040502030403 +0000000000000000000000000000000100000000000000540069006d006500730020004e0065007700200052006f006d0061006e00000035169001020005050102010706020507000000000000001000000000000000000000008000000000530079006d0062006f006c000000332690010000020b060402020202020403 +000000000000000000000000000000010000000000000041007200690061006c00000022000400f10888180000c40200001b010000000072ec2606cdac6406000000000300000000000000000001000000010001000000040083100100000000000000000000000100010000000100000000000000210300000084000000 +000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a506c007b400b40080001230000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +00000000000000000000000000000000000000000000000000020000006502ffff120000000000000000000000000000000b00530063006f006e006f00730063006900750074006f0003004e006a006300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004f0062006a0065006300740050006f006f006c000000000000000000000000000000000000000000000000000000000000000000 +00000000000000000000000016000101060000000a000000ffffffff000000000000000000000000000000000000000020f0f66f59e9c10120f0f66f59e9c10100000000000000000000000002004f006c006500500072006500730030003000300000000000000000000000000000000000000000000000000000000000 +000000000000000000000000000018000201ffffffffffffffffffffffff0000000000000000000000000000000000000000000000000000000000000000000000001c000000240000000000000057006f007200640044006f00630075006d0065006e007400000000000000000000000000000000000000000000000000 +000000000000000000000000000000001a000200090000000b000000ffffffff0000000000000000000000000000000000000000000000000000000000000000000000001900000000100000000000000500530075006d006d0061007200790049006e0066006f0072006d006100740069006f006e000000000000000000 +00000000000000000000000000000000000028000201ffffffff0c000000ffffffff000000000000000000000000000000000000000000000000000000000000000000000000210000000010000000000000eca5c1005900100400000812bf000000000000100000000000040000070400000e00626a626af357f3570000 +00000000000000000000000000000000100416001e0c0000913d0100913d01000200000000000000000000000000000000000000000000000400000000000000ffff0f000000000000000000ffff0f000000000000000000ffff0f00000000000000000000000000000000005d0000000000a600000000000000a6000000 +a600000000000000a600000000000000f600000000000000f600000000000000f60000001400000000000000000000002601000000000000260100000000000026010000000000002601000000000000260100000c000000320100000c0000002601000000000000c5060000b60000004a010000000000004a0100000000 +00004a010000000000004a010000000000004a01000000000000c102000000000000c102000000000000c102000000000000d102000002000000d302000000000000d302000000000000d30200004500000018030000ba010000d2040000ba0100008c060000240000007b070000f40100006f09000046000000b0060000 +1500000000000000000000000000000000000000f600000000000000c102000000000000000000000000000000000000000000009f02000022000000c102000000000000c102000000000000c102000000000000b006000000000000d102000000000000a600000000000000a6000000000000004a010000000000000000 +0000000000004a010000550100004a01000000000000d102000000000000d102000000000000d102000000000000c102000010000000a6000000380000004a01000000000000f6000000000000004a01000000000000d102000000000000000000000000000000000000000000000a0100000e000000180100000e000000 +a600000000000000a600000000000000a600000000000000a600000000000000c102000000000000d102000000000000d102000000000000d1020000000000000000000000000000d102000000000000de00000018000000f600000000000000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000d1020000000000004a010000000000003e0100000c000000c01a67f057e9c10126010000000000002601000000000000d102000000000000d102000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080d010d0d0d0d000000000000000000000000000000000000000000 +000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000001040000020400000304000007040000 +f800ef000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000011036a000000004f4a0200514a02005508010d036a000000005508016d4800040004000400000204000004040000 +050400000604000007040000fd000000000000000000000000fd000000000000000000000000fd000000000000000000000000fd000000000000000000000000fd00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000500040000 +0204000006040000fefe0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +020101021c001fb0c04e20b0c04e21b0452622b046262390a5262490a62625b000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000feff0000040a02000000000000000000000000000000000001000000e0859ff2f94f6810ab9108002b27b3d9300000007c01000012000000010000009800000002000000a000000003000000ac00000004000000b800000005000000cc00000006000000d80000000700 +0000e400000008000000f8000000090000000401000012000000100100000a0000002c0100000b000000380100000c000000440100000d000000500100000e0000005c0100000f00000064010000100000006c010000130000007401000002000000e40400001e00000001000000000073001e0000000100000000007300 +1e0000000c00000053636f6e6f73636975746f001e0000000100000000636f6e1e0000000100000000636f6e1e0000000b0000004e6f726d616c2e646f7400001e000000040000004e6a63001e00000002000000330063001e000000130000004d6963726f736f667420576f726420382e30000040000000000000000000 +00004000000000000000000000004000000000c4769275a3bd01400000000076cac957e9c10103000000010000000300000000000000030000000100000003000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000050044006f00630075006d0065006e007400530075006d006d0061007200790049006e0066006f007200 +6d006100740069006f006e000000000000000000000038000200ffffffffffffffffffffffff0000000000000000000000000000000000000000000000000000000000000000000000002a000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +00000000000000000000000000000000000000000000000000000000ffffffffffffffffffffffff0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +000000000000000000000000000000000000000000000000000000000000ffffffffffffffffffffffff000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000ffffffffffffffffffffffff000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000feff0000040a0200000000000000000000000000000000000200000002d5cdd59c2e +1b10939708002b2cf9ae4400000005d5cdd59c2e1b10939708002b2cf9ae4c010000080100000d00000001000000700000000f000000780000000400000084000000050000008c0000000600000094000000110000009c00000017000000a40000000b000000ac00000010000000b400000013000000bc00000016000000 +c40000000d000000cc0000000c000000d900000002000000e40400001e000000010000000000000003000000002c0000030000000100000003000000010000000300000001000000030000006a1008000b000000000000000b000000000000000b000000000000000b000000000000001e1000000100000001000000000c +100000040000001e000000060000005469746c650003000000010000001e00000001000000000300000000000000980000000300000000000000200000000100000036000000020000003e00000001000000020000000a0000005f5049445f475549440002000000e4040000410000004e0000007b004300440043003100 +37003100380030002d0035003500350042002d0031003100440036002d0042003600460034002d004300440032003900420030004100450039003700310046007d00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +00000000000000000000000000000000000000000000000000000000000001050000050000000d0000004d45544146494c455049435400ed03000062fdffff480500000800ed039e020000 +010009000003a00200000300c201000000001400000026060f001e00ffffffff040014000000576f72640e004d6963726f736f667420576f7264050000000b0200000000050000000c0226005f000d000000fb02000000000000000000000000000000000001000c040000002d010000040000000201010015000000fb02 +ecff0000000000009001000000000400001254696d6573204e657720526f6d616e003475040000002d01010005000000090200000000040000000201010004000000020101000400000002010100030000001e0007000000160427005f0000000000040000000201010010000000fb02ecff000000000000900100000000 +04000022417269616c00ac81040000002d010200030000001e0007000000160426005f0000000000030000001e00070000001204260025005f005e00050000000c0225005e00050000000b0200000000050000000b0200000000050000000c0220003000050000000b020000000005000000090200000000050000000102 +ffffff000400000007010300c2010000430f2000cc000000200030000000000020003000000000002800000030000000200000000100040000000000000300000000000000000000100000001000000000000000000080000080000000808000800000008000800080800000c0c0c000808080000000ff0000ff000000ff +ff00ff000000ff00ff00ffff0000ffffff00ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0ffff00000fffffffffffffffffffffffffffffffffffff078000777770fffffffffffffffffffffffffffffffffff07077778000078ffffffffffffffffffffffffffffffffff87000000 +0000078fffffffffffffffffffffffff0000000ff8700087f7800070f00000fffffffffffffffff077777770ff877888877000f08777770ffffffffffffffff0700000878f088000087000f878000878ffffffffffffffff87800008708700000f7008f7000000878ffffffffffffffff8700000f87000008f7007f80000 +000f7ffffffffffffffff8780000f870000077800f7008ffff8f7fffffffffffffffff870000f7000000f7000f700ff777f7ffffffffffffffffff870008f7000000f7000f700ff70078ffffffffffffffffff87000f70007000f7000f7008f700078fffffffffffffffff87000f70007000f7000ff80077700f7fffffff +ffffffffff87008700077000f70007f70000008f7fffffffffffff00ff070077000770007f7000f0780008f7fffffffffffff0770f07007000f870008f77778f07ffff7ffffffffffffff8707007007000f870008f70077ff88777ffffffffffffffff87070700000f8870000f700f7fffffffffffffffffffffff070877 +00000f8870000f77ff7fffffffffffffffffffffff0700f70000f8f870000ff777fffffffffffffffffffffff07808780000f7f070000f7ffffffffffffffffffffffffff0700f70000f8ff070008f7ffffffffffffffffffffffffff8700770008f7f0070008f7ffffffffffffffffffffffffff878000000f7f0770008 +f7ffffffffffffffffffffffffffff8780008f7f0700088f7ffffffffffffffffffffffffffffff87ffff7fff87ffff7ffffffffffffffffffffffffffffffff87777fffff87777fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff040000002701ffff040000002701ffff040000002d0101000400000002010100040000002701ffff040000002d010000030000000000}{\result {\f1\lang1040 +{\pict{\*\picprop\shplid1028{\sp{\sn shapeType}{\sv 75}}{\sp{\sn fFlipH}{\sv 0}}{\sp{\sn fFlipV}{\sv 0}}{\sp{\sn fillColor}{\sv 268435473}}{\sp{\sn fFilled}{\sv 0}}{\sp{\sn fLine}{\sv 0}}}\picscalex100\picscaley100\piccropl0\piccropr0\piccropt0\piccropb0 +\picw1005\pich670\picwgoal570\pichgoal380\wmetafile8\bliptag-286419272\blipupi201{\*\blipuid eeed96b8c22cb974ac7de50a78881d0f}010009000003a00200000300c201000000001400000026060f001e00ffffffff040014000000576f72640e004d6963726f736f667420576f7264050000000b02 +00000000050000000c0226005f000d000000fb02000000000000000000000000000000000001000c040000002d010000040000000201010015000000fb02ecff +0000000000009001000000000400001254696d6573204e657720526f6d616e003475040000002d01010005000000090200000000040000000201010004000000 +020101000400000002010100030000001e0007000000160427005f0000000000040000000201010010000000fb02ecff00000000000090010000000004000022 +417269616c00ac81040000002d010200030000001e0007000000160426005f0000000000030000001e00070000001204260025005f005e00050000000c022500 +5e00050000000b0200000000050000000b0200000000050000000c0220003000050000000b020000000005000000090200000000050000000102ffffff000400 +000007010300c2010000430f2000cc00000020003000000000002000300000000000280000003000000020000000010004000000000000030000000000000000 +0000100000001000000000000000000080000080000000808000800000008000800080800000c0c0c000808080000000ff0000ff000000ffff00ff000000ff00 +ff00ffff0000ffffff00ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0ffff00000ffffffffffffffffffffffffffffffff +fffff078000777770fffffffffffffffffffffffffffffffffff07077778000078ffffffffffffffffffffffffffffffffff870000000000078fffffffffffff +ffffffffffff0000000ff8700087f7800070f00000fffffffffffffffff077777770ff877888877000f08777770ffffffffffffffff0700000878f0880000870 +00f878000878ffffffffffffffff87800008708700000f7008f7000000878ffffffffffffffff8700000f87000008f7007f80000000f7ffffffffffffffff878 +0000f870000077800f7008ffff8f7fffffffffffffffff870000f7000000f7000f700ff777f7ffffffffffffffffff870008f7000000f7000f700ff70078ffff +ffffffffffffff87000f70007000f7000f7008f700078fffffffffffffffff87000f70007000f7000ff80077700f7fffffffffffffffff87008700077000f700 +07f70000008f7fffffffffffff00ff070077000770007f7000f0780008f7fffffffffffff0770f07007000f870008f77778f07ffff7ffffffffffffff8707007 +007000f870008f70077ff88777ffffffffffffffff87070700000f8870000f700f7fffffffffffffffffffffff07087700000f8870000f77ff7fffffffffffff +ffffffffff0700f70000f8f870000ff777fffffffffffffffffffffff07808780000f7f070000f7ffffffffffffffffffffffffff0700f70000f8ff070008f7f +fffffffffffffffffffffffff8700770008f7f0070008f7ffffffffffffffffffffffffff878000000f7f0770008f7ffffffffffffffffffffffffffff878000 +8f7f0700088f7ffffffffffffffffffffffffffffff87ffff7fff87ffff7ffffffffffffffffffffffffffffffff87777fffff87777fffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffff040000002701ffff040000002701ffff040000002d0101000400000002010100040000002701ffff040000002d010000030000000000 +0000000000000000000000000000000000000000000000000000000000000000000000000000000000d7d7a800090901000f0f070000090900000000000f0f0f000f0f0f00000000}}}}}{\f1\lang1040 +\par }{\f1\fs16\lang1040 +\par +\par +\par +\par }} \ No newline at end of file diff --git a/Documentazione/Testi/Kaos_1.nic b/Documentazione/Testi/Kaos_1.nic new file mode 100644 index 0000000..0b0b182 --- /dev/null +++ b/Documentazione/Testi/Kaos_1.nic @@ -0,0 +1,187 @@ +No more betas ! + +No more numbers ! + + This is The Real KAOS + " á " + + + " This is the game of the light (light, ight, ght) + All right ? Oh, yeah (eah) + This is the version of the MIGHT (Might, Ight, Ght) " + +--------- +2 versioni: + in KAOS_1.EXE: KAOS1.EXE - usa il .BDF + in KAOS_1M.EXE: KAOSM.EXE - usa i .LBM e .WAV e crea il .BDF +--------- + +* C'Š qualcosa che non va con i flash quando si raccolgono gli oggetti ? + Non si riesce a giocare quando si raccolgono troppe cose in fretta ? + SŤ !? Ma a noi non ce ne frega niente ! + PerchŠ ?! Ma Š semplice, "L'ORO ACCECA" (qualcosa dovr… pur succedere + mentre uno si distrae a raccogliere qualcosa, no !?) + +* La traiettoria della mano non ti piace ? + Si pu• cambiare... ma cosŤ si risparmia + +* Il fattore di accecamento quando vieni colpito dai ragni si deve ancora + aggiustare (ma se va bene...) + a proposito, mi serve l'animazione dello sparo del ragno (vedi "BALLS.LBM") + per adesso l'ho impostata a 4 immagini visualizzate ciclicamente + 1ř 2ř + 3ř 4ř + +* Lo Slimer e il ragno hanno tutto quello che serve... vedi se va bene + +* Credo che si debbano stilizzare un p• di pi— i numeri dei punteggi + +* Come va il multi-Player ? Boo ? Ma credo di aver risolto il problema dei + suoni 3D (trasformandoli in NON-3D); + Non posso fare in modo di giocare nelle sembianze di un mostro, perchŠ + dovrei aumntare la complessit… degli oggetti-mostro per funzionare in + modo fluido come il player (e ci• Š male) e oltre tutto, bisognerebbe + gestire diversamente gli eventi diretti solo al Player (e ci• Š ancora + peggio), forse in futuro... + +* Come va il "2-piani" ? Teoricamente e pure Praticamente non ci sono + problemi, la cosa pu• funzionare... + ...l'unico problema Š aspettare una versione decente (e completa) da + poter modificare per le nuove capacit…. + Non credo che ci sia il bisogno di dirlo, ma se va in porto questa cosa, + sar… necessario (in realt… no) riscrivere tutti i livelli, ma questo Š + anche ovvio perchŠ in nuovi livelli punteranno alla "grandiosit… degli + spazi" (???). + + Sar… anche possibile creare archetti come Quake ? + + + NO ! + + + Sar… comunque possibile creare dei tunnel ! + + Se ci saranno 2 piani, allora si potr… camminare anche sul 2ř piano ? + SŤ, ci• Š teoricamente possibile, ma presuppone una rimodellazione + del motore grafico (oltre a quella necessaria per i muri alti) che faccia + in modo da gestire al meglio le sovrapposizioni tra pavimanti, muri ed + oggetti. Gli Slimer potranno cosŤ volarsene in pieno 3D, e quando dico + PIENO, intendo veramente PIENO ... NON come DOOM ! + Ci potranno essere botole al posto degli ascensori ! + + +* Pioggia, lampi, tuoni, fulmini e saette ? No problem ! + (se non ti piace rifai il fulmine in "MANO.LBM" o spostalo...) + +* Look up & down ? No problem ! + +Ed ora veniamo alle cose serie. +1) Per visualizzare bene lo sfondo Š stato necessario evitare il bloccaggio + della memoria associata alle 4 immagini di sfondo (4 !?). Questo signi- + fica che Š possibile un rallentamento cronico quando si Š in presenza + di 3 sfondi contemporaneamente (il che Š molto raro), ma siccome questo + problema c'era gi…, adesso si Š forse ridotto (non Š un paradosso, Š + la dura legge della bilancia). +2) Ho notato (e non ci vuole molto) che la visualizzazione del fulmine + poteva provocare una scrittura incontrollata in memoria, con il + conseguente tilt del gioco (tutto appare e scompare...). + (questo problema credo sia stato definitivamente risolto) +3) La pioggia ha 2 velocit…, ma ci• non si vede molto. Se impostassi tutto + alla stessa velocit… si risparmierebbe tempo d'elaborazione. +4) Con lo sfondo che ho messo (purtroppo questa versione ne accetta solo 1 + per ora) si vedono bene degli oggetti lontani che lampeggiano o, per + meglio dire, spariscono. Questo Š il risultato di una delle scelte di + ottimizzazione per colore, cioŠ quando un oggetto Š pi— scuro del colore + pi— scuro allora non viene disegnato affatto; il lampeggio Š ovviamente + dovuto a qualche sorgente di luce intermittente nei paraggi dell'oggetto. + Il problema si pu• risolvere scegliendo una sfumatura al contrario + (scura al centro), disegnando delle montagne abbastanza scure (o molto + frastagliate) nella parte bassa del cielo per confondere "il player", + utilizzare una routine separata di disegno (a colore nero) che disegni + comunque anche oggetti piccolissimi e scurissimi [SCONSIGLIATA]. +5) Lo Slimer sembra che spari anche quando Š vicino. + Questo Š solo un problema di suoni: ho usato il suono dello sparo del + missile anche per l'attacco ravvicinato. + Naturalmente ci• Š SBAGLIATO... ma mi serve un suono di attacco per lo + Slimer (qualcosa che assomigli a "Swisshhhhh !"). +6) Anche lo Spider spara ? No, ma mi serve un suono anche per lui, e se + Š possibile anche per il veleno che vola, altrimenti lascio quello del + missile (Š utile poterlo sentire !). +7) Ho impostato il valore di "cecit…" per scurire fino a 12/16 del colore + totale, con un tempo di rilassamento di 1/16 ogni 32/36 di secondo. +8) Il filtro per l'effetto lampo Š ottenuto facendo tendere al bianco i + colori pi— chiari e al nero quelli pi— scuri... sapere questo pu• essere + utile per disegnare le sfumature dello sfondo: ponendo infatti i colori + pi— chiari nella parte bassa della nuvola (se c'Š deve essere un nuvolone + nero-tempesta) si ottiene l'effetto usato nei cartoni animati. +9) Il fulmine cerca sempre di apparire nella finestra di visualizzazione + del primo giocatore, ma pu• ruotare tranquillamente a 360ř (utile per + il multiplayer, per due giocatori che guardano nella stessa direzione + l'uno dietro all'altro...). +10) Siccome la gestione dei file .MOD richiede l'utilizzo di molta memoria + (per gli strumenti ed i buffers) e il risultato dipende dalla frequenza + di output (che nel nostro caso Š di soli 11KHz), non si potranno + suonare questi files. La scelta casca quindi sui .MID che Š veramente + un CESSO di formato (praticamente le musiche si leggono a bit !). + La cosa migliore potrebbe essere quella di trasformare i .MID in .MUZ + (o .MUS, o qualcosa che gli somigli) che sono molto pi— facili Š veloci + da suonare. +11) Il vento. + Il suono del vento occupa spazio! + Quando si Š all'esterno Š sempre presente e deve perci• essere + conservato in memoria convenzionale. + E allora perchŠ non lo facciamo simulare all' OPL-3 della Sound Blaster ? + Per mezzo di un canale impostato a percussione, credo che sia possibile + ottenere l'effetto rumore bianco (o quasi), il che, variando la + frequenza delle note, Š praticamente il vento ! + (dopo aver fatto il gestore del chip FM ti sapr• dire di pi—). + +--- the day after --- + +12) L'animazione del fulmine Š stata migliorata ed ora utilizza quasi tutte + le risorse: + - tempo: ricalcola in tempo reale la palette con lampo; + - memoria: utilizza nella prima parte l'immagine del fulmine, + seguita subito dopo dal primo suono del fulmine che, + verso la fine (quando ormai il fulmine non c'Š pi—), + viene rafforzato dal secondo suono (tipo rimbombo). + siccome l'animazione avviene in sequenza, il gestore di memoria + dovrebbe avere il tempo di riorganizzare i dati + (dopo un massimo di 40 cicli il MM azzera il bit di utilizzo, + mentre l'animazione del fulmine dura ben 60 cicli. Se il + fulmine parte al 30ř ciclo (circa), allora ci sar… il tempo per + ottimizzare 2 volte la gestione della memoria: la prima tra + il lampo e il tuono, e la seconda tra il tuono e il rimbombo, + scaricando cosŤ il lampo). + +13) Ho rattoppato un problema con le faccine dell'InfoBar. + Il men— pu• apparire in 3 diverse modalit…: + - light: il gioco prosegue, ma il giocatore controlla il menu; + - visuale (default): le animazioni insignificanti proseguono (torce, + bonus,InfoBar,...) mentre i mostri e i missili si + bloccano; + - esclusiva: sullo sfondo appare lo stemma di Kaos e non il gioco + (nemmeno l'InfoBar), i suoni vengono interrotti. + +14) Nuovo sistema di guida dello Slimer per il "persecution mode". + +15) Il men— prosegue la sua strada... (finir… un giorno ?) + +16) Purtroppo i missili sono troppo veloci per essere evitati dal Soldato; + si potrebbe provare ad organizzare un sistema (tipo satellite) per + poter informare i soldati dell'arrivo del missile... + ...se ci riesco lo aggiungo + +17) ...ci sono riuscito. Ora c'Š un sistema di messaggistica diretta + ( = veloce) per la gestione del Soldier. Il Soldier riesce ad evitare + gran parte dei missili lanciati a distanza di sicurezza da qualsiasi + mostro o giocatore. + +18) GRAVISSIMO PROBLEMA! Quando un Player muore sul serio (cioŠ si sbraga + e stira le zampe) si innesca un meccanismo di autodistruzione che porta + il gioco al crack! + +19) Ho messo la nuova mano: perfetta, anche se c'Š qualche puntino chiaro da + togliere (sul contorno). + +20) Per la musica: attendere prego. diff --git a/Documentazione/Testi/Kaos_3.nic b/Documentazione/Testi/Kaos_3.nic new file mode 100644 index 0000000..ae1f19d --- /dev/null +++ b/Documentazione/Testi/Kaos_3.nic @@ -0,0 +1,269 @@ + + + The Real KAOS + + NO MORE ERRORS + NO MORE CRASHES + + I've reached the 100% ERRORS FREE Version !!! + + beta was only a nightmare + + Questo Š un'altro "file-evento di informazione" da conservare; + fa parte dei files ad alto contenuto informativo, perci• Š + necessaria una buona dose di interesse, pazienza ed attenzione. + + Questa versione NON Š distribuibile perchŠ ha ancora + delle limitazioni nella parte di salvataggio del + gioco. + + +SHORT SHOTS + +Cosa C'E' nella prima versione non-beta ? +* Trovato e corretto l'ultimo errore (ma siamo veramente sicuri ?) +* 4 Crash-Test di 30 minuti eseguiti sotto Windows95 non hanno fatto + riscontrare problemi di alcun tipo (incluso il "protection error"). +* 5 Limits-Test di 5 minuti eseguiti sotto Windows95 non hanno fatto + registrare perdite di efficienza apprezzabili in condizioni di + funzionamento critiche: Š stata raggiunta la configurazione di + esecuzione in 75Kb (IL MINIMO) di memoria utile (convenzionale) senza + problemi. + NOTA: il funzionamento a 75Kb si ottiene con una memoria convenzionale + totale di 420Kb (circa) e 0Kb di XMS ! + Per controllare le condizioni di funzionamento del programma, guardare + il valore di memoria base riportato all'avvio del programma; per + poter leggere il valore pu• essere necessario utilizzare l'opzione + "/PAUSE" all'avvio. +* Nuovo sistema di error-grabbing per la gestione del disordine cronico + in XMS. Se Š disponibile la memoria, ma non Š possibile decomporre i + blocchi rimasti, verr... attivata la ricerca first-fit ad oltranza, con + l'occupazione dei blocchi liberi di qualsiasi dimensione. +* Ho messo i numeri grandi. +* Possibilit... di salvare e caricare giochi (vedi sotto per delucidazioni). +* C'Š il file di configurazione che include la memorizzazione delle + opzioni di SYNCronia video e di REVERSibilit... dei canali destro/sinistro + (a proposito, manca il carattere "/" nel font grande... bisogna decidere + se sar... il font definitivo !) + +A proposito, se noti un rallentamento generale del gioco, assicurati che +l'opzione "Video Sync." sia "OFF" !!! + +Spiegazione di Info!/Millennium: +stando agli ancestrali standards di Ultima saga, ci sono in tutto +4 Titani: Hydros (titano delle acque, con poteri di dominio degli agenti +atmosferici, fulmini, ecc.), Pyros (titano del fuoco, con poteri in grado +di dominare esplosioni, eruzioni di vulcani, uccidere, ecc.), Lithos (titano +della terra, in grado di generare terremoti, aprire voragini nel terreno +e dominare i morti, zombi, ecc.), Stellos (titano dell'aria, dominatore +dei venti (?) e detentore dei poteri di guarigione). +Appurato che il fulmine non ha poteri in questo gioco, e che i poteri di +Hydros non possono essere acquisiti se non per ereditariet..., rimangono solo +gli altri tre Titani, associati ad altrettanti componenti di Millennium: + - Nico Š associato a Stellos, perchŠ in grado di guarire e, + impropriamente, anche di resuscitare; + - Maxy Š associato a Pyros, perchŠ in grado di fornire armi e potenza + alle stesse; + - Enry (io lo cambierei con Andy, anche se non Š lui a fare i livelli... + ma mi serve l'OK) Š associato a Lithos perchŠ in grado di aprire + tutte le porte del dungeon. +Esisterebbe poi un quinto Titano, Nyc, che conosce e riunisce insieme i +poteri di tutti i Titani perchŠ sta studiando e seguendo le discipline di +entrambi, cominciando dal Necromancy; Lui sar... il Titano dell'Etere... +...ma questa Š un'altra storia. +PER ULTERIORI INFORMAZIONI GIOCARE A ULTIMA 8 (veramente uno dei giochi pi- +belli esistenti sulla faccia della Terra, meglio di Doom, meglio di Quake, +meglio di... KAOS !... giochi a cui mancano le... basi, la storia e +quell'ambientazione da farti dimenticare di essere nel 20esimo secolo, +insomma un vero gioco di ruolo !) + + +Cosa manca per la versione Shareware ? +(questo elenco potrebbe protrarsi all'infinito) + +PROGRAMMAZIONE: + - tappa-bug di salvataggio permette proteggere il programma ma, + riducendo la finestra al minimo, si vede la figura dello stemma + di sfondo... ...DENTRO la finestra di gioco !!! + - manca (momentaneamente) la gestione dell'arma base + (ASCIA,SCURE,ACCETTA,...quello che Š) + - manca la gestione delle schede sonore MONO (come SoundBlaster 1.0) + [mi dispiace per Federico] + Naturalmente abilitando il suono mono, il 3D_SoundManager va a farsi + friggere ! + + - manca la selezione automatica dell'arma migliore quando finiscono + i colpi, oppure quando si raccoglie un'arma pi- potente; + - manca l'assegnazione di nomi ai file di salvataggio (vedi sotto); + - manca tutto l'apparato musicale Ad-Lib; + - manca la possibilit... di inserire pioggia/non-pioggia nei livelli; + - sto lavorando sulla configurazione automatica della scheda sonora + SoundBlaster compatibile (per ora solo STEREO: SoundBlaster Pro, + SB Pro 2, SB 16, SB 32, SB 64, ecc.); + - il Soldier potrebbe aprire le porte (e anche passaggi segreti) e/o + distruggere vasi e barili se questi sono sul suo cammino... aggiungo ? + (questa cosa non Š una mia trovata, ma dipende dal fatto che il Soldier + non ha un sistema di guida complicato come quello dello Slimer, e + quindi potrebbe rimanere incastrato nel tentativo di dirigersi + contro il nemico (in linea d'aria)); + - allo stesso modo lo Slimer (e il suo infallibile (mica tanto) motore + di ricerca) potrebbe aprire porte e passaggi segreti nella ricerca + di strade pi- brevi... ma non credo che sia coerente in questo caso. + NOTA: Se lo Slimer non Š in "persecution mode" (cioŠ se non Š stato + colpito) non attiva il motore di ricerca, ed incontra anche pi- + difficolt... nell'individuare il nemico. + - mancano i link tra i livelli... ...a questo proposito c'Š qualcosa + da decidere (vedi anche il paragrafo "COMINCIAMO A CREARE"). + - Š possibile modificare il FontManager in modo tale da utilizzare il + MemoryManager, e quindi caricare in memoria solo i caratteri utilizzati, + ma ci• non Š affatto conveniente per i font a caratteri piccoli. + (Ci• Š al limite della tirchieria, anche perchŠ il font occupa circa + 2.5Kb, mentre il MemoryManager utilizza circa 32byte per ogni blocco di + memoria, cioŠ userebbe 1.2Kb circa in pi- per gestire queste operzioni, + per non parlare poi del sotto-utilizzo della risorsa XMS...) + + +GRAFICA/TESTI: + - slideshow per la presentazione; + - vostri simboli da mettere nel menu; + - grafica/testo da inserire nella parte Info!/Help del menu; + - grafica/testo da inserire nella parte Info!/Ordering del menu; + - io rifarei la scritta KAOS nell'immagine del castello, mi pare un + po' scombinata; + - tutte le immagini delle armi in primo piano, e dei fuochi... + - quando un mostro viene colpito, Š possibile sostituire l'animazione + del proiettile che esplode e fa la scintilla e il fumo, con quello di + una spruzzata di sangue (come Doom per intenderci), ma mi servono + le immagini (naturalmente il suono del proiettile che rimbarza non + ci sar... se viene colpito un mostro, come gi... Š); + +SUONO/MUSICA: + - manca il suono di quando Slimer, Spider, Soldier cadono in terra (tonf!); + - mancano i suoni per gestire il menu; + - manca il passo metallico del Soldier; + - manca il vento con pioggia incorporata (ma non Š urgente, anzi); + - mancano tutti quei sonerelli che servono per arricchire il gioco, a + cominciare da quelli che servono per raccogliere le armi, al caricamento + del fucile, ecc... + - almeno una musica di sottofondo per il gioco (sto pensando di + suonare .MUS o .MUZ, ma Š ancora tutto campato in aria). + + Attenzione! Lo Slimer, quando Š vicino ed attacca, emette lo stesso + suono di quando spara; ci• Š assolutamente inaccettabile. + +Salvataggio di una situazione: +Š possibile salvare qualsiasi situazione ma: +- devo mantenere il punteggio salvato ? (Wolf3D azzera il punteggio, ma + a me questa cosa mica piace tanto...); +- esiste un controllo CRC-16 per tutti i file di salvataggio [cioŠ Š + molto difficile (praticamente impossibile) che li si possa modificare]; + +- ogni file ha una stringa di riconoscimento all'interno che permette di + distinguerlo nel menu... ma ancora non Š attiva (stiamo lavorando per voi); +- ogni file DEVE AVERE un riferimento al file di livelli (episodio) a cui + appartiene, e se rendiamo possibile usare episodi (.DLF) diversi, + dobbiamo anche fare in modo che questi siano selezionabili... ma dove ? + + NOTA: Un file di salvataggio NON contiene tutte le informazioni di + gioco!!! Per la ricostruzione, esso richiede la presenza del + file di episodio del quale fa parte !!!!! + POST-NOTA: Non Š perci• possibile distribuire dei livelli ONE-SHOT da + far funzionare ovunque. + POST-POST-NOTA: Sto pensando di mettere il controllo CRC-16 anche sui file + di episodio, e per questo devo creare un nuovo tipo di + file. Sar... comunque garantita la compatibilit... all'in- + dietro con le precedenti versioni (almeno fino a quando + non cambier• idea), e con il nuovo programma di editor dei + livelli, che avr... anche le nuove funzionalit... di selezione + pioggia/non-pioggia. + + SICUREZZA (sŤ ma a tutto c'Š un limite) + + NON Š affatto conveniente inserire il controllo CRC-16 anche nel + Big Data File, perchŠ Š molto grosso e questo potrebbe rallentare + la procedura di caricamento iniziale del gioco; Š per• disponibile + un'alternativa che permette di controllare, a tempo di caricamento + dei dati, il codice CRC-16, il che significa che non ci sar... nessun + tipo di ritardo nel caricamento, ma la notifica dell'errore avverr... + solo dopo che i dati sono stati caricati, cioŠ dopo l'introduzione + (subito prima che appaia il menu principale). + E' anche possibile caricare i dati in-toto PRIMA dell'introduzione, + quindi, in conclusione, Š anche possibile proteggere il BDF. + E' tecnicamente possibile aggiungere un codice di ridondanza (16) anche + per il .EXE, ma qui si cerca veramente il pelo nell'uovo, dato che + i nomi degli autori sono gi... protetti. + + + MARKETING (che ne dici di una versione alla MMX ?) + Fermi tutti ! Non intendevo certo fare una versione del gioco per + i nuovi processori MMX, ma volevo introdurre una delle grandi cose + fatte in Adobe PhotoShop, ovvero al compatibilit... al futuro (!). + L'ultima versione del PhotoShop contiene gi... un dispositivo interno + per utilizzare o meno le nuove istruzioni di un processore con MMX, il + che significa che il programma Š arrivato prima del processore, e che + i possessori di tale software lo vedranno crescere insieme al + proprio computer !!! + Se noi tentiamo di avvantaggiarci nella produzione delle TEXTURE e di + cose particolari gi... nella versione Shareware, protremmo diffondere + degli episodi (e intendo solo i .DLF) che utilizzano immagini diverse + (mai usate, come in Wolf3D) prima ancora di dare (vendere) la versione + completa !!! + + COMINCIAMO A CREARE (ma creare sul serio) + Per avvantaggiarsi Š necessario inventare. + Posso, e dico "potrei", sviluppare meglio i .DLF (Dinamic Levels File) + in modo da contenere al proprio interno delle informazioni dinamiche + sull'utilizzo di leve (e intendo quelle che servono per cambiare + livello) in modo da poter passare da un livello all'altro in modo NON + strettamente sequenziale. + A cosa serve tutto ci• ? + Di per s‚ non serve a niente, ma unito alla capacit... e semplicit... + (insita nel tipo di programmazione ad oggetti) di poter memorizzare + esattamente la situazione di ogni livello, potrebbe essere possibile + giocare "in parallelo" su tutti i livelli, disseminando leve e + passaggi segreti un p• ovunque. In questo modo non Š necessario + avere le chiavi per passare al livello superiore ma, per esempio + Š necessario prendere la chiave al livello 3 per aprire un porta + al livello 1 e balzare al 4 !!! Bello Š ? + Naturalmente Š inteso che tutte le cose su ogni livello rimangono + nello stato in cui sono state lasciate alla partenza. + + Il grave problema di questa soluzione Š costituito da due ostacoli + pi- o meno grossi: + 1) nella fase di registrazione del gioco, devono essere salvati gli + stati di tutti i livelli visitati (!); + 2) il gioco in MultiPlayer subir... delle notevoli modifiche, perchŠ + dovr... essere possibile, per ogni giocatore, visitare un livello + diverso dagli altri, il che significa che sono necessarie fino + a 3 mappe di gioco diverse nella stessa sessione di gioco (!!!) + Data la particolare struttura del 3D-îngine, questo secondo ostacolo + non Š risolvibile in questa versione ma, una volta modificato il + motore grafico per ospitare le mappe multiple, potrebbe essere + possibile attivare contemporaneamente a queste funzionalit... + anche quelle dei muri alti, del doppio piano, ecc. + + + HI-TECH + Si pu• migliorare la gestione della memoria ? + Ci sono 3 modi per migliorare la gestione della memoria, e sicoome + agiscono in punti diversi possono essere anche applicati contempo- + raneamente: + 1) modifica della politica di scarto dei blocchi di memoria convenzio- + nale, nel senso di dare delle priorit... (e non Š necessario che + siano dinamiche) per tutti i blocchi memorizzati, in modo da poter + swappare solo i blocchi che si ritengono meno utili (come il fulmine + che appare molto raramente); + 2) modifica della politica di swapping tra i blocchi di memoria XMS; + in questo modo si ridurrebbe, anche nel caso di mancanza di memoria + XMS, la possibilit... di saturare i blocchi con dati inutili e + costringere il MemoryManager ad utilizzare il disco per quelli pi- + utili; + 3) modifica della politica di allocazione dei blocchi di XMS in modo + da ridurre al minimo la frammentazione di memoria, e quindi la + saturazione dei blocchi (per numero e non per quantit... di memoria); + C'Š da notare, per•, che queste modifiche richiedono l'uso di risorse + di calcolo e memoria, che potrebbero pregiudicare comunque le + prestazioni globali del sistema, perci• non Š conveniente applicarle + tutte. Dato che la memoria XMS entra in gioco solo per lo swapping + Š pi- adatto l'utilizzo congiunto della 2) e 3) piuttosto che della 1), + che Š anche quella che agisce su quantit... inferiori di dati. diff --git a/Documentazione/Testi/Kaos_31.nic b/Documentazione/Testi/Kaos_31.nic new file mode 100644 index 0000000..a89861c --- /dev/null +++ b/Documentazione/Testi/Kaos_31.nic @@ -0,0 +1,8 @@ +Patch alla nř3 + +- Ho preso alcuni suoni da Alien... +- mancano ancora delle cose... +- il Soldato apre le porte, ma prova ad ucciderlo sulla soglia (!!!) + + + -=đNicođ=- diff --git a/Documentazione/Testi/Kaos_32.nic b/Documentazione/Testi/Kaos_32.nic new file mode 100644 index 0000000..120a19d --- /dev/null +++ b/Documentazione/Testi/Kaos_32.nic @@ -0,0 +1,63 @@ + + + Kaos for Development Workgroup + (il multiplayer funziona, ma non Š abilitato) + + +* ho messo tutti i suoni e pure di pi—: + - devi assolutamente cambiare quelli relativi a: + * caduta del Soldier (non credo che vada bene); + * caduta dello Slimer e dello Spider (attualmente Š un ridicolo "boing"); + * ricarica delle armi e cartucce + (CHARGE: da pistola a mitra, CHARGE2: bazuca) + NOTA: quando si ricarica l'arma con una cartuccia il suono Š + uguale a quello campionato, mentre quando si raccoglie l'arma + il suono Š pi— corposo (effetto rimbombo); + Ossa & FlOssa: + * il suono "ossa" deve essere qualcosa simile ad una camminata su + detriti ceramici (eeeeh!); + * il suono "teschio" deve essere indiscutibilmente molto molto molto + molto breve e secco e deve rappresentare la caduta del teschio + vuoto (da notare che si sente ogni volta che un teschio rimbalza, + perci• il volume deve essere abbastanza basso !); + (il suono deve corrispondere ad un "tuc!") +* ho fatto in modo che il Player salti sopra alle Ossa e, gi… che c'ero + anche ai mostri morti (ma questo si pu• togliere, anche perchŠ i mostri + non sono quasi mai centrati nel quadrato utile); + NOTA: questo effetto non si riperquote sull'immagine vista dal 2ř Player; +* manca la gestione corretta del salvataggio delle situazioni (con stringa + di riconoscimento e informazoni di episodio); + (prossimamente) +* manca la gestione delle schede sonore MONO; + (prossimamente) +* c'Š l'autoriconoscimento delle impostazioni della SoundBlaster per mezzo + della stringa d'ambiente (come Quake); +* l'orologio Š mitico; +* Š possibile inserire lo spruzzo di sangue al posto del proiettile che + esplode (quando colpisci un mostro); se vuoi che lo metta mi devi fare + l'animazione del sangue che schizza; +* ho modificato il comportamento dei mostri, ma siamo ancora lontani... + +Strategia di posizionamento: +- Il Soldier deve essere messo in stanze con molte porte (l'ideale + sarebbero le porte al centro e sugli angoli della stanza) e che non abbiano + forma molto contorta (senza curve) e che contengano all'interno ostacoli + della grandezza di un solo quadrato separati tra loro; +- Lo Slimer deve essere posizionato il stanze contorte piene di ostacoli + pi— grandi di un solo quadrato (labirinti intricati senza porte); +- Lo Spider va bene il qualsiasi luogo perchŠ, se non ci sono porte che + l'ostacolano, riesce a percorrere grandi distanze in poco tempo; + L'ideale sarebbe una grande stanza piena di soli ragni, posizionati nelle + incavature della stanza, in tutte le direzioni; + lo Spider convive bene con il Soldier, ma viene ucciso dallo Slimer; + ho messo il decremento_punti_da_Spider_Poison a 10; + + +ERRORE GRAVISSIMO ? NO, MODALITA' OPERATIVA: +Questa versione di Kaos Š una versione per operatori di suono e grafica e +usa .LBM e .WAV, ma non Š assolutamente adatta per il gioco. Molte volte +il programma (in fase di test prolungato) si bloccher… con il messaggio +"mm_swapblock() - fail"; ci• Š "NORMALE". + + + -=đNicođ=- diff --git a/Documentazione/Testi/Kaos_4.nic b/Documentazione/Testi/Kaos_4.nic new file mode 100644 index 0000000..86a0fb2 --- /dev/null +++ b/Documentazione/Testi/Kaos_4.nic @@ -0,0 +1,122 @@ +(questa versione Š "confidenziale") + + ...another KAOS release + (ad un passo dalla Shareware) + +This is THE TRULY KAOS DEVELOPERS VERSION. + +QUESTA VERSIONE DEVE ESSERE PRESENTE SOLO SUI COMPUTERS DEI COMPONENTI +DELLA MILLENNIUM (le prossime versioni non saranno DEVELOPERS ONLY); + +Questa versione contiene una speciale subroutine di controllo del possessore +del computer. +Ai normali files di KAOS Š stato aggiunto un file che si chiama "KAOSDEV.MRK" +e che contiene al suo interno (all'inizio) la scritta: + "I'm a KAOS developer." +QUESTO FILE NON DEVE ESSERE PRESENTE IN NESSUNA VERSIONE CHE ESCE AL DI +FUORI DEL MILLENNIUM GROUP !!!! + +La presenza di questo file garantisce una protezione globale al sistema in +caso di modifiche accidentali (e non) ai codici di ridondanza o ai dati +codificati. Se questo file venisse diffuso (anche solo per una volta) non +sarebbe pi— possibile riconoscere i Millennium's computers. + +Nella versione definitiva di KAOS potrebbe essere possibile inserire +all'interno di un semplice file di episodi (.DLF) una lista (nera) di +stringhe rappresentanti i codici (numeri seriali) di versioni qualsiasi +da eliminare... in questo modo Š possibile, una volta riconosciuto un +programma diffuso illegalmente, spedire nei successivi episodi la stringa +necessaria per eliminare tutte le versioni con quel determinato numero +di serie. + +Un KAOS developer deve essere protetto da questo tipo di test (anche perchŠ +un danno nella mia directory significherebbe la perdita dell'unica mia +versione...) e deve perci• poter essere sicuro di non danneggiare nulla. + +Naturalmente Š possibile effettuare dei test SIMULANDO (in un'altra +directory) l'assenza del file KAOSDEV.MRK... + +Questa versione NON funziona se non Š accompagnata da tale file, ma le +successive non avranno di questi problemi. + +ATTENZIONE! Il file deve essere presente nella stessa directory dei + files di dati di KAOS !!!!! + +NOTA IMPORTANTE: La presenza di questo file mi assicura che il vostro + computer Š protetto da qualsiasi sistema di sicurezza + io avessi in mente di aggiungere !!! + *********** + In ogni caso l'IPS (Internal Policy System) non provocher… + MAI danni superiori alla cancellazione dell'attuale + directory di gioco. + *********** + PER ORA (IN QUESTA VERSIONE) IL SISTEMA DI SICUREZZA E' + STATO DISATTIVATO, MA E' IN GRADO DI RICONOSCERE E + BLOCCARE L'ESECUZIONE DEL PROGRAMMA. + + Prima di provare ad usare una versione di KAOS in modalit… + SIMULATA (togliendo il file di riconoscimento) Š opportuno + salvare il gioco in un'altra directory. + + Se il file di riconoscimento andasse perso, lo si pu• ricostruire + facilmente con un qualsiasi editor di file di testo; l'importante + Š che siano rispettate le due seguenti regole: + - il nome deve essere "KAOSDEV.MRK" + - i primi 21 caratteri contenuti nel file devono essere i seguenti: + >>>>>>>> I'm a KAOS developer. <<<<<<<< + (Attenzione! Contano anche le maiuscole/minuscole !!!) + + Molto probabilmente tutto ci• non servir… mai a nulla, ma l'importante Š + che la possibilit… di riconoscere un pirata ci sia gi… dalla prima + versione venduta (con all'interno un IPS completo e funzionante). + +----------------- +Questa versione funziona ancora con i files .LBM e .WAV e perci• occupa pi— +memoria, Š pi— lenta e ha il solito problema di non avere la sicurezza +informatica di funzionare in tutte le situazioni, ovvero Š possibile che +si presenti l'errore "mm_swapblock() - fail". + +Tra le cose di importanza vitale: + * ho sostituito "Millennium Soft" con "Millennium"; + * ho cambiato alcuni suoni del menu (ho rimesso quelli di prima); + * ho aggiunto qualcosa al menu; + * sto pensando di cambiare "Help Artist" con "Manual Design" (come Wolf3D) + per Andrea (mi serve l'Ok); + * ho tolto il suono del teschio; + * ho aggiunto il suono VENOM.WAV per "l'esplosione" del veleno dello Spider; + * ho abbassato l'inflashamento dell'oro; + * ho messo l'invincibilit… momentanea per il bonus + (attenzione! E' cumulativa !); + * ho messo la risata qua e l… (forse Š pure troppo alto il volume); + (attenzione la risata Š divisa dal file beam.wav !!!) + * ho eliminato il salto sulle ossa; + * ho aumentato il tempo tra i rintocchi del campanile; + * ho definitivamente risolto il problema della faccina che cambia + con il menu; + * ho messo tutti i nuovi file grafici; + +Cose meno importanti: + * ho aggiunto i link tra i livelli (tramite le leve); + * ho aggiunto il nome a 32 caratteri per i file .GAM (di salvataggio gioco), + che contengono anche il nome dell'episodio a cui fanno riferimento. + NOTA: non c'Š nessun controllo aggiuntivo! Se qualcuno rinomina il file + di episodio, Š possibile far uscire cose stranissime ! + * ho finito la parte relativa alle schede sonore mono, ma non + posso provare se funziona !!! (lo chieder• a Federico...); + * non ho nemmeno iniziato la parte relativa alla musica; + + +Cosa manca ancora ? +* alcuni suoni; +* tutto l'apparato musicale; +* le immagini degli spari da attaccare alle armi; +* perchŠ la scritta nell'immagine dragon1 Š rossa e non grigia ? +* manca un CRASH TEST generale, per tutte le schede sonore e per + le diverse configurazioni di memoria (ma questo non Š possibile con + questa versione); + +UNA VOLTA CARICATI TUTTI I DEFINITIVI FILE GRAFICI E SONORI, SARA' POSSIBILE +USARE SOLO ED ESCLUSIVAMENTE LA VERSIONE CON .BDF. + + + -=đNicođ=- diff --git a/Documentazione/Testi/Kaos_5.nic b/Documentazione/Testi/Kaos_5.nic new file mode 100644 index 0000000..8e7a873 --- /dev/null +++ b/Documentazione/Testi/Kaos_5.nic @@ -0,0 +1,63 @@ + + + questa Š la solita versione insignificante... + +manca ancora molto, ma ho rattoppato alcune cose che mi avevi scritto. + +- il gestore di memoria Š nuovo (potrebbe non funzionare); +- questa versione NON funziona con .BDF, quindi non puoi apprezzare + la velocit… di caricamento iniziale (ZERO WAIT STATE); +- il 3D-îngine Š stato modificato (potrebbe non funzionare); +- ho messo la mappa seria (ma senza gli oggetti) + [Potrebbe essere possibile visualizzare sulla mappa gli oggetti (come dei + quadrati) ma solo se in quel momento sono visibili !] +- ho abbassato il volume allo Spider che muore; +- cerca di togliere quella riga (nel cielo) dallo sfondo ! + (nell'originale non c'era !); + +il resto credo che sia tutto invisibile ! + +PS.: + Ho attivato l'IPS ! + All'inizio, dopo il caricamento, il gioco d… delle informazioni + sulla modalit… di funzionamento: + : modo user (normale) + DEVELOPERS MODE: modo NOSTRO (dovrebbe essere sempre cosŤ) + SIMULATION MODE: modo NOSTRO di SIMULAZIONE + (te lo deve dare solo se togli il KAOSDEV.MRK) + HACKERS DEV. MODE: !Warning! + Se Š in funzione questa modalit… significa che + il tuo computer NON Š riconosciuto come + un Millennium Computer !!! + DEVI ASSOLUTAMENTE USCIRE DAL GIOCO E RITENTARE + A FARLO PARTIRE... SE ANCHE LA SECONDA VOLTA + DA' QUESTO ERRORE allora il problema Š mio ! + (sarebbe utile far girare questa versione sul computer di + Andrea per vedere in che modalit… funziona... (con tutto il + KAOSDEV.MRK naturalmente) ) + + QUESTA VERSIONE NON DEVE ESSERE DISTRIBUITA ALL'ESTERNO + CON IL FILE "KAOSDEV.MRK" !!!!!!!!!!!!!!!!!!!!!!!!!!!!! + Anche in assenza del KAOSDEV.MRK il gioco funzioner… !! + + ! E' IMPORTANTE ! + + Il riconoscimento di un Millennium Computer Š una cosa + delicata quanto complicata, perci• Š necessario che non + venga distribuito il KAOSDEV.MRK anche ad altri che non + sono i nostri computers. + + In questa versione l'HACKERS DEV. MODE non Š pericoloso, + ma nelle prossime potrebbe creare problemi, perci• Š + importante che l'IPS non faccia errori. + + NOTA: l'HACKERS DEV. MODE non dipende dal file .DLF usato + (e quindi non Š un modo per bloccare la diffusione + dei giochi registrati e copiati illegalmente) + ma Š una modalit… di funzionamento del gioco che + deriva dal riconoscimento di un hacker (e ci• Š + grave, almeno fino a che non sar… rilasciata la + versione definitiva con .BDF codificato !). + + + -=đNicođ=- diff --git a/Documentazione/Testi/Kaos_51.nic b/Documentazione/Testi/Kaos_51.nic new file mode 100644 index 0000000..ceb99ef --- /dev/null +++ b/Documentazione/Testi/Kaos_51.nic @@ -0,0 +1,214 @@ + + + F A N T A S T I C O ! ! ! ! ! + + + --------======đđđ KAOS_51 đđđ======-------- + con la SUPERPOTENZIATA OTTIMIZZAZIONE GALATTICA !!! + + Risparmio di pi— di 250 moltiplicazioni a 32 bit per frame !!! + ...per un risparmio da 3250 a 10500 cicli macchina (486) !!! + + La pi— grande ottimizzazione nella storia di KAOS ! + + Ed ora proviamo la nuova versione: + + ... + + + ... + + + ...? + + + + ???? + + ??????????? + + + ! + + + Ma che caz... ! + + + Va come prima !?! + + + MAVAFF...! + + MAPORC...! + + Beh, in realt… non Š poi una grande ottimizzazione. + +------------------------------------------------------------- +Novit… pi— visibili: + +1) La cheat "MNTMAP" aziona la TOTAL MAP; nel momento in cui Š attiva, Š + possibile vedere tutta la mappa con tutti gli oggetti, ed Š anche possi- + bile disattivarla e far tornare tutto come prima (ripetendo la cheat); +2) Nella mappa le porte "si aprono"; +3) Ci sono tutte le armi: + - manca il bazuca; + - non ho capito bene qual'Š lo sparo della pistola; + - la mitragliatrice si pu• fare solo in questo modo... + il tempo di ripetizione Š troppo corto e quindi devo + concentrare tutta l'animazione in 5/36 di secondo (!); + - l'animazione della pistola va bene per la mano, ma la pistola, + tra la prima e la seconda immagine, perde tutti i suoi riflessi + e ci• la fa sembrare diversa... +4) Ho la certezza matematica che Š possibile inserire i muri doppi... + ...naturalmente Š necessario cambiare la texture pi— alta con un'altra + che Š nella "libreria", cioŠ mi serve una specie di tabella delle + sostituzioni (es.: Š gi… stato previsto che una porta deve essere + sostituita (nella parte alta) con la texture del legno); +5) Devi cambiare i suoni aggiunti ("asciahit",...); +6) Il Soldier non indietreggia pi—; +7) Ottimizzazione sul disegno degli oggetti; +8) Nel suono dell'orologio c'era troppo rumore di fondo, e cosŤ ho + rimesso quello vecchio e ho aumentato il volume nel programma + (questo non ha creato lo stesso rumore di fondo perchŠ precedentemente + avevo impostato il volume in modo da attenuare l'originale !) + NOTA: quando si Š all'interno di una stanza, il suono dell'orologio Š + pi— basso perchŠ deve dare l'impressione di venire da fuori + (lo stesso vale nel menu) ! + +--------------------------------------------------------- +Ritorno al futuro, la RETE: +L'apparato MULTIPLAYER funziona, ma si incasina con le parti legate alla +registrazione su disco e al cambio di livello (per ora). +Cominciando a pensare al gioco in rete, credo che sia facile crearlo con +l'attuale struttura ad oggetti. Esister… pertanto la possibilit… di +assegnare un codice d'identificazione ad ogni Player all'interno del gioco, +e sar… possibile dare tre diverse modalit… di funzionamento al Player: +- diretto: attraverso i comandi della tastiera + (NOTA: il mouse e il joystick non sono pi— contemplati data + la presenza di TROPPI comandi); +- automatico: legge i dati da disco (questa Š la modalit… dimostrativa); +- differito: legge i dati dalla rete (praticamente Š equivalente al + precedente); + +La particolare modalit… di funzionamento di KAOS in rete NON richiede una +sincronizzazione dei vari computers, perchŠ essi eseguiranno sempre +le stesse operazioni, e avranno sempre la necessit… di utilizzare +i dati degli altri computer. +Nella KAOS-net NON esister… un SERVER vero e proprio, ma solo +"un'impostatore" iniziale che permetter… a tutti i computer di giocare con +la stessa mappa e gli stessi oggetti ! +Sembra strano ma ogni computer avr… una sua copia di tutti i Player, ma in +modalit… di funzionamento diverse, cioŠ una (o due) diretta, contro +due (o una) differite, MA CON I CODICI D'IDENTIFICAZIONE UGUALI ! +Sar… perci• possibile poter giocare in due su uno stesso computer +e includere il terzo giocatore prendendolo dalla rete (!). +NOTA: in realt… l'unica limitazione sulla gestione di pi— giocatori dalla + rete Š solo derivata dall'attuale struttura dei files di livello. + Mentre Š possibile gestire solo 3 giocatori sullo stesso computer + (per questioni di tastiera), nella rete Š possibile avere un numero + illimitato di giocatori (naturalmente bisogna tener presenti i tempi + di diffusione delle informazioni). +NOTA2: si potrebbe pensare che per gestire pi— giocatori sullo stesso + computer serva un computer pi— potente... e invece no. Il ral- + lentamento Š dovuto principalmente alle procedure di disegno di + pavimenti e soffitti che, quando la finestra si riduce anche di + poco, evitano di effettuare molte operazioni. L'ottimizzazione + applicata in questa versione ha tentato di superare i problemi + dovuti al calcolo delle coordinate, ma non ha modificato niente + nelle procedure di disegno (Š il prezzo da pagare per le textures + variabili). + +La prima prova sar… effettuata sul modo 2 (automatico) che ha molte analogie +con il modo 3, in questo modo sar… anche possibile avere una DEMO come tutti +i giochi di questo tipo. + +Rete e velocit…: +Ho appena messo a punto un metodo di comunicazione in rete che permette la +trasmissione di soli 4 bytes per oggetto di rete !!! +Questo significa che servono solo 4 byte durante il gioco per gestire +le sincronizzazioni tra i vari computer. Se Š cosŤ, allora sar… anche +possibile il gioco via modem (l'unico problema Š avere un protocollo di +comunicazione, le specifiche, ecc.). +NOTA: Nel gioco in rete sar… anche possibile giocare con livelli di cui + si ignora l'esistenza, perchŠ nella fase di inizializzazione verranno + trasmesse (dal cosiddetto SERVER) le mappe via rete ! +LA PARTICOLARE STRUTTURA DINAMICA DEL PROCESSO DI COMUNICAZIONE PREVEDE ANCHE +DI INCLUDERE IL SYSTEM (inteso come gestore del gioco) COME OGGETTO DI RETE, +IN QUESTO MODO SARA' ANCHE POSSIBILE GESTIRE DEGLI EFFETTI PARTICOLARI: +- campionamento e riproduzione delle voci dei giocatori in tempo reale + (ma questo Š veramente fantascienza, anche perchŠ la voce sar… 3D e + quindi udibile solo dai Player vicini...), rimane comunque possibile + assegnare ad ogni giocatore un suono personalizzato campionato all'inizio + del gioco e memorizzato in un file esterno, che Š possibile diffondere + nella rete all'inizio... +- blocco del gioco nel caso un giocatore entri nel menu (ma Š alquanto + improbabile, piuttosto impedirei l'ingresso nel menu, oppure impedirei il + movimento dei soli mostri lasciando inalterato il resto, oppure potrei + rendere invisibile il giocatore uscito momentaneamente dal gioco...) +- aggiunta di un nuovo giocatore dalla rete (questa operazione Š molto + delicata e ancora in fase di analisi; la previsione Š che sia comunque + necessario il trasferimento dell'intera situazione di gioco via rete (!)) +- ecc. + +NOTA (ancora): non Š prevista alcuna sincronizzazione per gli effetti + audio/video che non hanno ripercussioni sul gioco, ed in + particolar modo: + l'orologio: suoner… l'ora esatta su ogni computer basandosi + sull'ora del computer locale (e cosŤ dovrebbe + essere per due giocatori intercontinentali, + satellitari, a livello di molta moneta); + il lampo: su ogni computer apparir… in momenti differenti + (in modo casuale); + suoni d'ambiente: gocce, tuoni di sottofondo, ecc. + +-------------------------------------------------------- +Beh, siccome ho tempo posso rivedere quest'ottimizzazione: + + MMMhhh, mmh, guardandola meglio non Š poi tanto male... + + sembra anche che riducendo il numero di calcoli sia aumentata anche + la precisione.... ma tu guarda... + + ... + + ...e dire che ho aggiunto molti altri calcoli per rendere pi— + preciso il disegno; mi ricordo che ho dovuto anche aggiungere + una routine di disegno lenta per tappare i buchi del + in fase di dise + + + + EHI, MA... ASPETTATE UN MOMENTO, STOOOP !!!!! + + + Non sono pi— necessarie le routine di rattoppo ! + + Non Š pi— necessario traslare l'"angrel" ! + Non serve pi— usare la "drawfcblack()" sotto i muri ! + Si pu• tagliare il 3D-îngine !!! + + E U R E K A !!! + + Ho tolto la "drawfcblack()" sotto i muri... + Ho tolto l'incremento all'"angrel"... + + + + Cavolo, questa routine NON Š abbastanza PRECISA ! + + (e poi ora la mappa non funziona) + + Siamo ancora sotto i 36fps in ambienti ampi, ma la velocit… + adesso si sente di pi—... + + ...ne sono sicuro, con questa tecnologia si potr… fare di meglio. + + + + + --- FINE 1ř EPISODIO --- + (The KAOS Chronicle) + + + + -=đNicođ=- diff --git a/Documentazione/Testi/Kaos_6.nic b/Documentazione/Testi/Kaos_6.nic new file mode 100644 index 0000000..a8a0c8a --- /dev/null +++ b/Documentazione/Testi/Kaos_6.nic @@ -0,0 +1,267 @@ + + (Š importante leggere questo file prima di usare le + innovative possibilit... offerte, ed Š importante + leggerlo bene prima di farsi prendere dal panico... + ...credo che ti serva prendere appunti) + + + E' ASSOLUTAMENTE VIETATO CAMBIARE IL FILE DI EPISODIO USATO ! + + + + + KAOS_6 Hollywood + + (ma rimane 0.95 per protesta col gestore di memoria) + + + (Questa Š LA versione perfetta: ti conviene usare questa come + banco di prova, cosŤ magari mi + trovi anche qualche errore grave) + + + + Ed ecco sprigionata tutta la potenza della programmazione ad eventi ! + +Riprogettato parzialmente il 3D-îngine per beneficiare degli ambienti con +poche texture (aumento di velocit... molto moolto oltre i 36fps su un 133 +con un livello monotexture). +Riprogettato completamente il sistema di controllo del Player per implemen- +tare il comando a distanza, con mantenimento della coerenza (su tutti i +computer le stesse immagini (tranne che per quelle d'ambiente)). +Riscritta una parte delle routine grafiche per la gestione delle coperture +(tutto l'ambiente di disegno della mappa, dell'arma di gioco e delle + "scritte floating" Š basato su queste nuove e velocissime routines). +Riscritta la gestione della visualizzazione di testi scorrevoli. + + ...e l'eseguibile, s'impenna ! + +Il risultato: The KAOS Hollywood version. +Dall'unione della potenza della programmazione ad eventi e la maestosit... +dell'Object Oriented Programming nasce la prima versione teleguidabile di +KAOS ! E non parlo solo della rete ! +In questa versione Š possibile REGISTRARE/VEDERE una piena sessione +PLAYBACK monolivello anche con il menu attivo ! + +In altre parole: QUANDO APPARE IL MENU PRINCIPALE ASPETTA 2 SECONDI... + +*** try it, now ! *** + +Comandi per la registrazione: + + /savedem : attiva la modalit... REGISTRAZIONE in cui, la partita + effettuata, verr... registrata nel file KAOS.DEM + + In fase di registrazione, premendo il tasto "U" si chiude il + file di PLAYBACK e lo si pu• rivedere aspettando alcuni secondi + dal menu principale che appare subito dopo. + + (ATTENZIONE! Funziona solo in modalit... DEVELOPERS (perci• dovrai + aggiungere il KAOSDEV.MRK) ! + Non Š possibile registrare le azioni su pi- livelli ! + Non Š possibile passare da un livello all'altro ! + Non Š possibile cambiare il nome del file ! + Non Š possibile registrare un livello diverso dal primo ! + (...almeno per ora)). + + /slow : permette di giocare (e anche registrare) in moviola, + cosŤ Š pi- facile beccare il nemico e chi guarder... + creder... che Š stato registrato con un apparato di realt... + virtuale (ah, ah, ah). + + NOTA: Non ci sono limiti fisici reali per la durata di una sessione di + registrazione. Il gioco registra solo le variazioni di stato, + quindi le pause non occupano spazio (2 byte ogni 908 secondi !). + NOTA2: Il "protocollo di registrazione" Š simile a quello che in futuro + potrebbe essere usato in rete; la grandezza del file d... un'idea + della quantit... d'informazione necessaria per un'intero livello... + + Warning! Non Š consigliabile usare l'opzione di registrazione nelle + versioni senza .BDF, perch‚ Š molto probabile che il gioco + termini con il solito errore. + + Ancora! NON TI PREOCCUPARE SE IN FASE DI REGISTRAZIONE/RIPRODUZIONE + LA MITRAGLIATRICE SPARA DRITTO, I TOPI CAMMINANO SEMPRE NELLE + STESSE DIREZIONI E ALTRE COSE DEL GENERE... + ...E' OVVIO, BISOGNA ELIMINARE OGNI COMPONENTE CASUALE CHE + RISULTA IMPORTANTE PER LA CORRETTA RIPRODUZIONE ! + [non ti affannare a registrare un fulmine, quello resta casuale] + In fase di gioco normale saranno presenti tutte le componenti + casuali. + Anche nel gioco in rete le componenti casuali saranno eliminate ! + + +---------- Cambiare il Big font ------------ + +Nella directory principale (dove sta il MAKEFONT.EXE) c'Š anche il file +FONT2.LBM (che Š quello usato da MakeFont). +Eseguendo il programma, questo far... una prova di visualizzazione (un p• +sgangerata) nella parte bassa delle schermo. + + A questo punto Š necessario confermare la registrazione: + INVIO: procede al salvataggio dei dati nel "BIG.LFN"; + ESC : bypassa il salvataggio; + +Dopo il comando, MakeFont legger... il file BIG.LFN e rieseguir... un test di +visualizzazione (se il file era stato registrato allora i caratteri +visualizzati dovrebbero essere gli stessi); premere un tasto per uscire. + +ATTENZIONE! Non modificare il file STD.LFN ! + Questo font Š pi- completo di quelli che Š possibile + creare con MakeFont ! + + Sarebbe utile avere nel font anche il simbolo "/", ma attualmente non + credo che sia possibile includerlo nel .LFN, perci• aspetto il nuovo + file grafico FONT2.LBM con i caratteri del nuovo font e poi lo ricreo + io con i nuovi caratteri da aggiungere ! + + +NOTA ANTI-PANICO: Per vedere che MakeFont modifica veramente il + font ho modificato il carattere "M" dell'attuale + BIG.LFN, comunque la versione precedente Š in + BIG.OLD (ma Š comunque ricreabile sostituendo il + font2.lbm con quello corrispondente nella directory + LBM, che non Š utilizzato per il font). + + ******** + + LA POSIZIONE DEL FONT E' IMPORTANTE + E' necessario posizionare i caratteri del font in modo da occupare + la parte pi- in alto e a sinistra dei blocchi; naturalmente Š anche + indispensabile mantenere costanti le altezze dei caratteri ! + Devi prima decidere una base su cui appoggiare tutti i caratteri, e poi + devi gestire i casi particolari delle lettere (come la p e la q) che + hanno dei prolungamenti anche sotto la base. + + VERIFICA: la lettera + alta deve sbattere sul "soffitto"; + le lettere senza prolungamenti devono appoggiare su una + linea immaginaria (base); + le lettere con prolungamenti possono essere anche tutte + + corte del quadrato che le circonda; + tutte le lettere devono essere appoggiate a sinistra + (senza eccezioni); + + ******** + + +----------- Saluti e cazzate varie ------------ + +Ci sono due file di testo aggiunti alla solita lista che contengono i +testi che verranno visualizzati nei "Greetings" e "Quotes" (a proposito, +"Quotes" đ "citazioni"). +In realt... questi files hanno una sintassi ben precisa: + + ogni riga corrisponde ad una riga reale (di testo) sullo schermo e + il carattere "‡" indica la fine del testo; + Š necessario lasciare circa 15 righe all'inizio e alla fine del testo + per ottenere la pulizia completa della schermata; + (le righe vuote occuperanno 1 solo byte in memoria, quindi Š accettabile) + + [ .SLF = String List File ] + + GREETING.SLF + il testo viene sempre centrato all'interno di tutta l'area dello + schermo e viene disegnato con colori diversi a seconda del primo + carattere della riga: + + ">" = giallo (per il nome) + "<" = blu (per le dichiarazioni dirette) + altri = bianco (per il testo normale) + + QUOTES.SLF + il testo NON viene centrato automaticamente e viene scritto con + due possibili colori: + + giallo (nome): se il primo carattere della riga Š diverso dallo + spazio; + bianco (dichiarazione): se il primo carattere della riga Š uno + spazio. + + (Per avere un'idea PRECISA della sintassi, guarda i file di esempio + che ho fatto... ma guardali attentamente ! + I caratteri non "speciali" sono anche visualizzati !) + +NELLA VERSIONE CON .BDF Greetings e Quotes saranno schiaffati e codificati +nel .BDF (e saranno illeggibili dall'esterno). + +IMPORTANTE: Questi file NON possono superare i 64Kb di grandezza ! + + +-------- questioni serie ---------- + +Garantisco personalmente che il PLAYBACK funziona su tutte le macchine allo +stesso modo ! + +Abbiamo la pausa gioco: tasto PAUSA. E' usato come un Trigger, ma per +ora non funziona molto bene (emula uno sparo) ! + +Il 3D-îngine Š molto pi- preciso di prima, ma non abbastanza da annullare +tutti i puntini fantasma quando si Š in corridoi lunghi; per questo motivo +ho dovuto aggiungere delle routine pi- lente per eliminare definitivamente +questi problemi. +Il fatto Š che la velocit... del gioco dipende molto da queste routine, e +c'Š anche da dire che i problemi di visualizzazione si hanno quasi +esclusivamente in fase di RIPRODUZIONE (PLAYBACK) che non in fase di gioco +reale (guidato a mano), quindi si potrebbe anche chiudere un occhio... +[guarda caso queste routine rallentano il gioco proprio quando si Š in + lunghi corridoi! (ed E' un caso!)] + +Il 3D-îngine beneficia di textures uguali messe in successione, e questo +vale sia per i muri che per i pavimenti/soffitti (anche se in questo caso +per successione si intende accorpamento in grandi blocchi). + +La visualizzazione dei Greetings Š volutamente pi- veloce di quella delle +Quotes. + +E' assolutamente impossibile mantenere costante la velocit... di scorrimento +dei Greetings perchŠ girano sul gioco in esecuzione; Š invece possibile +farlo (e l'ho fatto) per le Quotes. + +Questa versione Š ancora affetta dal problema di swapblock. +Nella prossima versione potrei riscrivere una parte del gestore di memoria +per ottimizzare l'uso della memoria XMS. +Ti ricordo che l'errore di swapblock non compare nella versione con .BDF ! +Nella prossima versione aggiunger• (forse) il pre-caricamento dei dati +in memoria (ma questo discorso vale solo per il .BDF). + +Attualmente (e credo anche in futuro) i font NON possono essere +inclusi nel .BDF ! + + +--- -- - ULTIMI SVILUPPI - -- --- + +Avendo dovuto includere la voce End Game nel menu principale, mi pare chiaro +che, a questo punto, Š pi- conveniente fare l'high score piuttosto che altre +cose pi- o meno statistiche (niente vieta di farle comunque tra un quadro e +l'altro). +Siccome sar... necessario anche inserire una voce sugli HIGH SCORE, propongo +di metterla nel sottomenu INFO! + +Nella prossima versione aggiunger• anche il simbolo del dischetto... + ...sŤ, ma quale ? Quello in FONT2.LBM o quello in OTHER.LBM ??? + + +-------- FuturView --------- + +In futuro sar... possibile avere diversi file di dimostrazione, relativi a +livelli diversi, e capaci anche di registrare i passaggi da un livello +all'altro. +Teoricamente Š anche possibile usare diversi file di episodio, scegliendoli +direttamente nel gioco. + + +-------- Marketing --------- + +E chi l'ha detto che bisogna fare i nuovi episodi sulle vecchie texture ? +Ed ecco allora la soluzione: + Semplicissimo, cambiando le texture cambier... il .BDF; mantenendo costante + il numero di texture usate, sar... possibile cambiare l'aspetto dei mostri, + del dungeon, dei Greetings, Quotes, suoni, ecc. e renderli leggibili anche + dalle versioni precedenti del gioco... + ...l'unico problema Š che diffondere un nuovo episodio completo di + .BDF implica il trasferimento di circa 2Mb di roba (non compressi) ! + + + End Of File + + -=đNicođ=- diff --git a/Documentazione/Testi/Kaos_61.nic b/Documentazione/Testi/Kaos_61.nic new file mode 100644 index 0000000..15a288a --- /dev/null +++ b/Documentazione/Testi/Kaos_61.nic @@ -0,0 +1,182 @@ + + + + + The Real Quake KAOS Hollywood + v0.96 + + + +1) Aumentata precisione mostri, velocit..., ecc. + (cattivi come e pi- di prima). +2) Possibilit... di registrare fino a 3 file .DEM, con capacit... di + registrare il cambio-livello e anche di iniziare la registrazione da + un livello superiore (opzione: /lev:n); + esisterebbe anche la possibilit... di registrare in sessioni + MULTIPLAYER, ma non Š ancora stata inserita l'informazione all'interno + dei file di registrazione. + Ogni file .DEM Š protetto da CRC_16. + + In condizioni di attesa, il sistema sceglie a caso uno dei 3 file di + PLAYBACK (se esistono) e lo visualizza, ma solo se l'episodio che + usa Š quello correntemente impostato (...). + + I nuovi file .DEM non sono compatibili con i precedenti e tantomeno lo + saranno con i futuri, fino alla versione 1.0. +3) Routine di visualizzazione pavimenti/soffitti ottimizzate; +4) Nuova sotto-versione del MemoryManager (v3.2), ora Š anche in grado + di scegliere quali blocchi XMS lasciare su disco e quali no + (vale solo per il .BDF). + Questa modifica permette di evitare ripetuti accessi al disco in + mancanza di memoria XMS o in caso di frammentazione eccessiva dei + blocchi XMS (che Š l'equivalente dell'errore di swapblock() nella + versione senza .BDF); + ATTENZIONE: bisogna controllare se il fattore di rallentamento Š + accettabile ! +5) Pre-caricamento delle texture di livello all'inizio di ogni quadro. +6) Quake effect (all'esplosione dei barili, ecc.). +7) Hard mode (prendendo il soldo grande). +8) Auto-switching delle armi, con scelta delle armi cariche. +9) Very Fast 3D-îngine: utilizzati gli algoritmi pi- veloci (non guardando + alla precisione). +10) Nuova cheat MNHard. +11) Nuova gestione del 3D nel 3D_SoundManager (pi- adatto agli altoparlanti) + ATTENZIONE! Il volume generale (di mixing) Š stato abbassato, vedi + se va bene cosŤ o se era meglio prima. +12) I font ora vanno nel .BDF. [pensavo fosse pi- difficile] + NOTA: i .LFN sono stati modificati, ora contengono informazioni + aggiuntive... e non sono compatibili con i precedenti, + almeno dal punto di vista delle ultime versioni di KAOS. +13) Ho cominciato ad aggiungere codice per le Bombe. +14) Migliorata la caduta del sangue; credo che cosŤ non sia pi- necessaria + una nuova immagine da aggiungere all'animazione; guardando Duke3D per• + sembra quasi che il nostro sangue sia "poco". + A PROPOSITO: vuoi avere un'idea di quanti suoni e musiche ha Duke3D ? + guarda nel file "user.con". +15) Andrea Š ora il Manual Designer. +16) Ho tolto i copyright ! Occhio ! + + *** + +il punteggio deve sparire ! +l'urlo dello Spider Š VERAMENTE troppo forte ! +bisogna ridefinire i valori delle armi, ecc. (aspetto i numeri) + + *** + +------- Impossibile? Non proprio --------- +E' MOLTO TEORICAMENTE possibile gestire in modo pi- preciso le collisioni +tra il Player e il mondo. In particolare, riproggettando le routine di +ray-casting e (soprattutto) trovando un valido algoritmo di collisione, +Š possibile camminare come in Doom (sar... la prossima sfida). + +Se riesco a capire come si definisce una MAPPA di strumenti MIDI posso anche +provare a suonare i .MID ! + +----- ...che si ammazzino tra di loro ------- +Ho fatto una partita a Quake in God Mode e, senza sparare un colpo, mi sono +buttato nella mischia, a volte nascondendomi dietro ad un cane... +...i nemici, sparando verso di me si colpivano l'un l'altro... +...una volta preso un colpo, il nemico si dimentica di me finchŠ non ha +ucciso chi lo ha colpito ! Questa Š una cosa che mi piace molto ! +Io vorrei mettere questa clausola in tutte le intelligenze dei mostri, ma +non credo che tu sia d'accordo ! + +----- Come spediremo il gioco ? ----- +Non possiamo comprimerlo e spedirlo se prima non abbiamo pagato i diritti a +quelli che hanno fatto il RAR o il PKZIP o ... +Non possiamo registrarlo cosŤ com'Š perchŠ altrimenti escono 5 dischetti a +botta... +Posso fare un programma che comprime con l'algoritmo di Huffman (credo, se +no Š un altro) e dispone il file su pi- dischetti; naturalmente Š necessario +poi includere il file che decomprime tutto. + + +------------------------------------------------------------------------- +========================================================================= + Cavolo ! +========================================================================= +------------------------------------------------------------------------- + + +NUOVO 3D-îngine v3.0 ! +Capace di determinare intersezioni su distanze negative e di gestire in modo +pi- efficiente le collisioni. +Il risultato Š: +- maggior precisione di tiro: ora Š impossibile (?) che un mostro vicino + sia TROPPO vicino per essere colpito; +- eliminazione di una parte supeflua di codice; +- rallentamento della routine di ray-casting; +- capacit... di gestire collisioni avanzate tra muri e oggetti; + E' sempre pi- vicina la possibilit... di affiancare dei muri diagonali e + di entrare nelle incavature delle porte ! + NOTA : Manca la parte pi- difficile: un algoritmo per le collisioni ! + NOTA2: Ci avevo gi... provato, ma non aveva funzionato. + NOTA3: Ci ho gi... riprovato, ma non funziona lo stesso. + NOTA4: Sono demoralizzato da tutto ci•. + +ATTENZIONE: il nuovo algoritmo che gestisce le intersezioni potrebbe aver + creato l'inconveniente (momentaneo) che c'era una volta, cioŠ + il fatto che i proiettili (esplosioni) che rimbalzano sui + muri vengono nascosti dal muro. + +...beh, ma allora perch‚ "Cavolo !" ? + + PERCHE' E' TROPPO LENTO ! + [ho rimesso quello vecchio con qualche piccola modifica] + +-------------------------------------------------------------------------- + +NOOO ! +Mi Š successo pure a me ! +Ho ucciso un Soldier e dietro Š rimasta la macchia di sangue sul muro ! +Per un momento ci ho creduto anch'io ! + +Bisogna inserire questo effetto nel gioco ! +A costo di cambiare le texture dei muri su tutti e quattro i lati. +NOTA: sul pavimento si pu• fare tranquillamente, tanto c'Š solo un lato ! + +Come faccio a farlo ? +Introdurr•, come vorrei fare per i muri doppi, una tabella di conversione +delle texture in texture con sangue e il gioco Š fatto ! +Se poi tu aggiungessi altre texture con sangue relative a disegni gi... fatti, +allora si renderebbe pi- credibile la cosa (praticamente dovresti modificare +quelle dei pavimenti/soffitti). +Il risultato sar... quello di vedere il vero pulp ! +Ogni volta che una macchia di sangue cadr... a terr..., la texture del pavimento +sar... modificata; invece per le texture dei muri si avr... il cambiamento solo +se, prolungando il ray-casting dello sparo, si colpir... un muro a distanza +ravvicinata. +NOTA DI EFFETTIVA IMPORTANZA: + Non Š vero che tutte le macchie di sangue saranno uguali ! + E non Š nemmeno vero che le metter• in modo casuale ! + Nella tabella di conversione si collegher... una texture "pulita" ad una + un p• sporca di sangue (una schizzata), poi quella un p• sporca sar... a + sua volta collegata ad una pi- sporca, fino a completare la catena. + Il risultato sar... quello di ottenere una graduale spruzzata, a mano a mano + che il mostro viene colpito ! + + L'unica cosa a cui bisogna fare attenzione Š al fatto di considerare questo + effetto in fase di progettazione dei livelli, per cui potrebbe essere + vantaggioso circondare ogni ambiente con le proprie texture (modificabili), + ma questo era un consiglio gi... dato. + + ----- lo inserir• in questa versione, ocio ! ------ + + Gi... che ci sono applicher• anche un'ottimizzazione PERICOLOSA, + speriamo che non crei casini ! + + [ TUTTO OK, si va sullo splatter ] + +NOTA: + Questa versione contiene delle ottimizzazioni che riguardano le + tabelle interne; questo significa che la quantit... di memoria base libera + riportata all'inizio del gioco non Š basata sugli stessi criteri + adottati in precedenza e, anche se Š maggiore di prima, potrebbe + benissimo essere inferiore. + Nella prossima versione attuer• un'altra ottimizzazione sulla tabella + di conversione delle texture (spedendola in XMS) e quindi le cose + potrebbero cambiare ancora. + + + -=đNicođ=- diff --git a/Documentazione/Testi/Kaos_62.nic b/Documentazione/Testi/Kaos_62.nic new file mode 100644 index 0000000..ad325bf --- /dev/null +++ b/Documentazione/Testi/Kaos_62.nic @@ -0,0 +1,71 @@ + + This is a (quite) fast .NIC information file + + + KAOS_62 + + + [punto (7) e (9) importantissimi !] + + + +1) Sembra che il ragno sia pi— alto... o mi sbaglio ? + [nel senso: potrei aver modificato l'altezza nel programma] + +2) Ho messo la tabella di cambiamento delle texture in XMS ! + (un enorme guadagno: 150 bytes !) + +3) Non ho modificato la strategia dei mostri (ancora per poco). + +4) Non vengono caricati tutti i dati relativi al livello (solo le texture + dei muri e poco pi—), quindi Š possibile che ci siano ugualmente dei + caricamenti nella fase iniziale del livello. + Questa cosa nasce dal fatto che caricando i dati delle texture (o altre + immagini) in fase di caricamento del livello si alternino tra loro dati + dinamici e statici in memoria convenzionale... e ci• Š male, molto male. + E' possibile (anzi quasi certo) che nella versione definitiva questo + pre-caricamento sia fatto da una funzione ad hoc, che sar… chiamata dopo + il caricamento effettivo del nuovo livello. + + QUINDI: ora il gestore di memoria potrebbe fare pi— fatica di prima, ma + rimane pur sempre un gestore di memoria pi— furbo del precedente. + +5) Ho notato ancora quache problema di disegno nel caso di corridoi molto + lunghi (e anche larghi) quando si riduce la finestra. + +6) Ho messo i tasti 1-6 per cambiare le armi, ma attenzione: + non funzionano n‚ in fase di playback e n‚ in fase di registrazione. + +7) Questa versione, come le altre, Š un'effettiva NON-SHAREWARE, il che + significa che, anche se c'Š il .BDF, NON DEVE ESSERE DIFFUSA, PERCHE' + HA DELLE CAPACITA' SUPERIORI ALLA VERSIONE SHAREWARE !!!!!!!!!!!!!!!! + [multiplayer] [playback] [modificabilit… dei parametri] ecc. + +8) Ho messo la nuova grafica (il che significa che ho ricalcolato TUTTE le + nuove misure e gradirei che non venissero pi— modificate) + +9) Ho tagliato la parte dello sparo della mitragliatrice, facendolo venire a + punta... + ...ho notato che, secondo me, non Š conveniente mettere i puntini intorno + alle immagini degli spari, perch‚ si notano molto (ma in negativo) + prova a vedere l'effetto su uno di quelli che hai e poi decidi quale Š + meglio. + NOTA: NON MODIFICARE LE IMMAGINI ! Aspetta la mia versione con i nuovi + riquadri [per le dimensioni]. + +10) Siccome ci sono problemi per le altezze del nuovo font (ha troppe + escursioni altimetriche (!)) NON l'ho sostituito... + ...se ne riparler… quando si sar… stabilizzato e sar… completo. + +11) ho aggiunto un p• di quotes... (sono nel .BDF !) + e ho modificato le velocit…. + Per la lettura guidata da tasti la potrei mettere, ma cosŤ si d… troppa + importanza alla cosa, e non vorrei che sia cosŤ. + +Credo che tutte le altre cose non si vedano... + + +Ah ! Se il cielo si spegne, questo Š il sintomo descritto nel punto (4). + + + -=đNicođ=- diff --git a/Documentazione/Testi/Kaos_63.nic b/Documentazione/Testi/Kaos_63.nic new file mode 100644 index 0000000..0154747 --- /dev/null +++ b/Documentazione/Testi/Kaos_63.nic @@ -0,0 +1,295 @@ + + Il pi- grosso file d'informazioni utili mai creato + + --------- + ================= + KAOS_63 DoubleHacks + ================= + --------- + + Raccogliamo la sfida dei Double Walls ? + [non ci posso fare niente, ogni volta che metto i + doppi muri mi viene la malinconia] + + + sopra le righe troverai la realt... + tra le righe troverai la virtualit... + sotto le righe troverai... il sogno + (...e non Š una metafora) + + + !WARNING! Ho modificato i .LBM !!!!! + Per far funzionare le versioni future devi assolutamente + usare questi !!!!!!! + Troverai maggiori indicazioni sui nuovi nomi all'interno + del testo. + + + 1) nuova cheat "Invi" che permette di non essere visti dai mostri in fase + di attacco; + NOTA: non rende affatto invisibili, fa solo passare l'aggressivit... + ai mostri e impedisce ai proiettili di colpire il Player, ma non + alle esplosioni ! + E' possibile ottenere l'invisibilit... effettiva e anche + l'immaterialit... e la capacit... di attraversare i muri e la capacit... + di volare, quella di aumentare la soglia di udibilit... dei suoni, + quella di uccidere a vista, quella di usare il laser, quella di + disintegrare un mostro, quella di far rivivere i mostri dopo n secondi + da quando sono morti, quella di evitare che tutto ci• sia realizzato. + 2) nuovo sistema di caricamento delle texture (d... la priorit... alle texture + dei muri e dei pavimenti/soffitti); + NOTA IMPORTANTE: + Una volta usato questo algoritmo Š risultato inutile mantenere + grandi quantit... di blocchi XMS in attesa; Š un risultato imprevisto + e va studiato prima della versione Top Gun del MemoryManager (4.0). + 3) doppi muri con algoritmo di conversione real-time; + 4) ho rimesso il copyright: solo "(C)1997" ... che non significa niente + per chi non vuole capire; + 5) nuovo algoritmo di caduta del Player (sembra pi- brutto, ma d... un + effetto pi- realistico quando il Player viene colpito alle spalle); + 6) nuova opzione BLOOD sŤ/no; + 7) selection box nelle opzioni del men-; + 8) ancora nuovi Greetings e Quotes; + 9) nuovi algoritmi per il gestore di memoria, in attesa del cambio totale + di versione; +10) suono del fucile che viene ricaricato (WOW, sembra fatto su misura); +11) immagine del caricamento dati (io quasi non la riesco a vedere nella + versione con .LBM e .WAV); +12) nuovi algoritmi per la gestione della IDMap; + ATTENZIONE: questa modifica, se contiene errori, pu• provocare gravi + danni durante il gioco. + [danno massimo = il gioco di blocca] +13) Statistica di fine livello: + Mira: colpi andati a segno / colpi sparati; + visualizza la precisione di tiro per tutte le armi; + (teoricamente potrebbe superare il 100%, ma lo supera anche + quando non Š teoricamente possibile (!) ) + Violenza: colpi diretti ai nemici / colpi andati a segno; + Š indice dell'attitudine del giocatore ad uccidere; + (non pu• superare il 100%) + Vittime: mostri uccisi / mostri presenti + (vengono calcolati SOLO i mostri uccisi dal giocatore, anche + in modo indiretto, e non quelli che si ammazzano tra di loro) + Tecno hits: colpi indiretti andati a segno / colpi andati a segno + NOTA: per ora pu• superare il 100%, perchŠ Š un semplice rapporto + di efficienza d'uso delle armi: maggiore Š il valore di + questo indice e migliore Š l'uso che si f... degli oggetti + distruttivi del livello (barili, bombe, missili). + + Nella schermata di riassunto di questi dati ho usato il font piccolo + perchŠ Š necessario aggiungere alcuni caratteri importanti nel Big + font: + - i soliti: "!",":" + - da aggiungere: tutti i numeri da 0 a 9,"%" + - meno importanti: "/",".","?","#",";"; + + ATTENZIONE: il Big font va messo in un file a parte !!!!!!! + +14) Siccome non avete fatto gli sfondi, sto facendo qualche modifica + per vedere come viene sui doppi muri; + + đSPEED UP (se non lo sapeste gi...) + Se volete fare gli sfondi in modo veloce ed efficiente Š necessario + eseguire DPaint dalla sua directory (dove ci sono i files per le + stampanti) e impostare, oltre ad una stampante IBM Proprinter II/III + (la mia), la grandezza della pagina a 320x400. + Dopo aver disegnato l'intera "vista" (cielo e terra sullo stesso + disegno), anche utilizzando la Spare Page a 320x200 per caricare altre + immagini, si deve salvare il file con un nome fittizio e poi salvare + i due disegni (cielo e terra) separatamente in questo modo: + - si inquadra la parte che si vuole salvare e si cambia il + "view size" a 320x200 (quello predefinito, il primo); + - si sceglie Save As e si registra. + Non Š affatto complicato, ed evita problemi di attaccatura verticale; + per risolvere quelli di attaccatura orizzontale Š necessario invece + copiare l'intero disegno (320x400) nella Spare Page in modo che sia + sfasato (la parte sinistra (160x400) a destra e viceversa); dopo + aver fatto le dovute modifiche si ri-copiano le parti nella figura + originale e si salva il tutto. + +15) Ancora modifiche alle Quotes ! +16] Ho qualche problema mentale nel capire perchŠ i vasi debbano contenere + armi... dopotutto anche i vasi sono contati ! + Non ho problemi invece a lasciare armi vicino ai mostri morti, ma quali + armi ? Il fatto che per prendere un'arma si debba uccidere un mostro + lo si pu• anche ottenere facendo delle stanze a passaggio non obbligato + con mostro e arma separati. +17) Ho eliminato il "MORTI2.LBM" e messo le immagini in "RAGNO.LBM"; + ho modificato "FONT2.LBM" perchŠ tanto il font non verr... caricato da lŤ, + ora il file si chiama "MISC.LBM". + +----------------------------------------------------------------------------- + +----- Gi... che ci siamo ----- +Per adottare definitivamente la visualizzazione a muri doppi Š necessario: +- 2 texture con legno e ferri (senza maniglia) che devono essere messi + sopra i due tipi di porte: ad apertura laterale e centrale; +- 1 texture che si attacchi bene con la parete di rocce irregolari con + muffa (ma non Š indispensabile); +- modificare la texture della GRATA in modo da eliminare discontinuit... + verticali (una cazzata); + [fatto] +- modificare la texture del DOOR_SLOT in modo da eliminare discontinuit... + verticali (...); +- allungare le 2 colonne fino ad un'altezza di 128 pixel verticali; + [fatto, il risultato Š in "MISC.LBM", ma l'ho fatto di corsa] +e credo che basti. + +Cosa si guadagna: +Oltre agli enormi vantaggi di imponenza e maestosit... di effetti, si avranno: +- meno errori grafici derivanti dall'attacco con il soffitto; +- meno calcoli a parit... di dimensioni delle stanze (= velocit...); +- possibilit... di creare un nuovo tipo di mostro gigante o volante + (il Bub o lo Slimer potrebbero volare alti...); + [il trucco per disegnare mostri alti Š quello di mettere l'inquadratura + in basso! Sembra una cosa ovvia, ma ti assicuro che non ci pensa + mai nessuno... io l'ho visto in Duke3D, nelle schermate d'uscita] +- effettiva utilit... del NULL-WALL (muro che visualizza lo sfondo nella parte + centrale) e dei comandi di LOOK UP/DOWN; +- ecc. + NOTA: in questa versione la texture in alto Š determinata in base a quella + che c'Š in basso e questo significa che le possibilit... sono limitate. + NOTA2:non vorrei modificare questa cosa che permette di aggiungere solo + 74 bytes (statici) al codice invece di 4096 ! + + +E da parte mia: +- aumenterei l'altezza dei lampadari, facendo in modo che in caduta + provochino danni a chi incontrano sotto; +- potrei cambiare l'algoritmo di mira e gestire anche l'angolo verticale + (Š difficile e costoso... ma ne varrebbe la pena); +- potrei perci• mettere il corvo volante; + ripeto: VOLante ! +- potrei fare in modo che i lampadari cadano se colpiti direttamente; +- non vorrei dirlo, ma sarebbe anche possibile utilizzare una specie di + Gouroud-shading verticale sui muri (ma rallenterebbero le procedure + di disegno); +- Š possibile impiantare sul pavimento (una nuova texture) degli annullatori + di gravit..., o delle molle che fanno saltare il Player o che lo fanno + spiaccicare sul soffitto, o dei rivelatori che fanno cadere qualcosa dal + soffitto o che azionano dei meccanismi strani... + ...il tutto previa modifica dei file .DLF e dell'editor. + + +Some notes: +* POCO SANGUE ? +Come potrai notare, il sangue appare solo quando il Player colpisce un +altro oggetto (mostro o Player) e non appare quando ci sono in ballo +esplosioni, hard mode o l'attacco ravvicinato dei mostri; questo pu• essere +cambiato (ma non Š cosŤ facile). +* HIGH SCORES ? +In questo momento non ci sono registrazioni relative a punteggi massimi o +altro, ma potrebbe essere possibile in seguito creare un pofilo del +giocatore in base ai dati di fine livello; +[questa cosa l'ho scritta ma non ci credo per niente, anche perchŠ ogni + livello permette di ottenere risultati diversi (anche per la percentuale + di vittime, cosiderando le attuali strategie dei mostri)]. +* I MOSTRI SI AMMAZZANO TRA DI LORO ? +Tranne che per la naturale ostilit... tra Slimer e Spider, in genere i mostri +non si ammazzano l'un l'altro; nel caso particolare in cui il "proiettile" +di uno finisca per colpire un altro mostro allora i mostri si attaccano, ma +la presenza di un Player pone immediatamente fine alle ostilit.... +Questa cosa andrebbe rivista, perchŠ secondo me un mostro dovrebbe attaccare +chi gli procura dei danni cosŤ, se all'inizio attacca il Player (per default) +poi potrebbe decidere di uccidere un suo simile perchŠ l'ha colpito... +cosŤ fanno tutti (ma non Š un buon motivo). +* ALLA FACCIA DI WOLF3D ! +Wolf3D quando disegna il ReadMe (Ordering, help, ecc.) lo fa con un file +di testo che ha una sintassi particolare che gli permette, attraverso una +serie di comandi (codici speciali) di cambiare colore, centrare il testo, +andare a capo, inserire immagini ! E questo non Š certo stato fatto tutto +in una notte ! Si vede che quelli della ID hanno gi... fatto quelle routine +per altri giochi (Commander Keen...); e ci credo che io c'ho messo un +Millennium a fare il nostro !!! + + +----- Potrei anche fare 31 ! ----- +Dato che ormai abbiamo raggiunto una certa "stabilit... di immagini" ho +riorganizzato alcuni .LBM. +Siccome vorrei favorire la modificabilit... delle immagini in tutti i sensi +sto cercando di riprogettare l'algoritmo che carica i dati dai .LBM in modo +che sia possibile deciderne posizione e grandezza in un file aggiuntivo +scritto interamente con un qualsiasi editor di testi. +NOTA: Questa cosa Š possibile perchŠ ormai il programma si Š ben delineato; + non potevo farlo prima... specialmente con il vecchio MemoryManager. + + +----- La storia del compressore ----- +Ho provato a vedere qualcosa riguardo all'algoritmo di compressione di +??? e ho dedotto che non funzionerebbe affatto con l'attuale .BDF. +Il nostro .BDF Š altamente comprimibile ma, dopo che ho messo la codifica +dei dati, l'algoritmo di ??? non funziona pi-. +L'unica soluzione (esclusa naturalmente quella di cambiare algoritmo) Š +quella di creare ed utilizzare un Big Data File gi... compresso e codificato. +Ho gi... studiato una soluzione e ne Š risultato che, dato che l'algoritmo +utilizzato non nasconde completamente i dati (Š possibile che alcune parti +rimangano visibili), prima conviene comprimere i dati e poi conviene +codificare la parte compressa (il doppio del tempo); in fase di caricamento +delle texture sar... perci• necessario un lavoro non indifferente: + +(mantenendo in memoria la grandezza dei blocchi compressi e non) +- allocare memoria per blocco compresso; +- caricare parte compressa; +- decodificare la parte compressa; +- allocare memoria per blocco non compresso; +- decomprimere la parte compressa nella non compressa; +- deallocare l'area di memoria della parte compressa; + +[naturalmente si parla di memoria convenzionale] +[allocare memoria convenzionale per leggere i dati da disco e poi deallocarla + subito dopo Š una cosa negativa per il MemoryManager, perchŠ significa + scaricare altre parti in XMS o, peggio, su disco (!!! Š tautologico !!!)] + +contro l'attuale lavoro: +(mantenendo in memoria la grandezza dei blocchi non compressi) +- allocare memoria blocco non compresso; +- caricare blocco; +- decodificare blocco; + +Stavo pensando ad un algoritmo di compressione migliore di quello di ??? +che funziona come quello utilizzato per memorizzare i file .LBM, e cioŠ +un algoritmo per cui si impiega molto pi- tempo a comprimere che a +decomprimere. Data la somiglianza con quello dei .LBM anche la grandezza +finale del .BDF sar... uguale a quella della sola "parte dati" dei .LBM; +c'Š comunque da considerare il fatto che NON verranno salvate le parti +inutilizzate dei .LBM ! + +NOTA IMPORTANTE: E' praticamente impossibile che questo algoritmo di +compressione comprima le parti associate al testo (Greetings e Quotes), n‚ +tantomeno Š probabile che comprima le parti associate ai suoni campionati. + + +---- SIAMO SICURI ? ---- +Se cosŤ abbiamo risolto (si fa per dire) i problemi di compressione, siamo +sicuri che possiamo VENDERE il gioco compilato con il Turbo C/C++ senza +aver pagato niente a nessuno ???? +[E' indubbio che possiamo usarlo (per l'Universit...), ma possiamo VENDERE ?!] + + +----- MemoryManager: a quando la versione 4.0 ? ----- +La versione 4 del MemoryManager se verr... realizzata avr... la capacit... di +allocare blocchi statici e dinamici in aree di memoria diverse e variabili +a seconda delle necessit.... Non Š difficile ottenere questo risultato +partendo dall'attuale versione, ma Š comunque laborioso per il computer +riorganizzare le aree dinamiche per far spazio a quelle statiche e c'Š +anche da considerare il fatto che ogni oggetto aggiunto in fase di gioco +(missili, proiettili, esplosioni, ecc.) richiede almeno 20 byte di memoria +statica allocata durante la creazione dell'oggetto stesso. +La versione 4 di MM avr... anche la purge() in XMS, il che significa che +sar... praticamente impossibile la visualizzazione del messaggio d'errore +"swapblock() - fail". + +L'attuale gestore di memoria ha delle routines altamente specializzate e +a volte (interi livelli di gioco) risultano praticamente inutili, anche +se occupano la CPU per molto tempo. +Devo ancora effettuare i dovuti test in condizioni critiche di memoria e +poi posso decidere se togliere alcune funzioni o meno. + +----------------------------------------------------------------------------- + + + Chiss..., forse un giorno ti dar• un file incomprensibile da ascoltare con + il TextAssist ! + + + -=đNicođ=- diff --git a/Documentazione/Testi/LETT.TXT b/Documentazione/Testi/LETT.TXT new file mode 100644 index 0000000..404d7ed --- /dev/null +++ b/Documentazione/Testi/LETT.TXT @@ -0,0 +1,14 @@ + Andromeda Software + (Massimiliano Teso) + +Carissima redazione di TGM chi vi scrive Š un gruppo di ragazzi che hanno +fondato circa sei mesi fa una piccola Software House (se cosŤ possiamo +chiamarla).Quello che vi vogliamo presentare Š la versione beta del +nostro primo prodotto, un gioco WOLF3D-LIKE che per• ha rispetto a +questo stupendo prodotto della ID "molte" cose in pi—. +Per installare il gioco basta copiare il contenuto del dischetto in una +directory e lanciare KAOS.EXE. Maggiori informazioni sul gioco e sulla +nostra storia sono contenute nei file LEGGIMI.ORA e MANUAL.DOC. +Grazie per la vostra attenzione.. + + diff --git a/Documentazione/Testi/MANUAL.DOC b/Documentazione/Testi/MANUAL.DOC new file mode 100644 index 0000000..99bb9de --- /dev/null +++ b/Documentazione/Testi/MANUAL.DOC @@ -0,0 +1,62 @@ + + Andromeda Software + + MANUALE DI UTILIZZO DI "KAOS" + +Il gioco "KAOS" si svolge in un Dungeon.Il vostro scopo Š quello di +arrivare all'ultimo livello facendo scempio di mostri e mostriciattoli +(livello tattica -10).Abbiamo cercato di rimanere fedeli all'ormai mitico +DOOM quindi i tasti per giocare sono: +1)Per muoversi si usa il tastierino delle frecce(ovvio no!) +2)[CTRL] Per sparare +3)[R-SHIFT] Per correre +4)[ALT-GR] Per camminare lateralmente +5)[INVIO] Per cambiare le armi (per ora,solo per ora!!!!) +6)[SPACE-BAR] Per aprire le porte +Nel gioco a due o a tre i tasti sono i seguenti: + + I MOVIMENTO I SPARO I APRI PORTA ISTRAFE I CORSA I CAMBIO ARMI I + I I I I I I I + I 5 I 0 I [RIGHT] I[LEFT] I [UP] I + I + I 1 2 3 I I I I I I + I____________I__________I____________I_______I_______I_____________I + I I I I I I I + I E I A I [TAB] I Z I Q I \ I + I S D F I I I I I I + I____________I _________I____________I_______I_______I_____________I + I I I I I I I + I P I K I J I H I U I , I + I L • … I I I I I I + I____________I__________I____________I_______I_______I_____________I + + +I numeri si riferiscono al tastrierino metre [UP], [LEFT], [RIGHT] si +riferiscono alle frecce. +Nel Dungeon sono presenti diverse porte e alcune di esse hanno sopra o +un teschio rosso o uno giallo.Questo significa che per aprirle avrete +bisogno della chiave rossa o gialla che troverete nascosta in qualche +angolo del labirinto. +Per quanto riguarda gli altri tasti potete guardare il men— all'avvio +di KAOS. +Tutto quŤ, buon divertimento..... + +P.S. Provate a sparare (specialmente con il lancia missili) contro gli +oggetti.Per adesso solo alcuni reagiranno , mentre per la versione finale +ogni oggetto sar… completamente interattivo. + +PP.SS. +Ci sono ben 6 cheat in questa versione.................. ;-) + +CONFIGURAZIONE MINIMA + + 286 12MHz (small window) + 1Mb Ram + ~1Mb HD + + +CONFIGURAZIONE CONSIGLIATA + + 386 33MHz + 1Mb Ram + ~1Mb HD + diff --git a/Documentazione/Testi/MENU.TXT b/Documentazione/Testi/MENU.TXT new file mode 100644 index 0000000..eafa644 --- /dev/null +++ b/Documentazione/Testi/MENU.TXT @@ -0,0 +1,9 @@ + KAOS NEW GAME OPTIONS MULTIPLAYERS + + New Game 1 Player Sound: ON (OFF) (Lista dei livelli) + Options 2 Players FX : ON (OFF) + Load Game 3 Players Walk : ON (OFF) + Save Game + Info! + Quit Game + diff --git a/Documentazione/Testi/MONSTER.DOC b/Documentazione/Testi/MONSTER.DOC new file mode 100644 index 0000000..c2f77b3 --- /dev/null +++ b/Documentazione/Testi/MONSTER.DOC @@ -0,0 +1,125 @@ +****************ARTIGLIERIA*************************************************** +PUGNO + DANNO :1% + VELOCITA:1 SEC + +ACCETTA + DANNO :3% + VELOCITA':1 SEC + +PISTOLA + DANNO :5% (danno in percentuale) + VELOCITA':1 SEC (tempo che trascorre tra un colpo e l'altro) + +FUCILE + DANNO :10% + VELOCITA':3 SEC + +MITRAGLIATRICE + DANNO :5% + VELOCITA':0.3 SEC + +LANCIAMISSILI + DANNO :20% + VELOCITA':1.5 SEC +****************************************************************************** + + + + +***********************MOSTRI************************************************* +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +MOSTRO + ARMI :Tipo di armi che usa (DANNO:danno che provoca l'arma + VELOCITA':velocita' del singolo colpo) + DANNO :danno che provoca il mostro ne corpo a corpo + PROTEZIONE :protezione del mostro + VELOCITA' :velocita' massima del mostro + COMPORTAMENTO:atteggiamento del mostro +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + +############################################################################## +PLAYER + ARMI:Pugni,accetta,pistola,fucile,mitragliatrice,lanciamissili + VELOCITA':camminata 2 ;corsa 4 + PROTEZIONE:100% +############################################################################## + + +GOREL(lo slimer): + ARMI :Spara dalla bocca palle di plasma(DANNO:5% VELOCITA':2) + DANNO :7% + PROTEZIONE :10% + VELOCITA' :4 + COMPORTAMENTO:Vola lentamente su un tragitto predeterminato.Quando ti vede + o viene colpito si gira e ti attacca frontalmente volando a + zig-zag.E' abbastanza veloce e agile.Cerca il contatto se + si accorge che non hai armi potenti + + +FEDIR(la faccia) + ARMI :Spara dalla bocca delle piccole palle di fuoco rutando + abbastanza velocemente la testa da sinistra a destra e + viceversa creando una piccola raffica di fuoco abbastanza + estesa(DANNO:3% VELOCITA':4) + DANNO :7% + PROTEZIONE :20% + VELOCITA' :4 + COMPORTAMENTO:Vola lentamente su un tragitto predeterminato.Quando ti vede + o viene colpito si gira ti attacca frontalmente facendo delle + virate a destra e a sinistra molto strette e veloci.Cerca il + contatto se si accorge che non hai armi potenti + + +BODAR(il bubbone) + ARMI :Spara dalla bocca delle grandi palle di fuoco(DANNO:10% + VELOCITA':4) + DANNO :8% + PROTEZIONE :80% + VELOCITA' :2 + COMPORTAMENTO:Vola lentamente su un tragitto prederminato.Quando ti vede + o viene colpito attacca frontalmente di potenza cercando + di girarti lentamente intorno.Non cerca il contatto + + +MONACO DI LARK + ARMI :Emana dalle mani un fluido bluastro(DANNO:8% VELOCITA':6) + DANNO :8% + PROTEZIONE :80% + VELOCITA' :6 + COMPORTAMENTO:Vaga su un tragitto prestabilito e sente anticipatamente + la tua presenza(ad esempio come si apre una particolare + portail monaco inizia a seguirti anche se non ti vede). + Attacca frontalmente cercando di non rimanere in linea con te + e cercando di girarti intorno sorprendendoti alle spalle. + Se la sua protezione scende sotto il 30% cerca di scappare + (una volta sotto il 30% il monaco pu• recuperare 1% di + protezione ogni 2 secondi, una volta colpito per• l'ascesa si + blocca per poi ricominciare sotto il 30%.Se il monaco non + viene colpito pu• recuperare al max fino all'80%.Il monaco + torna ad attaccare se colpito o se supera 38%).Pu• aprire + le porte + + + +RAGNO + ARMI :Pungiglione avvelenato + DANNO :3% + PROTEZIONE :6% + VELOCITA' :6 + COMPORTAMENTO:Vaga libero nel labirinto a attacca non appena ti vede + o viene colpito.Si muove a zig-zag con un moto caotico + + +MOLAR(il mostro finale) + ARMI :Lancia delle palle di fuoco che si trasformano in mostri + cercando di mantenere 10 mostri in campo.Ogni 40% di punti + corrispondono ad un mostro di meno che molar pu• generare + DANNO :30% + PROTEZIONE :400% + VELOCITA' :2 + COMPORTAMENTO:Si muove lentamente cercando di sparare i suoi colpi nei + diversi punti della stanza.Intanto depone delle uova dalle + quali escono dei ragni.Molar depone 8 uova ogni volta che + rimangono un numero di ragni <=1 diff --git a/Documentazione/Testi/Nick.txt b/Documentazione/Testi/Nick.txt new file mode 100644 index 0000000..f2e36da --- /dev/null +++ b/Documentazione/Testi/Nick.txt @@ -0,0 +1,68 @@ +From - Sat Aug 09 18:06:45 1997 +Received: from dante.iol.it (194.20.24.2) by websrv.grisnet.it + (Rockliffe SMTPRA 1.2.2) with SMTP id ; + Sat, 09 Aug 1997 16:20:58 +0200 +Received: from NAUTILUS (sw25-204.iol.it [194.20.25.204]) by dante.iol.it (8.8.3/8.6.12) with SMTP id QAA31409; Sat, 9 Aug 1997 16:23:39 +0200 +Date: Sat, 9 Aug 1997 16:23:39 +0200 +Message-Id: <1.5.4.16.19970809161914.2b7facde@popmail.iol.it> +X-Mailer: Windows Eudora Light Version 1.5.4 (16) +Mime-Version: 1.0 +Content-Type: multipart/mixed; boundary="=====================_871168754==_" +To: Remo +From: Massimiliano Teso +Subject: Urgente +X-Attachments: C:\KAOS\KAOS5\KAOS.TXT; +X-Mozilla-Status: 2001 + +--=====================_871168754==_ +Content-Type: text/plain; charset="us-ascii" + +Caio Pippa +Dovresti portare urgentemente questo file a Nico prima di partire. +Pippa nun fa u cugghione che te sordi come l'altra vorta...... + + +--=====================_871168754==_ +Content-Type: text/plain; charset="us-ascii" +Content-Disposition: attachment; filename="KAOS.TXT" + +1) La schermata di Kaos disegnata da Andrea deve rimanere fino a che non si + preme un tasto (altrimenti non la si vede nemmeno) +2) Quando salvi e ricarichi un livello rimane solo il sangue sulle pareti e + non quello per terra. O tutti e due o niente...meglio tutti e due +3) A volte non mi carica lo sfondo che rimane nero. +4) La pioggia cade solo sulla parte superiore dello sfondo. Fai in modo che + cada anche sulla parte inferiore. +5) Se titi una bomba o un missile attraverso due colonne si comportano come + se dietro ci fosse n muro. Si puo' correggere? +6) Per il Muliplayer metti pure la mira automatica cosi' evitiamo l'effetto + polipo +7) La bomba deve essere completamente assente nello Shareware. Quindi anche + con le chat non deve apparire. +8) Per le dimensioni reali o virtuali degli oggetti scegli tu la soluzione + migliore. +9) Per quanto riguarda la politica di vendita e di rilascio delle specifiche + prima spediamo lo shareware e poi ne parliamo ;)) +10) Le luci (cerchietti) delle torce vanno abbassate mentre quelle dei + lampadari vanno alzate. + + +--=====================_871168754==_ +Content-Type: text/plain; charset="us-ascii" + +A Presto....:)) + +Massimo + \/__ + / \ + /^ \ + / __/\ \_ + | / \ \ + \/ | _| \ +_______________/_____|________ + ************************** + * Massimiliano Teso * + ************************** + +--=====================_871168754==_-- + diff --git a/Info.doc b/Info.doc new file mode 100644 index 0000000..3740caa Binary files /dev/null and b/Info.doc differ diff --git a/Kaos the Game/EDITOR.EXE b/Kaos the Game/EDITOR.EXE new file mode 100644 index 0000000..b672ab8 Binary files /dev/null and b/Kaos the Game/EDITOR.EXE differ diff --git a/Kaos the Game/KAOS.BDF b/Kaos the Game/KAOS.BDF new file mode 100644 index 0000000..6eb5c02 Binary files /dev/null and b/Kaos the Game/KAOS.BDF differ diff --git a/Kaos the Game/KAOS.CFG b/Kaos the Game/KAOS.CFG new file mode 100644 index 0000000..1c2b758 Binary files /dev/null and b/Kaos the Game/KAOS.CFG differ diff --git a/Kaos the Game/KAOS0.DEM b/Kaos the Game/KAOS0.DEM new file mode 100644 index 0000000..65b8ab1 Binary files /dev/null and b/Kaos the Game/KAOS0.DEM differ diff --git a/Kaos the Game/KAOS1.DEM b/Kaos the Game/KAOS1.DEM new file mode 100644 index 0000000..b973d3b Binary files /dev/null and b/Kaos the Game/KAOS1.DEM differ diff --git a/Kaos the Game/Kaos.exe b/Kaos the Game/Kaos.exe new file mode 100644 index 0000000..77ca43d Binary files /dev/null and b/Kaos the Game/Kaos.exe differ diff --git a/Kaos the Game/LITTLE.LFN b/Kaos the Game/LITTLE.LFN new file mode 100644 index 0000000..5c29ac8 Binary files /dev/null and b/Kaos the Game/LITTLE.LFN differ diff --git a/Kaos the Game/Lbm/EDITOR.LBM b/Kaos the Game/Lbm/EDITOR.LBM new file mode 100644 index 0000000..750f7cd Binary files /dev/null and b/Kaos the Game/Lbm/EDITOR.LBM differ diff --git a/Kaos the Game/Lbm/NICTEST.LBM b/Kaos the Game/Lbm/NICTEST.LBM new file mode 100644 index 0000000..8240a1e Binary files /dev/null and b/Kaos the Game/Lbm/NICTEST.LBM differ diff --git a/Kaos the Game/STD.LFN b/Kaos the Game/STD.LFN new file mode 100644 index 0000000..5a2beae Binary files /dev/null and b/Kaos the Game/STD.LFN differ diff --git a/Kaos the Game/kaos.dlf b/Kaos the Game/kaos.dlf new file mode 100644 index 0000000..92ed013 Binary files /dev/null and b/Kaos the Game/kaos.dlf differ diff --git a/Kaos the Game/readme.txt b/Kaos the Game/readme.txt new file mode 100644 index 0000000..9ccfeac --- /dev/null +++ b/Kaos the Game/readme.txt @@ -0,0 +1,17 @@ +Kaos Enhancements +----------------- + +per ottenere la versione non ufficiale, +sostituire kaos.exe alla versione ufficiale. + +per inserire i nuovi mostri, usare l'editor +allegato e sostituire il file di livelli kaos.dlf. +In alternativa č possibile creare un nuovo file +e utilizzare l'opzione /f di kaos, per +caricarlo al posto di quello standard; +ad esempio, supponendo di aver creato il file +miofile.dlf, eseguire: + + kaos /fmiofile + + diff --git a/KaosSrc/3dengin5.cpp b/KaosSrc/3dengin5.cpp new file mode 100644 index 0000000..d83e5bd --- /dev/null +++ b/KaosSrc/3dengin5.cpp @@ -0,0 +1,2850 @@ +/************************************************************************ + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + ************************************************************************/ + +// 3D-îngine V2.3 - (C)1997 Nicosoźt (Valentini Domenico) + +// ATTENZIONE A MAXVIEWHEIGHT !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +#define __DOUBLEWALLS__ + +//#define HVIEWRANGE (ANG60-(ANGLVL<<3)) +#define HVIEWRANGE ANG90 +// int HVIEWRANGE = ANG60; +#define VVIEWRANGE ANG60 + +#define VIEWGLOBAL (64l< + +#include // per random() in RAIN +//#include // per sound() + +fixed *sintab = new fixed[ANG360], + *costab = new fixed[ANG360], + *tantab = new fixed[ANG90+1], + *invcostab = new fixed[ANG90+1]; +int *angtab = new int[MAXVIEWWIDTH]; +int viewwidth, viewheight, halfwidth, halfheight; +fixed heightnumerator; +int viewangle, rayangle; +fixed viewx, viewy, viewz; +fixed viewcos, viewsin; + +int *ceilhid = new int[MAXVIEWWIDTH], + *floorhid = new int[MAXVIEWWIDTH]; +int minceilrow, minfloorrow; +fixed facedist, objscale; +fixed distadj; // per pav/soff. + +// uso xdist e ydist per leftcos e leftsin, per risparmiare + +// ray +fixed xpos, ypos, xposinc, yposinc; +fixed xinters, yinters, xintinc, yintinc; +fixed dist, xdist, ydist, xdistinc, ydistinc; +int idx; +char isxray,isdiag,isnowall; +word raymask; // affects ehnray() +int noid, // Don't draw this object (DRAWER) + textind, otextind; // memory indexes + +word *map; +word *objmap; +char seenmap[4096]; +char mapsquare[25]; // quadrato mappa +byte *floormap = new byte[4096]; +byte *ceilmap = new byte[4096]; +DrawList dobjlist; +// Agenti atmosferici +char raindraw = 1; //, rainspeed = 8; +//struct { int x,y; } rain_info[MAXRAIN]; +typedef struct { fixed x,y; } TRainInfo; +TRainInfo rain_info[MAXRAIN]; +fixed rain_speed[MAXRAIN]; +int thunderdraw = -1, thunderang, thunderz, underblack = 0; + +#ifdef __DOUBLEWALLS__ +byte HighWall[MAXTEXTURES] = { +T_WALL1/*T_WALL1*/ ,T_WALL1M/*T_WALL1M*/, +T_WALL1/*T_WALL1S*/ ,T_WALL1M/*T_WALL1MS*/, +T_WALL1/*T_WALL1SS*/ ,T_WALL1M/*T_WALL1MSS*/, +T_WALL1/*T_TAP*/ ,T_WALL1M/*T_TAPM*/, +T_WALL1/*T_TAPS*/ ,T_WALL1M/*T_TAPMS*/, +T_WALL1/*T_TAPSS*/ ,T_WALL1M/*T_TAPMSS*/, +T_WALL1/*T_SCUDO*/ ,T_WALL1M/*T_SCUDOM*/, +T_WALL1/*T_SCUDOS*/ ,T_WALL1M/*T_SCUDOMS*/, +T_WALL1/*T_SCUDOSS*/ ,T_WALL1M/*T_SCUDOMSS*/, +T_ARC/*T_ARC*/ ,T_ARCM/*T_ARCM*/, +T_PIETR1/*T_PIETR1*/ ,T_PIETR1M/*T_PIETR1M*/, +T_PIETR1/*T_PIETR1S*/ ,T_PIETR1M/*T_PIETR1MS*/, +T_PIETR1/*T_PIETR1SS*/ ,T_PIETR1M/*T_PIETR1MSS*/, +T_PIETR1/*T_ASCE*/ ,T_PIETR1M/*T_ASCEM*/, +T_PIETR1/*T_ASCES*/ ,T_PIETR1M/*T_ASCEMS*/, +T_PIETR1/*T_ASCESS*/ ,T_PIETR1M/*T_ASCEMSS*/, +T_ROCK/*T_ROCK*/ ,T_ROCK/*T_ROCKS*/, +T_ROCK/*T_ROCKSS*/ , +T_WOOD1/*T_WOOD1*/ ,T_WOOD1/*T_WOOD1S*/, +T_WOOD1/*T_WOOD1SS*/ , +T_WBOX/*T_WBOX*/ ,T_WBOX/*T_WBOXS*/, +T_WBOX/*T_WBOXSS*/ , +T_OVERDOOR/*T_DOOR1*/ ,T_OVERDOOR/*T_DOOR1S*/, +T_OVERDOOR/*T_DOOR2*/ ,T_OVERDOOR/*T_DOOR2S*/, +T_OVERDOOR/*T_DOORY*/ ,T_OVERDOOR/*T_DOORYS*/, +T_OVERDOOR/*T_DOORR*/ ,T_OVERDOOR/*T_DOORRS*/, +T_WOOD2/*T_WOOD2*/ ,T_WOOD2/*T_WOOD2S*/, +T_WOOD2/*T_WOOD2SS*/ , +T_SBARRE/*T_SBARRE*/ ,T_SBARRE/*T_SBARRES*/, +T_WOOD1/*T_SWITCHU*/ , + +T_WALL1,T_WALL1M,T_PIETR1,T_PIETR1M,T_ROCK,T_WOOD1,T_WBOX,T_WOOD2, +T_WALL2/*T_WALL2*/ ,T_WALL2M/*T_WALL2M*/, +T_WALL2/*T_WALL2Z*/ ,T_WALL2M/*T_WALL2MZ*/, +T_PIETR2/*T_PIETR2*/ ,T_PIETR2M/*T_PIETR2M*/, +T_PIETR2/*T_PIETR2Z*/ ,T_PIETR2M/*T_PIETR2MZ*/, +T_EARTH/*T_EARTH*/ ,T_EARTH/*T_EARTHZ*/, +T_SOFT/*T_SOFT*/ ,T_SOFTM/*T_SOFTM*/, +T_SOFT/*T_SOFTZ*/ ,T_SOFTM/*T_SOFTMZ*/, + +T_DRAGON ,T_DRAGON+1,T_DRAGON+2,T_DRAGON+3,T_DRAGON+4, +T_DRAGON+5,T_DRAGON+6,T_DRAGON+7,T_DRAGON+8, + +T_GRATAW/*T_GRATAW*/ ,T_GRATAW/*T_GRATAWZ*/, +T_GRATAB/*T_GRATAB*/ ,T_GRATAB/*T_GRATABZ*/, +T_FLROCK/*T_FLROCK*/ ,T_FLROCK/*T_FLROCKZ*/, +//T_GRIGLIA +T_OVERDOOR,T_DOORSLOT,T_WOOD1/*T_SWITCHD*/ + }; +#endif + +// colore di lontananza +byte LastCol[MAXTEXTURES] = { +COL_WALL/*T_WALL1*/ ,COL_MUFFA/*T_WALL1M*/, +COL_WALL/*T_WALL1S*/ ,COL_MUFFA/*T_WALL1MS*/, +COL_WALL/*T_WALL1SS*/ ,COL_MUFFA/*T_WALL1MSS*/, +COL_WALL/*T_TAP*/ ,COL_MUFFA/*T_TAPM*/, +COL_WALL/*T_TAPS*/ ,COL_MUFFA/*T_TAPMS*/, +COL_WALL/*T_TAPSS*/ ,COL_MUFFA/*T_TAPMSS*/, +COL_WALL/*T_SCUDO*/ ,COL_MUFFA/*T_SCUDOM*/, +COL_WALL/*T_SCUDOS*/ ,COL_MUFFA/*T_SCUDOMS*/, +COL_WALL/*T_SCUDOSS*/ ,COL_MUFFA/*T_SCUDOMSS*/, +COL_WALL/*T_ARC*/ ,COL_MUFFA/*T_ARCM*/, +COL_ROCK1/*T_PIETR1*/ ,COL_MUFFA/*T_PIETR1M*/, +COL_ROCK1/*T_PIETR1S*/ ,COL_MUFFA/*T_PIETR1MS*/, +COL_ROCK1/*T_PIETR1SS*/ ,COL_MUFFA/*T_PIETR1MSS*/, +COL_ROCK1/*T_ASCE*/ ,COL_MUFFA/*T_ASCEM*/, +COL_ROCK1/*T_ASCES*/ ,COL_MUFFA/*T_ASCEMS*/, +COL_ROCK1/*T_ASCESS*/ ,COL_MUFFA/*T_ASCEMSS*/, +COL_ROCK1/*T_ROCK*/ ,COL_ROCK1/*T_ROCKS*/, +COL_ROCK1/*T_ROCKSS*/ , +COL_WOOD/*T_WOOD1*/ ,COL_WOOD/*T_WOOD1S*/, +COL_WOOD/*T_WOOD1SS*/ , +COL_WOOD/*T_WBOX*/ ,COL_WOOD/*T_WBOXS*/, +COL_WOOD/*T_WBOXSS*/ , +COL_WOOD/*T_DOOR1*/ ,COL_WOOD/*T_DOOR1S*/, +COL_WOOD/*T_DOOR2*/ ,COL_WOOD/*T_DOOR2S*/, +COL_WOOD/*T_DOORY*/ ,COL_WOOD/*T_DOORYS*/, +COL_WOOD/*T_DOORR*/ ,COL_WOOD/*T_DOORRS*/, +COL_WOOD/*T_WOOD2*/ ,COL_WOOD/*T_WOOD2S*/, +COL_WOOD/*T_WOOD2SS*/ , +COL_ROCK1/*T_SBARRE*/ ,COL_ROCK1/*T_SBARRES*/, +COL_WOOD/*T_SWITCHU*/ , + +COL_WALL,COL_MUFFA,COL_ROCK1,COL_MUFFA,COL_ROCK1,COL_WOOD,COL_WOOD,COL_WOOD, +COL_WALL/*T_WALL2*/ ,COL_MUFFA/*T_WALL2M*/, +COL_WALL/*T_WALL2Z*/ ,COL_MUFFA/*T_WALL2MZ*/, +COL_ROCK2/*T_PIETR2*/ ,COL_MUFFA/*T_PIETR2M*/, +COL_ROCK2/*T_PIETR2Z*/ ,COL_MUFFA/*T_PIETR2MZ*/, +COL_WALL/*T_EARTH*/ ,COL_WALL/*T_EARTHZ*/, +COL_WALL/*T_SOFT*/ ,COL_MUFFA/*T_SOFTM*/, +COL_WALL/*T_SOFTZ*/ ,COL_WALL/*T_SOFTMZ*/, + +COL_WALL,COL_WALL,COL_WALL,COL_WALL,COL_WALL, +COL_WALL,COL_WALL,COL_WALL,COL_WALL, + +COL_WOOD/*T_GRATAW*/ ,COL_WOOD/*T_GRATAWZ*/, +COL_ROCK2/*T_GRATAB*/ ,COL_ROCK2/*T_GRATABZ*/, +COL_ROCK1/*T_FLROCK*/ ,COL_ROCK1/*T_FLROCKZ*/, +//T_GRIGLIA +COL_WOOD,COL_WOOD,COL_WOOD/*T_SWITCHD*/ + }; + +//inline +#pragma warn -rvl +int angleadd(int a, int b) { +asm { + MOV AX, a + ADD AX, b + CMP AX, ANG360 + JL end + SUB AX, ANG360 +} end:; +/* + if ((a+=b) >= ANG360) return a-ANG360; + return a; +*/ +} + +//inline +int anglesub(int a, int b) { +asm { + MOV AX, a + SUB AX, b + JNS end + ADD AX, ANG360 +} end:; +/* + if ((a-=b) < 0) return a+ANG360; + return a; +*/ +} +#pragma warn +rvl + +void calctables() { + int i; + float angle; + double dtan; + fixed v; + + sintab[ANG0] = sintab[ANG180] = costab[ANG90] = costab[ANG270] = 0l; + sintab[ANG90] = costab[ANG0] = (FIXONE/*-1l*/); + sintab[ANG270] = costab[ANG180] = -(FIXONE/*-1l*/); + tantab[ANG0] = 0l; + invcostab[ANG0] = (FIXONE/*-1l*/); + for (i=1;i(511l<(511l<> 1); + // ((long)viewheight*ANG30/(HVIEWRANGE-ANG30)); + + float tang; + for (i=0;i> 1; + halfheight = height >> 1; + calcproject(fixdiv64(0,32,tantab[HVIEWRANGE>>1])/*-MINDIST*/); // !!! + backx = fixdiv(320l<<16,width); + backy1 = fixdiv(200l<<16,height); // == 100 / halfheight + backy2 = backy1; + asm { + MOV AX, WORD PTR backy2[2] // *320 (solo la parte alta) per backy2 + XCHG AH, AL + MOV BX, AX + SHR AX, 2 + ADD BX, AX + MOV WORD PTR backy2[2], BX + } + // Reset rain + int rainspeed = width/80; + for (int i=0; i4095) error("!!???!!?!?!?!?"); +#else + if ((idx = ray())<0) return 0; +#endif + mapinf = Map[idx]; + if (!seenmap[idx]) { + seenmap[idx] |= 2; + if ((k = IDMap[idx]) >= 0) { + //vcount = mapinf.objmap[idx].visible; + if (!mapinf.stop) seenmap[idx]++; + // se un mostro passa in una porta, allora questa Š aperta (?) + do { + obj = objectslist.get(k); + if (k != noid && GETFLAG(obj->mover->flags,OMF_VISIBLE)) { // !!!! + //vcount--; + den = fixmul(obj->mover->x-viewx,viewcos)+ + fixmul(obj->mover->y-viewy,viewsin); + if (den>=MINDIST) { + obj->seen(); + dobjlist.add(k,den); + } + } + } while ((k = obj->mover->underq(idx)) >= 0); + } + } + + if (mapinf.stop/* && vcount>0*/) { + // Shape analisys + switch (mapinf.shape) { + case MSH_SQUARE: + if (isxray) { + //if (xdist<0) break; // !!!?!!! + if (xposinc>=0l) column = lshr16(yinters) & 63; + else column = ~lshr16(yinters) & 63; + } else { + //if (ydist<0) break; // !!!?!!! + if (yposinc>=0l) column = ~lshr16(xinters) & 63; + else column = lshr16(xinters) & 63; + } + ok++; + isdiag=0; + break; + case MSH_VERT: + //if (idx!=oidx) seenmap[idx] |= 0x2; + if (isxray) { + ls = (li = lshr16(yinters) & 0x7fc0) + 64; + k = lshr16(_yinters = yinters + (yintinc>>1)); + if (k
  • =ls) break; + dist = xdist + (xdistinc>>1); + //if (dist<0) break; // !!!?!!! + if (xposinc>=0l) column = k & 63; + else column = ~k & 63; + } else { + // invece gestisco l'X-ray ! + if (yposinc>0l) ls = (li = lshr16(ypos)) + 64; + else li = (ls = lshr16(ypos)+1) - 64; + k = lshr16(_yinters = yinters-(yintinc>>1)); + if (k
  • =ls) break; + dist = xdist - (xdistinc>>1); + //if (dist<0) break; // !!!?!!! + if (xposinc>=0l) column = k & 63; + else column = ~k & 63; + isxray = 1; // !!! + } + ok++; + isdiag=0; + break; + case MSH_HORIZ: + //if (idx!=oidx) seenmap[idx] |= 0x2; + if (isxray) { + // invece gestisco l'Y-ray ! + if (xposinc>0l) ls = (li = lshr16(xpos)) + 64; + else li = (ls = lshr16(xpos)+1) - 64; + k = lshr16(_xinters = xinters-(xintinc>>1)); + if (k
  • =ls) break; + dist = ydist - (ydistinc>>1); + //if (dist<0) break; // !!!?!!! + if (yposinc>=0l) column = ~k & 63; + else column = k & 63; + isxray = 0; // !!! + } else { + ls = (li = lshr16(xinters) & 0x7fc0) + 64; + k = lshr16(_xinters = xinters + (xintinc>>1)); + if (k
  • =ls) break; + dist = ydist + (ydistinc>>1); + //if (dist<0) break; // !!!?!!! + if (yposinc>=0l) column = ~k & 63; + else column = k & 63; + } + ok++; + isdiag=0; + break; + case MSH_DIAG1: + //if (idx!=oidx) seenmap[idx] |= 0x2; + if (isxray) { + if (xposinc>0l) { + if ((num = yinters & 0x003fffffl) != 0l) { + den = xposinc-yintinc; + if (den>=num) { + fast = 1; + ok++; + } + } else { + fast = 0; + ok++; + } + } else { + if ((num = ~yinters & 0x003fffffl) != 0l) { + den = yintinc-xposinc; + if (den>=num) { + fast=1; + ok++; + } + } else { + fast = 0; + ok++; + } + } + if (ok) { + if (fast) { + _yinters = yinters+fixmuldiv64(yintinc,num,den); + dist = xdist+fixmuldiv64(xdistinc,num,den); + } else { + _yinters = yinters; + dist = ydist; + } + //if (dist<0) {ok--;break;} // !!!?!!! + if (xposinc>=0l) column = lshr16(_yinters) & 63; + else column = ~lshr16(_yinters) & 63; + } + } else { + if (yposinc>0l) { + if ((num = xinters & 0x003fffffl) != 0l) { + den = yposinc-xintinc; + if (den>=num) { + fast=1; + ok++; + } + } else { + fast=0; + ok++; + } + } else { + if ((num = ~xinters & 0x003fffffl) != 0l) { + den = xintinc-yposinc; + if (den>=num) { + fast=1; + ok++; + } + } else { + fast=0; + ok++; + } + } + if (ok) { + if (fast) { + _xinters = xinters + fixmuldiv64(xintinc,num,den); + dist = ydist + fixmuldiv64(ydistinc,num,den); + } else { + _xinters = xinters; + dist = ydist; + } + //if (dist<0) {ok--;break;} // !!!?!!! + if (yposinc>=0l) column = ~lshr16(_xinters) & 63; + else column = lshr16(_xinters) & 63; + } + } + isdiag=1; + break; + case MSH_DIAG2: + //if (idx!=oidx) seenmap[idx] |= 0x2; + if (isxray) { + if (xposinc>0l) { + if ((num = ~yinters & 0x003fffffl) != 0l) { + den = xposinc+yintinc; + if (den>=num) { + fast=1; + ok++; + } + } else { + fast=0; + ok++; + } + } else { + if ((num = yinters & 0x003fffffl) != 0l) { + den = -(yintinc+xposinc); + if (den>=num) { + fast=1; + ok++; + } + } else { + fast=0; + ok++; + } + } + if (ok) { + if (fast) { + _yinters = yinters + fixmuldiv64(yintinc,num,den); + dist = xdist + fixmuldiv64(xdistinc,num,den); + } else { + _yinters = yinters; + dist = xdist; + } + //if (dist<0) {ok--;break;} // !!!?!!! + if (xposinc>=0l) column = lshr16(_yinters) & 63; + else column = ~lshr16(_yinters) & 63; + } + } else { + if (yposinc>0l) { + if ((num = ~xinters & 0x003fffffl) != 0l) { + den = yposinc+xintinc; + if (den>=num) { + fast=1; + ok++; + } + } else { + fast=0; + ok++; + } + } else { + if ((num = xinters & 0x003fffffl) != 0l) { + den = -(xintinc+yposinc); + if (den>=num) { + fast=1; + ok++; + } + } else { + fast=0; + ok++; + } + } + if (ok) { + if (fast) { + _xinters = xinters + fixmuldiv64(xintinc,num,den); + dist = ydist + fixmuldiv64(ydistinc,num,den); + } else { + _xinters = xinters; + dist = ydist; + } + //if (dist<0) {ok--;break;} // !!!?!!! + if (yposinc>=0l) column = ~lshr16(_xinters) & 63; + else column = lshr16(_xinters) & 63; + } + } + isdiag=2; + break; + case MSH_DOOR: + //if (idx!=oidx) seenmap[idx] |= 0x2; + if (isxray) { + ls = (li = lshr16(yinters) & 0x7fc0) + 64; + k = lshr16(_yinters = yinters + (yintinc>>1)); + if (k
  • =ls) break; + dist = xdist + (xdistinc>>1); + //if (dist<0) break; // !!!?!!! + column = k & 63; + /* + if (xposinc>=0) column = k & 63; + else column = ~k & 63; + */ + } else { + ls = (li = lshr16(xinters) & 0x7fc0) + 64; + k = lshr16(_xinters = xinters + (xintinc>>1)); + if (k
  • =ls) break; + dist = ydist + (ydistinc>>1); + //if (dist<0) break; // !!!?!!! + column = ~k & 63; + /* + if (yposinc>=0) column = ~k & 63; + else column = k & 63; + */ + } + ok++; + isdiag=0; + break; + } + if (ok) { + switch (mapinf.type) { + case MTP_WALL: + /* + if (mapinf.data == T_NULL) { + isnowall = 1; + break; + } + */ + textind = mapinf.data; + break; + case MTP_SLOT: + if (isxray) + if (xposinc>0) k = idx-64; + else k = idx+64; + else + if (yposinc>0) k = idx-1; + else k = idx+1; + if (Map[k].shape == MSH_DOOR) { + textind = T_DOORSLOT; + checknowall = 0; + } else + textind = mapinf.data; + break; + case MTP_DOOR1: + case MTP_DOOR2: + if ((k=doormanager.doorpos(mapinf.data))==64) { + seenmap[idx]|=3; + ok--; + break; + } + if (mapinf.type == MTP_DOOR1) { + ls=0; + if (isdiag==1) { + if (isxray) {if (xposinc<0l) ls=1;} + else {if (yposinc>0l) ls=1;} + } else // ??? + if (mapinf.shape != MSH_DOOR) + if (isxray) {if (xposinc<0l) ls=1;} + else {if (yposinc<0l) ls=1;} + if (ls) { + if (column>63-k) { + ok--; + break; + } + column+=k; + } else { + if (column>=1; + if (column>=32) { + if (column-32= 4) { + ok--; + break; + } + /* + if (isxray) {if (xposinc<0l) column = 63-column;} + else {if (yposinc<0l) column = 63-column;} + */ + textind = mapinf.data; + break; + } + //oidx = idx; !!! + } + } + if (ok) break; //else checknowall=1; + raynext(); + } + if (checknowall) { + isnowall = (textind == T_NULL); + } + // oidx = idx; + return 1; +} + +#pragma warn -rvl +int lookray(fixed x1,fixed y1,fixed x2,fixed y2,word mask) { +int dex, dey, d1, d2, obstacles = 0; +char xdir = 1, ydir = 1; +int dx1,dx2,dy1,dy2; +asm { + MOV AX, WORD PTR x1[2] + AND AX, 0xffc0 + MOV BX, AX + SHR AX, 6 + MOV CX, AX + MOV AX, WORD PTR y1[2] + SHR AX, 6 + ADD BX, AX // BX = bidx + MOV DX, AX + MOV AX, WORD PTR x2[2] + AND AX, 0xffc0 + MOV SI, AX + SHR AX, 6 + SUB AX, CX + JNS dxpos + DEC xdir + NEG AX +} dxpos: asm { + MOV dex, AX + MOV AX, WORD PTR y2[2] + SHR AX, 6 + ADD SI, AX // SI = eidx + SUB AX, DX + JNS dypos + DEC ydir + NEG AX +} dypos: asm { + MOV dey, AX + CMP BX, SI + //JE end + JNE nonul + JMP end +} nonul: asm { + CMP dex, AX + JL yindip + MOV CX, dex + SHL AX, 1 + MOV d1, AX + SUB AX, CX + MOV DX, AX + SUB AX, CX + MOV d2, AX + XOR AX, AX + MOV dy1, AX + INC AX + INC AX + MOV dy2, AX + ADD AL, 126 + MOV dx1, AX + MOV dx2, AX + JMP goon +} yindip: asm { + MOV CX, AX + MOV AX, dex + SHL AX, 1 + MOV d1, AX + SUB AX, CX + MOV DX, AX + SUB AX, CX + MOV d2, AX + XOR AX, AX + MOV dx1, AX + INC AX + INC AX + MOV dy1, AX + MOV dy2, AX + ADD AL, 126 + MOV dx2, AX +} goon: asm { + CMP xdir, 0 + JNE x1max2 + NEG dx1 + NEG dx2 +} x1max2: asm { + CMP ydir, 0 + JNE ploop + NEG dy1 + NEG dy2 +} ploop: asm { + //PUSH DS + LDS SI, objmap + SHL BX, 1 + ADD SI, BX + MOV BX, dx1 + ADD BX, dy1 + MOV DI, dx2 + ADD DI, dy2 + DEC CX // toglie partenza (e arrivo) ! + JZ eloop // !!!!!!! + OR DX, DX +} mloop: asm { + JNS mode2 + ADD SI, BX + MOV AX, WORD PTR [SI] + AND AX, mask + JZ go1 + INC obstacles +} go1: asm { + ADD DX, d1 + LOOP mloop + JMP eloop +} mode2: asm { + ADD SI, DI + MOV AX, WORD PTR [SI] + AND AX, mask + JZ go2 + INC obstacles +} go2: asm { + ADD DX, d2 + LOOP mloop +} eloop: asm { + // !!! SS==DS !!! + MOV BX, SS + MOV DS, BX + //POP DS +} end: asm { + MOV AX, obstacles +} } +#pragma warn +rvl + +#pragma warn -rvl +// MOSTRUOSAMENTE Veloce++ - (C)1997 Nicosoźt +// ritorna l' idx ! +int near enhray() { +asm { + LES DI, objmap + DB 0x66; MOV CX, WORD PTR xdist + DB 0x66; MOV DX, WORD PTR ydist +} cic: asm { + DB 0x66; CMP CX, DX + JG rayy + MOV BX, WORD PTR xpos[2] + TEST BX, 0xf000 + JNZ error1 + + MOV AX, WORD PTR yinters[2] + TEST AX, 0xf000 + JNZ error1 + + AND BX, 0x0fc0 + SHR AX, 6 + ADD BX, AX + + SHL BX, 1 + MOV AX, WORD PTR ES:[DI+BX] + AND AX, raymask + JNZ stopx +} passx: asm { + DB 0x66; MOV AX, WORD PTR xposinc + DB 0x66; ADD WORD PTR xpos, AX + DB 0x66; MOV AX, WORD PTR yintinc + DB 0x66; ADD WORD PTR yinters, AX + DB 0x66; ADD CX, WORD PTR xdistinc + JMP cic +} stopx: asm { + // DB 0x66; MOV WORD PTR dist, CX + MOV isxray, 1 + JMP end + +} error1: asm { + MOV AX, -1 + JMP fine + +} rayy: asm { + MOV BX, WORD PTR xinters[2] + TEST BX, 0xf000 + JNZ error2 + + MOV AX, WORD PTR ypos[2] + TEST AX, 0xf000 + JNZ error2 + + AND BX, 0x7fc0 + SHR AX, 6 + ADD BX, AX + + SHL BX, 1 + MOV AX, WORD PTR ES:[DI+BX] + AND AX, raymask + JNZ stopy +} passy: asm { + DB 0x66; MOV AX, WORD PTR yposinc + DB 0x66; ADD WORD PTR ypos, AX + DB 0x66; MOV AX, WORD PTR xintinc + DB 0x66; ADD WORD PTR xinters, AX + DB 0x66; ADD DX, WORD PTR ydistinc + JMP cic +} stopy: asm { + // DB 0x66; MOV WORD PTR dist, DX + MOV isxray, 0 + JMP end + +} error2: asm { + MOV AX, -1 + JMP fine + +} end: asm { + DB 0x66; MOV WORD PTR xdist, CX + DB 0x66; MOV WORD PTR ydist, DX + MOV AX, BX + SHR AX, 1 +} fine:;} +#pragma warn +rvl + +/* +#pragma warn -rvl +// MOSTRUOSAMENTE Veloce++ - (C)1997 Nicosoźt +// ritorna l' idx ! +int near enhray() { +asm { + LES DI, objmap + DB 0x66; MOV CX, WORD PTR xdist + DB 0x66; MOV DX, WORD PTR ydist +} cic: asm { + DB 0x66; CMP CX, DX + JG rayy + MOV BX, WORD PTR xpos[2] + TEST BX, 0xf000 + JNZ error1 + + MOV AX, WORD PTR yinters[2] + TEST AX, 0xf000 + JNZ error1 + + AND BX, 0x0fc0 + SHR AX, 6 + ADD BX, AX + + SHL BX, 1 + MOV AX, WORD PTR ES:[DI+BX] + AND AX, raymask + JNZ stopx +} passx: asm { + DB 0x66; MOV AX, WORD PTR xposinc + DB 0x66; ADD WORD PTR xpos, AX + DB 0x66; MOV AX, WORD PTR yintinc + DB 0x66; ADD WORD PTR yinters, AX + DB 0x66; ADD CX, WORD PTR xdistinc + JMP cic +} stopx: asm { + // DB 0x66; MOV WORD PTR dist, CX + MOV isxray, 1 + JMP end + +} error1: asm { + MOV AX, -1 + JMP fine + +} rayy: asm { + MOV BX, WORD PTR xinters[2] + TEST BX, 0xf000 + JNZ error2 + + MOV AX, WORD PTR ypos[2] + TEST AX, 0xf000 + JNZ error2 + + AND BX, 0x7fc0 + SHR AX, 6 + ADD BX, AX + + SHL BX, 1 + MOV AX, WORD PTR ES:[DI+BX] + AND AX, raymask + JNZ stopy +} passy: asm { + DB 0x66; MOV AX, WORD PTR yposinc + DB 0x66; ADD WORD PTR ypos, AX + DB 0x66; MOV AX, WORD PTR xintinc + DB 0x66; ADD WORD PTR xinters, AX + DB 0x66; ADD DX, WORD PTR ydistinc + JMP cic +} stopy: asm { + // DB 0x66; MOV WORD PTR dist, DX + MOV isxray, 0 + JMP end + +} error2: asm { + MOV AX, -1 + JMP fine + +} end: asm { + DB 0x66; MOV WORD PTR xdist, CX + DB 0x66; MOV WORD PTR ydist, DX + MOV AX, BX + SHR AX, 1 +} fine: } +#pragma warn +rvl +*/ + +int fireray(fixed &x, fixed &y, int angle, int vangle, // !!! + fixed &_dist, fixed &z, int _noid) { + TMapInfo mapinf; + int li, ls, k; + char ok, buffered, fast; + fixed num, den, alfa; + Object *obj; + // Globals backup + fixed _xinters, _yinters, + eorx,eory,eorz,maxdist; // !!! + int eor = -1; // End Of Ray = FLOOR/CEILING + + // 3D + if (!vangle) { + maxdist=4096l<=0 && eorx<(4096l<=0 && eory<(4096l<=0) { + if (vanglemaxdist) || + (!isxray && ydist>maxdist)) { + x = fixmul(maxdist,costab[angle]); + y = fixmul(maxdist,sintab[angle]); + _dist = maxdist; + if (vangle>ANG270) { + z=64l<=T_TRANS) + return -3; + } else { + z=0l; + } + return -2; + } + */ + mapinf = Map[idx]; + if ((k = IDMap[idx]) >= 0) { + do { + obj = objectslist.get(k); + if (k != noid && (obj->mover->flags & OMF_HITABLE)) { + if (isxray) { + _xinters = obj->mover->x; + alfa = LABS(fixdiv(_xinters-xpos,lshr16(xposinc))); + _yinters = yinters + fixmul(yintinc,alfa); + } else { + _yinters = obj->mover->y; + alfa = LABS(fixdiv(_yinters-ypos,lshr16(yposinc))); + _xinters = xinters + fixmul(xintinc,alfa); + } + den = FIXONE<mover->shdim; + if (LABS(obj->mover->x-_xinters)+ + LABS(obj->mover->y-_yinters)<=den) { + _dist = fixmul(obj->mover->x-viewx,costab[angle])+ + fixmul(obj->mover->y-viewy,sintab[angle])- + den; + if (_dist>maxdist) { + x=eorx; y=eory; z=eorz; _dist=maxdist-(FIXONE<<4); + return eor; + } + + if (vanglegetviewfig(angle) & 0x3fff]; + den = lshl16(fig.dy+(fig.dy>>2)); + if (num-obj->mover->z-lshl16(fig.height) >=0 && + num-obj->mover->z-lshl16(fig.height) <= den) { + x = _xinters;//-(costab[angle]<<(obj->mover->shdim-2)); + //obj->mover->x-costab[angle]<mover->shdim; + y = _yinters;//-(sintab[angle]<<(obj->mover->shdim-2)); + //obj->mover->y-sintab[angle]<mover->shdim; + //z = obj->mover->z; + z = num; + return k; + } + */ + if (LABS(num-obj->mover->z) <= den) { + x = _xinters; + y = _yinters; + z = num; + return k; + } + } + } + k = obj->mover->underq(idx); + } while (k>=0); + } + if (mapinf.stop) { + + /* + // 3D-fire + if (isxray) { + if (xdist>maxdist) { + x=eorx; y=eory; z=eorz; _dist=maxdist; + return eor; + } + } else { + if (ydist>maxdist) { + x=eorx; y=eory; z=eorz; _dist=maxdist; + return eor; + } + } + */ + // Shape analisys + switch (mapinf.shape) { + case MSH_SQUARE: + if (isxray) { + if (xposinc>=0l) column = lshr16(yinters) & 63; + else column = ~lshr16(yinters) & 63; + _dist = xdist; + } else { + if (yposinc>=0l) column = ~lshr16(xinters) & 63; + else column = lshr16(xinters) & 63; + _dist = ydist; + } + ok++; + break; + case MSH_VERT: + if (isxray) { + ls = (li = lshr16(yinters) & 0x7fc0) + 64; + k = lshr16(_yinters = yinters + (yintinc>>1)); + if (k
  • ls) break; + _xinters = xpos + (xposinc>>1); + _dist = xdist + (xdistinc>>1); + buffered++; + if (xposinc>=0l) column = k & 63; + else column = ~k & 63; + } else { + // invece gestisco l'X-ray ! + if (yposinc>0l) ls = (li = lshr16(ypos)) + 64; + else li = (ls = lshr16(ypos)+1) - 64; // !!! + k = lshr16(_yinters = yinters-(yintinc>>1)); + if (k
  • ls) break; + _xinters = xpos - (xposinc>>1); + _dist = xdist - (xdistinc>>1); + buffered++; + isxray = 1; + if (xposinc>=0l) column = k & 63; + else column = ~k & 63; + } + ok++; + break; + case MSH_HORIZ: + if (isxray) { + // invece gestisco l'Y-ray ! + if (xposinc>0l) ls = (li = lshr16(xpos)) + 64; + else li = (ls = lshr16(xpos)+1) - 64; // !!! + k = lshr16(_xinters = xinters-(xintinc>>1)); + if (k
  • ls) break; + _yinters = ypos - (yposinc>>1); + _dist = ydist - (ydistinc>>1); + buffered++; + isxray = 0; + if (yposinc>=0l) column = ~k & 63; + else column = k & 63; + } else { + ls = (li = lshr16(xinters) & 0x7fc0) + 64; + k = lshr16(_xinters = xinters + (xintinc>>1)); + if (k
  • ls) break; + _yinters = ypos + (yposinc>>1); + _dist = ydist + (ydistinc>>1); + buffered++; + if (yposinc>=0l) column = ~k & 63; + else column = k & 63; + } + ok++; + break; + case MSH_DIAG1: + if (isxray) { + if (xposinc>0l) { + if ((num = yinters & 0x003fffffl) != 0l) { + den = xposinc-yintinc; + if (den>=num) { + fast=1; + ok++; + } + } else { + fast=0; + ok++; + } + } else { + if ((num = ~yinters & 0x003fffffl) != 0l) { + den = yintinc-xposinc; + if (den>=num) { + fast=1; + ok++; + } + } else { + fast=0; + ok++; + } + } + if (ok) { + if (fast) { + _xinters = xpos+fixmuldiv64(xposinc,num,den); + _yinters = yinters + fixmuldiv64(yintinc,num,den); + _dist = xdist + fixmuldiv64(xdistinc,num,den); + } else { + _xinters = xpos; + _yinters = yinters; + _dist = xdist; + } + buffered++; + if (xposinc>=0l) column = lshr16(_yinters) & 63; + else column = ~lshr16(_yinters) & 63; + } + } else { + if (yposinc>0l) { + if ((num = xinters & 0x003fffffl) != 0l) { + den = yposinc-xintinc; + if (den>=num) { + fast=1; + ok++; + } + } else { + fast=0; + ok++; + } + } else { + if ((num = ~xinters & 0x003fffffl) != 0l) { + den = xintinc-yposinc; + if (den>=num) { + fast=1; + ok++; + } + } else { + fast=0; + ok++; + } + } + if (ok) { + if (fast) { + _yinters = ypos+fixmuldiv64(yposinc,num,den); + _xinters = xinters+fixmuldiv64(xintinc,num,den); + _dist = ydist+fixmuldiv64(ydistinc,num,den); + } else { + _yinters = ypos; + _xinters = xinters; + _dist = ydist; + } + buffered++; + if (yposinc>=0l) column = ~lshr16(_xinters) & 63; + else column = lshr16(_xinters) & 63; + } + } + break; + case MSH_DIAG2: + if (isxray) { + if (xposinc>0l) { + if ((num = ~yinters & 0x003fffffl) != 0l) { + den = xposinc+yintinc; + if (den>=num) { + fast=1; + ok++; + } + } else { + fast=0; + ok++; + } + } else { + if ((num = yinters & 0x003fffffl) != 0l) { + den = -(yintinc+xposinc); + if (den>=num) { + fast=1; + ok++; + } + } else { + fast=0; + ok++; + } + } + if (ok) { + if (fast) { + _xinters = xpos+fixmuldiv64(xposinc,num,den); + _yinters = yinters + fixmuldiv64(yintinc,num,den); + _dist = xdist + fixmuldiv64(xdistinc,num,den); + } else { + _xinters = xpos; + _yinters = yinters; + _dist = xdist; + } + buffered++; + if (xposinc>=0l) column = lshr16(_yinters) & 63; + else column = ~lshr16(_yinters) & 63; + } + } else { + if (yposinc>0l) { + if ((num = ~xinters & 0x003fffffl) != 0l) { + den = yposinc+xintinc; + if (den>=num) { + fast=1; + ok++; + } + } else { + fast=0; + ok++; + } + } else { + if ((num = xinters & 0x003fffffl) != 0l) { + den = -(xintinc+yposinc); + if (den>=num) { + fast=1; + ok++; + } + } else { + fast=0; + ok++; + } + } + if (ok) { + if (fast) { + _yinters = ypos+fixmuldiv64(yposinc,num,den); + _xinters = xinters + fixmuldiv64(xintinc,num,den); + _dist = ydist + fixmuldiv64(ydistinc,num,den); + } else { + _yinters = ypos; + _xinters = xinters; + _dist = ydist; + } + buffered++; + if (yposinc>=0l) column = ~lshr16(_xinters) & 63; + else column = lshr16(_xinters) & 63; + } + } + break; + case MSH_DOOR: + if (isxray) { + ls = (li = lshr16(yinters) & 0x7fc0) + 64; + k = lshr16(_yinters = yinters + (yintinc>>1)); + if (k
  • =ls) break; + _xinters = xpos + (xposinc>>1); + _dist = xdist + (xdistinc>>1); + buffered++; + if (xposinc>=0l) column = k & 63; + else column = ~k & 63; + } else { + ls = (li = lshr16(xinters) & 0x7fc0) + 64; + k = lshr16(_xinters = xinters + (xintinc>>1)); + if (k
  • =ls) break; + _yinters = ypos + (yposinc>>1); + _dist = ydist + (ydistinc>>1); + buffered++; + if (yposinc>=0l) column = ~k & 63; + else column = k & 63; + } + ok++; + break; + } + if (ok) { + switch (mapinf.type) { + case MTP_WALL: + case MTP_SLOT: break; + case MTP_DOOR1: + case MTP_DOOR2: + if ((k=doormanager.doorpos(mapinf.data))==64) { + ok--; + break; + } + if (mapinf.type == MTP_DOOR1) { + ls=0; + if (isdiag==1) { + if (isxray) {if (xposinc<0l) ls++;} + else {if (yposinc>0l) ls++;} + } else + if (mapinf.shape != MSH_DOOR) + if (isxray) {if (xposinc<0l) ls++;} + else {if (yposinc<0l) ls++;} + if (ls) { + if (column>63-k) { + ok--; + break; + } + column+=k; + } else { + if (column>=1; + if (column>=32) { + if (column-32= 4) { + ok--; + break; + } + break; + } + } + } + + if (ok) { + if (_dist>maxdist) { + x=eorx; y=eory; z=eorz; _dist=maxdist-(FIXONE<<4); + return eor; + } + break; + } else + if (isxray) { + if (xdist>maxdist) { + x=eorx; y=eory; z=eorz; _dist=maxdist-(FIXONE<<4); + return eor; + } + } else { + if (ydist>maxdist) { + x=eorx; y=eory; z=eorz; _dist=maxdist-(FIXONE<<4); + return eor; + } + } + //if (ok) break; + raynext(); + } + if (buffered) { + y = _yinters; + x = _xinters; + } else { + if (isxray) { + x = xpos; + y = yinters; + } else { + x = xinters; + y = ypos; + } + } + //x -= costab[angle]<<2;//<<3; // WARNING !!! + //y -= sintab[angle]<<2;//<<3; + _dist-=FIXONE<<4; + if (vangle) { + if (vangle=T_TRANSP; + + viewtop = cy-halfheight; + viewbottom = cy+halfheight; + viewleft = cx-halfwidth; + viewright = cx+halfwidth; + + viewangle = hang; + viewcos = costab[viewangle]; + viewsin = sintab[viewangle]; + + // Quake effect + if (quake) { + x += fixmul(-viewsin,(long)quakesh[quake & 7]<<(FIXSHIFT-1)); + y += fixmul( viewcos,(long)quakesh[quake & 7]<<(FIXSHIFT-1)); + z += (long)quakeshz[quake & 7]<<(FIXSHIFT-2); + } + + viewx = x; viewy = y; viewz = z; + + noid = _noid; + + if (vang) { + if (vangcy) + if ((texture = mm_recall(cbackg1)) != NULL) + drawbackground(i,horizont-viewheight); + } else + if (horizont>viewtop) + ffillblock(viewleft,viewtop,viewwidth,horizont-viewtop,0x7f7f7f7fl); + // 127 = 0x7f = shadable black + if (raindraw && !rain_near && !underblack) { + drawrain(); + oldlast = 0; // non Š... !!! + } + if (thunderdraw!=-1 && + (texture = mm_recall(thunderdraw)) != NULL) { + if (thunderz+128>viewtop && + (j = cx+(viewwidth*4/360)*(thunderang-hang)/ANGLVL) >= viewleft-80 && + j<=viewright) { + /* + drawcobjHP(j,horizont-thunderz,80,128, + (80l*viewwidth)/320,(128l*viewwidth)/320, + 0,fixshade,texture); + */ + setvrect(viewleft,viewtop,viewwidth,viewheight); + scalerscfig(j,horizont-thunderz,80,128, + (80l*viewwidth)/320,(128l*viewwidth)/320, + fixshade,texture); + } + } + backceildraw=0; + } + if (backfloordraw) { + if ((texture = mm_recall(fbackg0)) != NULL) { + if (i<0) + drawbackground(i = (int)fixdiv((long)hang*viewwidth,ANG90) % viewwidth, + horizont); + else + drawbackground(i,horizont); + if (horizont= ANG360) rayangle -= ANG360; + initray(); + if (raycast()) { + /* + while(isnowall==1) { + //backfloordraw = backceildraw = 1; + //seenmap[idx] |= 3; + raynext(); + if (!raycast()) {isnowall=2;break;} + } + */ + //if (isnowall) continue; + /* + { + isnowall=0; + continue; + } */ + + //dist = fixmul(xinters-viewx,viewcos)+ + // fixmul(yinters-viewy,viewsin); + dist = fixmul(dist,costab[angrel]); + if (distviewbottom) { + endrow = viewbottom; + lineh = viewbottom-liney; + } + + if (lineh<=2) { + //minceilrow = horizont-1; // !!! + //minfloorrow = horizont;//+1; + liney = horizont-1; + minceilrow = horizont-2; + minfloorrow = horizont+1; + *chid = minceilrow-viewtop; + *fhid = viewbottom-minfloorrow; + lineh=2; //vline(127); // Nero shadable + vline(oldlast = LastCol[textind]); + continue; + } +#ifndef __DOUBLEWALLS__ + wstep = fixdiv64(0l,1024l,lend-lstart); +#else + wstep = fixdiv64(0l,2048l,lend-lstart); +#endif + /* LASCIARE !!! + // elimina l'effetto "spike" a meta texture + if ((curx = lshl16(liney)-lstart) != 0l) curx--; + woffs = fixmul(wstep,curx); + */ + /* MASTERPLAN + woffs = fixmul(wstep,lshl16(liney)-lstart); + */ + if ((curx = lshl16(liney)-lstart) != 0l) curx--; + woffs = fixmul(wstep,curx); + if (liney>minceilrow) minceilrow = liney-1; + if (endrow>5)+2-LightMap[idx]+fixshade; + if (isxray) + switch(isdiag) { + case 0: shade -= ((LABS(costab[rayangle])-1)>>14); break; + case 1: shade -= ((LABS(costab[angleadd(rayangle,ANG45)])-1)>>14); break; + case 2: shade -= ((LABS(costab[anglesub(rayangle,ANG45)])-1)>>14); break; + } + else + switch(isdiag) { + case 0: shade -= ((LABS(sintab[rayangle])-1)>>14); break; + case 1: shade -= ((LABS(sintab[anglesub(rayangle,ANG45)])-1)>>14); break; + case 2: shade -= ((LABS(sintab[angleadd(rayangle,ANG45)])-1)>>14); break; + } + if (dist<24l<>1; + if (shade<0) shade=0; else + if (shade>MAXSHADE) { + shade = MAXSHADE; +#ifdef __DEBUGMODE__ + vline(128-10); +#else + //vline(127); // Nero shadable + vline(oldlast = LastCol[textind]); +#endif + continue; + } + if (textind != otextind) { +#ifdef __DOUBLEWALLS__ + // Che si sappia: NON VOLEVO METTERCELO, ma sono stato + // costretto con la forza ! + // se togliete questo ricordatevi di togliere + // anche "j" e sostituirlo pi— sotto con "textind" + if (textind==T_ARC) { + texture = mm_recall(j = T_WALL1); + otextind=textind; + } else + if (textind==T_ARCM) { + texture = mm_recall(j = T_WALL1M); + otextind=textind; + } else +#endif + texture = mm_recall(otextind = j = textind); +#ifdef __DOUBLEWALLS__ + i = HighWall[textind]; + if (i != j/*textind*/) { + mm_lock(j/*textind*/); + htexture = mm_recall(i); + mm_unlock(j/*textind*/); + } +#endif + } +#ifdef __DOUBLEWALLS__ + if (i == j/*textind*/) drawwallHP(shade); + else drawwallHP2(shade); +#else + drawwallHP(shade); +#endif + //drawwall2(shade); + //drawwall(shade); + } else { + //*fhid = *chid = halfheight; + //*chid = -1;//horizont-viewtop; !!!!! + //*fhid = -1;//viewbottom-horizont; !!! + *fhid = *chid = 0; + *coldistptr = 0l; //4096l<=0) { + obj = objectslist.get(objid); + if (objid != noid) { + dist = fixmul(obj->mover->x-viewx,viewcos)+ + fixmul(obj->mover->y-viewy,viewsin); + if (dist>MINDIST) { + obj->seen(); + dobjlist.add(objid,dist); + } + } + objid = obj->mover->underq(idx); + } + +#ifndef __DEBUGMODE__ + //if (minceilrow>=horizont) minceilrow=horizont-1; + if (minceilrow>=viewbottom) minceilrow=viewbottom-1; + //if (minfloorrow>5)-1+fixshade; + /* + dist = fixdiv(prez,liney-horizont+1); // LABS + shade1 = ((lshr16(dist)-16)>>5)-1+fixshade; + dist = fixmul(dist,distadj); + curx = viewx+(desty=fixmul(dist,leftcos)); + cury = viewy+(destx=fixmul(dist,leftsin)); + //destx = viewx+fixmul(dist,rightcos); + //desty = viewy+fixmul(dist,rightsin); + destx = -destx+viewx; + desty = desty+viewy; + curincx = fixdiv(destx-curx,viewwidth); + curincy = fixdiv(desty-cury,viewwidth); + */ + column = 0; + linex = viewleft; + init_fc(); + idx = xytoidx(curx,cury); + while (column= T_NULL) { + idx = fast_passfc(); + backfloordraw = 1; + continue; + } else texture = mm_recall(otextind=textind); + shade = shade1-LightMap[idx]; + if (shade<0) shade=0; else + if (shade>MAXSHADE) { + idx = fast_drawfcblack(oldlast); + continue; + } + if (textind=viewtop; liney--, lineh--) { + //if ((horizont-liney)<=0) error("<=0 ceil"); + //dist = fixdiv(preiz,horizont-liney); + asm { + DB 0x66; XOR BX, BX + MOV BX, horizont + SUB BX, liney + DB 0x66; MOV AX, WORD PTR preiz + DB 0x66; CWD + DB 0x66; IDIV BX + DB 0x66; MOV WORD PTR dist, AX + DB 0x66; MOV CX, 0x8000; DW 0x0000 + DB 0x66; MOV BX, WORD PTR distadj + DB 0x66; IMUL BX + DB 0x66; ADD AX, CX + ADC DX, 0 + DB 0x66; DB 0x0F; DB 0xAC; DB 0xD0; DB 0x10 // SHRD EAX, EDX, 16 + DB 0x66; MOV BX, AX //Non modifica dist !!!! + + DB 0x66; MOV AX, WORD PTR leftcos + DB 0x66; IMUL BX + DB 0x66; ADD AX, CX + ADC DX, 0 + DB 0x66; DB 0x0F; DB 0xAC; DB 0xD0; DB 0x10 // SHRD EAX, EDX, 16 + DB 0x66; MOV CX, AX // CX = desty + DB 0x66; ADD AX, WORD PTR viewx + DB 0x66; MOV WORD PTR curx, AX + + DB 0x66; MOV AX, WORD PTR leftsin + DB 0x66; IMUL BX + DB 0x66; ADD AX, 0x8000; DW 0x0000 + ADC DX, 0 + DB 0x66; DB 0x0F; DB 0xAC; DB 0xD0; DB 0x10 // SHRD EAX, EDX, 16 + DB 0x66; MOV BX, AX // BX = destx + DB 0x66; ADD AX, WORD PTR viewy + DB 0x66; MOV WORD PTR cury, AX + + DB 0x66; NEG BX // BX = -BX = -destx + DB 0x66; ADD BX, WORD PTR viewx + DB 0x66; MOV AX, CX // AX = desty + DB 0x66; MOV CX, BX // CX = destx + DB 0x66; ADD AX, WORD PTR viewy + DB 0x66; XOR BX, BX + MOV BX, viewwidth + DB 0x66; SUB AX, WORD PTR cury + DB 0x66; CWD + DB 0x66; IDIV BX + DB 0x66; MOV WORD PTR curincy, AX + DB 0x66; MOV AX, CX + DB 0x66; SUB AX, WORD PTR curx + DB 0x66; CWD + DB 0x66; IDIV BX + DB 0x66; MOV WORD PTR curincx, AX + } + shade1 = ((lshr16(dist)-16)>>5)-1+fixshade; + column = 0; + linex = viewleft; + init_fc(); + idx = xytoidx(curx,cury); + while (column=T_NULL) { + otextind=-1; + idx = fast_passfc(); + backceildraw = 1; + continue; + } else texture = mm_recall(otextind=textind); + shade = shade1-LightMap[idx]; + if (shade<0) shade=0; else + if (shade>MAXSHADE) { + idx = fast_drawfcblack(oldlast); + continue; + } + if (textind=0) { + obj = objectslist.get(objid); + + shade = (((idist = lshr16(dist))-16)>>5)-1-obj->selflight- + LightMap[xytoidx(obj->mover->x,obj->mover->y)]+fixshade; + if (dist<24l<>1; + if (shade<0) shade=0; else + if (shade>MAXSHADE) + //shade=MAXSHADE; + continue; // !!! NOOO! cosŤ si elimina l'effetto Hitckoc + + destx = fixmul(obj->mover->y-y,viewcos)- + fixmul(obj->mover->x-x,viewsin); + ovx = vx = cx+(app = (int)fixdiv((destx>>2)*objscale,dist>>2)); + app += halfwidth; + if (app<0) app=0; else + if (app>=viewwidth) app=viewwidth-1; + app = viewangle+angtab[app]; + if (app<0) app+=ANG360; else + if (app>=ANG360) app-=ANG360; + + //TFigure &fig = FigList[(byte)(i = obj->getviewfig(app))]; // !!! + TFigure &fig = FigList[(i = obj->getviewfig(app)) & 0x3fff]; // !!! + texture = mm_recall(fig.memidx); + + //relative base height + destx = z - obj->mover->z - lshl16(fig.height); + lend = prehoriz+fixdiv64shl16(destx*heightnumerator,dist); + lstart = prehoriz+fixdiv64shl16((destx-lshl16(fig.dy))*heightnumerator,dist); + if (lshr16(lstart)>=viewbottom || lshr16(lend)>4); + j = ((long)height*fig.dx*15/fig.dy)>>4; + if (j<=0) continue; + vx -= j>>1; + if (vx+j=viewright) continue; + + if (i & 0x4000) // mirrored ? + drawrcobjHP(vx,lshr16(lstart),fig.dx,fig.dy, + j,height,idist-(1<<(obj->mover->shdim-1)),shade,texture); + else { + if (GETFLAG(obj->oflags,OFL_ISLIGHT)) { + shade = (7-shade-((LightActor *)obj)->lightpow); + if (shade<-1) shade=-1; + drawclightHP(vx,lshr16(lstart),fig.dx,fig.dy, + j,height,idist-(1<<(obj->mover->shdim-1)),shade,texture); + break; + } else + drawcobjHP(vx,lshr16(lstart),fig.dx,fig.dy, + j,height,idist-(1<<(obj->mover->shdim-1)),shade,texture); + + if (GETFLAG(obj->oflags,OFL_HASLIGHT)) { + i = ((LightActor *)obj)->getlightfig(); + if (i > -1) { + shade = (((idist = lshr16(dist))-16)>>4)-1- //obj->selflight- + LightMap[xytoidx(obj->mover->x,obj->mover->y)]+fixshade; + if (shade<0) shade=0; else + if (shade>MAXSHADE) shade=MAXSHADE; + TFigure &lightfig = FigList[i]; // !!! + texture = mm_recall(lightfig.memidx); + destx = z - ((LightActor *)obj)->lightz - lshl16(lightfig.height); + lend = prehoriz+fixdiv64shl16(destx*heightnumerator,dist); + lstart = prehoriz+fixdiv64shl16((destx-lshl16(lightfig.dy))*heightnumerator,dist); + if (lshr16(lstart)>=viewbottom || lshr16(lend)> 4; + ovx -= j >> 1; + shade = (7-shade); + if (shade <= 0) shade = ((-shade) >> 2) + 1; + shade -= ((LightActor *)obj)->lightpow; + if (shade<-1) shade=-1; + drawclightHP(ovx,lshr16(lstart),lightfig.dx,lightfig.dy, + j,height,idist-(lightfig.dx >> 1),shade,texture); + } + } + } + } +#else + dobjlist.flush(); +#endif + if (raindraw && rain_near) drawrain(); +} + +void invpix(int x, int y, char shader) { +asm { + LES DI, vpage + MOV AX, y + XCHG AH, AL + ADD DI, AX + SHR AX, 2 + ADD DI, AX + ADD DI, x + MOV AL, ES:[DI] + //AND AL, 0x0f + SUB AL, 15 + NEG AL + AND AL, 0x0f + OR AL, 0xe0 + + MOV AH, AL + ADD AL, shader + XOR AH, AL + AND AH, HISHMASK + JZ store + XOR AH, AL + OR AL, LOSHMASK +} store: asm { + MOV ES:[DI], AL +}} + +void drawrain() { + byte col; + int sx = viewleft, sy = viewtop; + int i,j,k,ix,iy, + app = viewwidth>>7; + fixed x,rs,dex; + for (i=0; i>1); + dex = fixmul(rs>>4,viewsin); + for (j=0,col=k;j=0 && ix=0 && iy=212) { + asm { // Draw long rain + MOV DX, viewtop + PUSH BP // !!! Ma sei impazzito !? + MOV BP, viewleft + LES DI, vpage + LEA SI, rain_info + MOV CX, MAXRAIN + CLD + } c1: asm { + LODSW + ADD AX, BP + MOV BX, AX + LODSW + ADD AX, DX + XCHG AH, AL + ADD BX, AX + SHR AX, 2 + ADD BX, AX + MOV AL, 226 + MOV ES:[DI+BX], AL + ADD BX, 319 + DEC AL + DEC AL + MOV ES:[DI+BX], AL + LOOP c1 + POP BP + // !!! SS==DS + MOV AX, SS + MOV DS, AX + } + } else { + asm { // Draw short rain + MOV DX, viewtop + PUSH BP // !!! + MOV BP, viewleft + LES DI, vpage + LEA SI, rain_info + MOV CX, MAXRAIN + CLD + } c2: asm { + LODSW + ADD AX, BP + MOV BX, AX + LODSW + ADD AX, DX + XCHG AH, AL + ADD BX, AX + SHR AX, 2 + ADD BX, AX + MOV AL, 225 + MOV ES:[DI+BX], AL + LOOP c2 + POP BP + // !!! SS==DS + MOV AX, SS + MOV DS, AX + } + } +} + +void anim_rain() { + // Animate rain (separate for frame skipping) + int i, sx=rainspeed>>1, sy=rainspeed; + for (i=0; i>1; i++) { + if ((rain_info[i].x-=sx)<=1) rain_info[i].x = viewwidth-1; + if ((rain_info[i].y+=sy)>=viewheight-1) rain_info[i].y = 0; + } + //sx++; + sy++; + for (i=MAXRAIN>>1; i=viewheight-1) rain_info[i].y = 0; + } +} +*/ + +void anim_rain() { + int i; + fixed rb = lshl16(viewwidth+2), + bb = lshl16(viewheight+2), + spd = lshl16(viewwidth/80), + app; + //int randlim = viewheight/3; + for (i=0; i>1,viewsin); + ri.y += app; + rain_speed[i] += app>>4 /*16384l*/; + if (ri.x < -2l< rb) ri.x = -2l< bb) { + ri.y = -2l<>2; + real_dx = ((long)dx*viewwidth)/320; + real_dy = ((long)dy*viewwidth)/320; + real_hotx = ((long)hotx*viewwidth)/320; + real_hoty = ((long)(dy+hoty)*viewwidth)/320; + jmph = ((long)jmph*halfwidth)/320; + setvrect(viewleft,viewtop,viewwidth,viewheight); + scalerscfig(viewleft+halfwidth-real_hotx+fixmul(jmph,presin>>1), + viewbottom-real_hoty+(jmph>>2)+fixmul(jmph,presin)+1, + dx,dy,real_dx,real_dy,shade,mm_recall(handmidx)); + /* + drawcobjHP(viewleft+halfwidth-real_hotx+fixmul(jmph,presin>>1), + viewbottom-real_hoty+(jmph>>2)+fixmul(jmph,presin)+1, + dx,dy,real_dx,real_dy,0,shade,mm_recall(handmidx)); + */ +#endif +} + +void virtualview(fixed x, fixed y, int angle, int _noid) { + viewx = x; viewy = y; + viewangle = angle; + viewcos = costab[viewangle]; + viewsin = sintab[viewangle]; + noid = _noid; + int *angptr = angtab; + fdfill(seenmap,0l,4096); // 4096 = sizeof seenmap; + for (linex=viewwidth;linex--;) { + if ((rayangle = angle + *(angptr++)) >= ANG360) rayangle -= ANG360; + initray(); + raycast(); + } + dobjlist.flush(); + //int objid; + //while ((objid = dobjlist.get(dist))>=0); +} + +void drawmap(int cx, int cy, fixed x, fixed y, int ang, char *sm) { + int i,j,k,l,curx,cury,bx,by,bdx,bdy,sqrdim; + byte col; + setvrect(cx-halfwidth,cy-halfheight,viewwidth,viewheight); + //if ((sqrdim = (viewwidth+32)>>6)<1) sqrdim=1; + sqrdim = (viewwidth+32)>>6; + bdx = (viewwidth+((sqrdim-1)<<1))/sqrdim; + bdy = (viewheight+((sqrdim-1)<<1))/sqrdim; + if ((bx=(lshr16(x)>>6)-(bdx>>1))<0) {bdx+=bx;bx=0;} + if ((by=(lshr16(y)>>6)-(bdy>>1))<0) {bdy+=by;by=0;} + if (bx+bdx>64) bdx=64-bx; + if (by+bdy>64) bdy=64-by; + //curx = cx-bx*sqrdim-(((lshr16(x) & 63)*sqrdim)>>6); + //cury = cy-by*sqrdim-(((lshr16(y) & 63)*sqrdim)>>6); + curx = cx-((int)fixmul(sqrdim,x-lshl16(bx<<6))>>6); + cury = cy-((int)fixmul(sqrdim,y-lshl16(by<<6))>>6); + bx<<=6; + ffillblock(cx-halfwidth,cy-halfheight, + viewwidth,viewheight,0x7f7f7f7fl); // 127 = 7fh black sh. + if (GETFLAG(gameflags,GFL_TOTALMAP)) { + for (i=bdx;i--;bx+=64,curx+=sqrdim) + for (j=bdy,k=by,l=cury;j--;k++,l+=sqrdim) { + TMapInfo &mapinf = Map[bx+k]; + if (mapinf.stop) + if (mapinf.shape==MSH_DOOR) { + if (doormanager.doorpos(mapinf.data)==64) col=3; else + if (doormanager.doortype[mapinf.data]==T_DOORY) col=132; else + if (doormanager.doortype[mapinf.data]==T_DOORR) col=82; else + col = 232; + } else + if (mapinf.type==MTP_DOOR1 || mapinf.type==MTP_DOOR2) { + if (doormanager.doorpos(mapinf.data)==64) col=3; + else col=118; + } else + if (mapinf.data==T_SWITCHU) col=160; + else col=118; + else + if (IDMap[bx+k]>=0) col=126; //col=136; + else col=3; + putlcchar(curx,l,sqrdim,sqrdim,col,0,mapsquare); + } + } else { + for (i=bdx;i--;bx+=64,curx+=sqrdim) + for (j=bdy,k=by,l=cury;j--;k++,l+=sqrdim) + if (sm[bx+k]) { + TMapInfo &mapinf = Map[bx+k]; + if (mapinf.stop) + if (mapinf.shape==MSH_DOOR) { + if (doormanager.doorpos(mapinf.data)==64) col=6; else + if (doormanager.doortype[mapinf.data]==T_DOORY) col=132; else + if (doormanager.doortype[mapinf.data]==T_DOORR) col=82; else + col = 232; + } else + if (mapinf.type==MTP_DOOR1 || mapinf.type==MTP_DOOR2) { + if (doormanager.doorpos(mapinf.data)==64) col=6; + else col=118; + } else + if (mapinf.data==T_SWITCHU) col=160; + else col=118; + else col=6; + //if (seenmap[bx+k]) col=1; else col=6; + putlcchar(curx,l,sqrdim,sqrdim,col,0,mapsquare); + } + } + putpix(cx+fixmul(1,costab[ang]),cy+fixmul(1,sintab[ang]),113); + putpix(cx+fixmul(2,costab[ang]),cy+fixmul(2,sintab[ang]),112); + putpix(cx,cy,114); +} + +void updatemap(void far *sm) { +asm { + LES DI, sm + LEA SI, seenmap + MOV CX, 1024 + CLD +} c1: asm { + DB 0x66; LODSW + DB 0x66; OR WORD PTR ES:[DI], AX + ADD DI, 4 + LOOP c1 + // !SS==DS! + MOV AX, SS + MOV DS, AX +}} + +void init3DEngine() { + map = (word *)Map; + objmap = (word *)ObjMap; + fwfill(mapsquare,0x01010101l,25); + //vpage = new char[64000]; // !!!!!!!! + setvbuff(vpage); // LGRAPH + calctables(); + //setviewsize(320-10,200-32); // ??? + setviewsize(320,200-32); + //drawview(160,100,x,y,z,angle,vangle<0 ? vangle+ANG360 : vangle); +} diff --git a/KaosSrc/3dengine.hpp b/KaosSrc/3dengine.hpp new file mode 100644 index 0000000..aa274bb --- /dev/null +++ b/KaosSrc/3dengine.hpp @@ -0,0 +1,60 @@ +/************************************************************************ + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + ************************************************************************/ + +#define ANGLVL 8 // IF YOU CHANGE THIS... cambia pure le routines + +#define ANG0 0 +#define ANG30 ( 30*ANGLVL) +#define ANG45 ( 45*ANGLVL) +#define ANG60 ( 60*ANGLVL) +#define ANG90 ( 90*ANGLVL) +#define ANG145 (145*ANGLVL) +#define ANG180 (180*ANGLVL) +#define ANG225 (225*ANGLVL) +#define ANG270 (270*ANGLVL) +#define ANG315 (315*ANGLVL) +#define ANG360 (360*ANGLVL) + +typedef struct { byte floor, ceil; } TFCInfo; + +extern int angleadd(int,int); +extern int anglesub(int,int); + +extern fixed *costab, *sintab, *tantab; +extern int *angtab; +extern int viewwidth; +extern int viewangle; +extern fixed viewx, viewy, viewz; +extern fixed viewcos, viewsin; +//extern int viewtop, viewbottom, viewleft, viewright; +extern int viewwidth, viewheight, halfwidth, halfheight; +extern int thunderdraw, thunderang, thunderz, underblack; + +extern word *map; +extern word *objmap; +extern char seenmap[4096]; +//extern TFCInfo *fcmap; +extern byte *floormap; +extern byte *ceilmap; +extern void far *vpage; +extern char raindraw; + +extern void init3DEngine(); +extern void setviewsize(int width, int height); +extern void drawview(int cx, int cy, fixed x, fixed y, fixed z, + int hang, int vang, int _noid, + char &backceildraw, char &backfloordraw, char fixshade); +extern void drawhand(int handmidx, int dx, int dy, int hotx, int hoty, + int jmph, int angle, char shade); +extern void virtualview(fixed x, fixed y, int angle, int _noid); +extern int lookray(fixed x1,fixed y1,fixed x2,fixed y2,word mask); +extern int fireray(fixed &x, fixed &y, int angle, int vangle, // !!! + fixed &_dist, fixed &z, int _noid); +extern void anim_rain(); +extern void drawrain(); +extern void drawmap(int cx, int cy, fixed x, fixed y, int ang, char *sm); +extern void updatemap(void far *sm); \ No newline at end of file diff --git a/KaosSrc/3drflat.cpp b/KaosSrc/3drflat.cpp new file mode 100644 index 0000000..1de7baf --- /dev/null +++ b/KaosSrc/3drflat.cpp @@ -0,0 +1,1235 @@ +/************************************************************************ + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + ************************************************************************/ + +// Nicosoft's 3DEngine for KAOS - (C)1996 Valentini Domenico + +// MAXSHADE: deve essere potenza di 2 ! +#define MAXSHADE 16 + +#define HISHMASK (0xFF-MAXSHADE+1) +#define LOSHMASK (MAXSHADE-1) + +// #include "3dengine.hpp" + +int linex, // colonna video + liney, // riga video + lineh, // MURI = altezza muro; PAVIMENTO/SOFFITTO = riga corrente + column; // MURI = colonna texture (muri); P/S = colonna corrente +unsigned long wstep, woffs; +void far *texture; // TEXTURE da disegnare +#ifdef __DOUBLEWALLS__ +void far *htexture; // higher TEXTURE da disegnare +#endif +void far *vpage = (void far *)(new char[64000]);//VMEMPTR; //(void far *)(new char[64000]); +word *coldist = new word[MAXVIEWWIDTH]; + +fixed curx, cury, curincx, curincy; +char shade; +int maxcolumn; +int viewtop, viewbottom, viewleft, viewright; +int mskx, msky; + +void far *hid; +unsigned fcdest; +fixed txt_indx, indincx; + +fixed backx, backy1, backy2; +/* +void drawwall(char shader) { + unsigned lostep; +asm { + PUSH DS + LES DI, vpage + ADD DI, linex + MOV AX, liney + XCHG AL, AH + ADD DI, AX + SHR AX, 2 + ADD DI, AX + + CLD + MOV CX, lineh + MOV AX, WORD PTR wstep + MOV lostep, AX + MOV BX, WORD PTR wstep[2] + MOV DX, WORD PTR woffs + MOV AX, column + SHL AX, 6 + ADD AX, WORD PTR woffs[2] + LDS SI, texture + ADD SI, AX +} c1: asm { + MOV AL, [SI] + + // Shader + MOV AH, AL + ADD AL, shader + XOR AH, AL + AND AH, HISHMASK + JZ store + XOR AL, AH + OR AL, LOSHMASK + +} store: asm { + MOV ES:[DI], AL + ADD DI, 320 + ADD DX, lostep + ADC SI, BX + LOOP c1 + POP DS +} } +*/ +/* +void drawwall2(char shader) { + unsigned lostep, histep; + int cnt; +asm { + LES DI, vpage + ADD DI, linex + MOV AX, liney + XCHG AL, AH + ADD DI, AX + SHR AX, 2 + ADD DI, AX + + //CLD + MOV AX, lineh + MOV cnt, AX + MOV AX, WORD PTR wstep + MOV lostep, AX + MOV CX, WORD PTR wstep[2] + //MOV histep, AX + MOV DX, WORD PTR woffs + MOV BX, WORD PTR woffs[2] + MOV AX, column + SHL AX, 6 + LDS SI, texture + ADD SI, AX +} c1: asm { + MOV AL, [SI+BX] + + // Shader + MOV AH, AL + ADD AL, shader + XOR AH, AL + AND AH, HISHMASK + JZ store + XOR AL, AH + OR AL, LOSHMASK + +} store: asm { + MOV ES:[DI], AL + ADD DI, 320 + ADD DX, lostep + ADC BX, CX + AND BX, 0x003f + DEC cnt + JNZ c1 + // ASSUME SS==DS + MOV AX, SS + MOV DS, AX +} } +*/ +/* +void near drawwallHP(char shader) { + unsigned lostep, histep, stdinc; +asm { + MOV AX, WORD PTR vpage[2] + MOV ES, AX + MOV AX, linex + MOV BX, liney + XCHG BL, BH + ADD AX, BX + SHR BX, 2 + ADD AX, BX + ADD AX, WORD PTR vpage + MOV DI, AX + + CLD + MOV CX, lineh + MOV AX, WORD PTR wstep + MOV lostep, AX + MOV AX, WORD PTR wstep[2] + MOV BX, AX + AND AX, 0x000F + MOV histep, AX + AND BX, 0xFFF0 + MOV stdinc, BX + MOV BX, WORD PTR woffs[2] + MOV DX, BX + SHR DX, 4 + MOV AX, column + SHL AX, 6 + ADD AX, DX + MOV DX, WORD PTR woffs + LDS SI, texture + ADD SI, AX +} c1: asm { + MOV AL, [SI] + + // Shader + MOV AH, AL + ADD AL, shader + XOR AH, AL + AND AH, HISHMASK + JZ store + XOR AL, AH + OR AL, LOSHMASK + +} store: asm { + MOV ES:[DI], AL + ADD DI, 320 + AND BX, 0x000F + OR BX, stdinc + ADD DX, lostep + ADC BX, histep + MOV AX, BX + SHR AX, 4 + ADD SI, AX + LOOP c1 + // !!! SS==DS !!! + MOV AX, SS + MOV DS, AX +} } +*/ +#ifndef __DOUBLEWALLS__ +void near drawwallHP(char shader) { + unsigned lostep, histep; //, stdinc + int cnt; +asm { + MOV AX, WORD PTR vpage[2] + MOV ES, AX + MOV AX, linex + MOV BX, liney + XCHG BL, BH + ADD AX, BX + SHR BX, 2 + ADD AX, BX + ADD AX, WORD PTR vpage + MOV DI, AX + + // CLD non ci sono LODS + MOV AX, lineh + MOV cnt, AX + MOV AX, WORD PTR wstep + MOV lostep, AX + MOV AX, WORD PTR wstep[2] + MOV histep, AX + MOV CX, WORD PTR woffs[2] + AND CX, 0x03ff + MOV BX, CX + SHR BX, 4 + MOV AX, column + SHL AX, 6 + MOV DX, WORD PTR woffs + LDS SI, texture + ADD SI, AX + +} c1: asm { + MOV AL, [SI+BX] + + // Shader + MOV AH, AL + ADD AL, shader + XOR AH, AL + AND AH, HISHMASK + JZ store + XOR AH, AL + OR AL, LOSHMASK + +} store: asm { + MOV ES:[DI], AL + ADD DI, 320 + ADD DX, lostep + ADC CX, histep + AND CX, 0x03ff + MOV BX, CX + SHR BX, 4 + DEC cnt + JNZ c1 + // !!! SS==DS !!! + MOV AX, SS + MOV DS, AX +} } +#else + +void near drawwallHP(char shader) { + unsigned lostep, histep; + int cnt; +asm { + MOV AX, WORD PTR vpage[2] + MOV ES, AX + MOV AX, linex + MOV BX, liney + XCHG BL, BH + ADD AX, BX + SHR BX, 2 + ADD AX, BX + ADD AX, WORD PTR vpage + MOV DI, AX + + // CLD no LODS + MOV CX, lineh + MOV cnt, CX + MOV AX, WORD PTR wstep + MOV lostep, AX + MOV AX, WORD PTR wstep[2] + MOV BX, AX + MOV histep, AX + MOV CX, WORD PTR woffs[2] + AND CX, 0x03ff + MOV BX, CX + SHR BX, 4 + MOV AX, column + SHL AX, 6 + MOV DX, WORD PTR woffs + LDS SI, texture + ADD SI, AX +} c1: asm { + MOV AL, [SI+BX] + + // Shader + MOV AH, AL + ADD AL, shader + XOR AH, AL + AND AH, HISHMASK + JZ store + XOR AL, AH + OR AL, LOSHMASK + +} store: asm { + MOV ES:[DI], AL + ADD DI, 320 + ADD DX, lostep + ADC CX, histep + AND CX, 0x03ff + MOV AX, CX + SHR AX, 4 + MOV BX, AX + DEC cnt + JNZ c1 + // !!! SS==DS !!! + MOV AX, SS + MOV DS, AX +} } + +void near drawwallHP2(char shader) { + unsigned lostep, histep; + int cnt; + void far *nexttext = texture; + int disp; +asm { + MOV AX, WORD PTR texture + SUB AX, WORD PTR htexture + MOV disp, AX + + MOV AX, WORD PTR vpage[2] + MOV ES, AX + MOV AX, linex + MOV BX, liney + XCHG BL, BH + ADD AX, BX + SHR BX, 2 + ADD AX, BX + ADD AX, WORD PTR vpage + MOV DI, AX + + // CLD no LODS + MOV CX, lineh + MOV cnt, CX + MOV AX, WORD PTR wstep + MOV lostep, AX + MOV AX, WORD PTR wstep[2] + MOV BX, AX + MOV histep, AX + MOV CX, WORD PTR woffs[2] + MOV SI, CX + AND CX, 0x03ff + MOV BX, CX + SHR BX, 4 + MOV AX, column + SHL AX, 6 + MOV DX, WORD PTR woffs + TEST SI, 0xfc00 + JNZ lowwall + LDS SI, htexture + ADD SI, AX + ADD disp, AX + JMP c1 +} lowwall: asm { + LDS SI, texture + ADD SI, AX + //XOR AX, AX + MOV disp, AX +} c1: asm { + MOV AL, [SI+BX] + + // Shader + MOV AH, AL + ADD AL, shader + XOR AH, AL + AND AH, HISHMASK + JZ store + XOR AL, AH + OR AL, LOSHMASK + +} store: asm { + MOV ES:[DI], AL + ADD DI, 320 + ADD DX, lostep + ADC CX, histep + TEST CX, 0xfc00 + JZ pass + LDS SI, nexttext + ADD SI, disp +} pass: asm { + AND CX, 0x03ff + MOV AX, CX + SHR AX, 4 + MOV BX, AX + DEC cnt + JNZ c1 + // !!! SS==DS !!! + MOV AX, SS + MOV DS, AX +} } + +#endif + +void near vline(byte col) { +asm { // No zero check + MOV CX, lineh + MOV DX, linex + MOV AX, liney + XCHG AH, AL + LDS SI, vpage + ADD SI, DX + ADD SI, AX + SHR AX, 2 + ADD SI, AX + + MOV AL, col + MOV DX, 320 + // CLD no LODS +} c1: asm { + MOV [SI], AL + ADD SI, DX + LOOP c1 + // !!! SS==DS !!! + MOV AX, SS + MOV DS, AX +}} + +void near init_fc() { +asm { + MOV AX, linex + MOV BX, liney + XCHG BH, BL + ADD AX, BX + SHR BX, 2 + ADD AX, BX + ADD AX, WORD PTR vpage + MOV fcdest, AX + + DB 0x66; MOV AX, WORD PTR curincx + DB 0x66; SHL AX, 6 // !!!!!!! SHL non cambia ?! + DB 0x66; MOV WORD PTR indincx, AX + + DB 0x66; MOV AX, WORD PTR curx + DB 0x66; AND AX, 0xffff; DW 0x003f + DB 0x66; SHL AX, 6 + DB 0x66; MOV WORD PTR txt_indx, AX + + MOV AX, WORD PTR curx[2] + AND AX, 0xffc0 + MOV mskx, AX + MOV AX, WORD PTR cury[2] + AND AX, 0xffc0 + MOV msky, AX +} } + +int near fast_drawfc() { +asm { + MOV DI, fcdest + DB 0x66; MOV DX, WORD PTR indincx + + MOV CX, column + LES SI, hid + MOV AX, CX + SHL AX, 1 + ADD SI, AX + // CLD no LODS +} cic1: asm { + MOV AX, WORD PTR ES:[SI] + CMP lineh, AX + JGE nodraw + + MOV AX, WORD PTR txt_indx[2] + AND AX, 0x0fc0 + MOV BX, WORD PTR cury[2] + AND BX, 0x003f + ADD AX, BX + //PUSH DS + MOV BX, SI + LDS SI, texture + ADD SI, AX + MOV AL, [SI] + MOV SI, BX + // !!! SS==DS !!! + MOV BX, SS + MOV DS, BX + //POP DS + + // Shader (C)Nicosoft + MOV AH, AL + ADD AL, shade + XOR AH, AL + AND AH, HISHMASK + JZ store + XOR AL, AH + OR AL, LOSHMASK + +} store: asm { + MOV BX, ES + MOV ES, WORD PTR vpage[2] + MOV ES:[DI], AL + MOV ES, BX +} nodraw: asm { + INC CX + INC DI + //ADD SI, 2 + INC SI + INC SI + + DB 0x66; ADD WORD PTR txt_indx, DX + DB 0x66; MOV AX, WORD PTR curincx + DB 0x66; ADD WORD PTR curx, AX + DB 0x66; MOV AX, WORD PTR curincy + DB 0x66; ADD WORD PTR cury, AX + + MOV AX, WORD PTR curx[2] // best time + AND AX, 0xffc0 + MOV BX, WORD PTR cury[2] + AND BX, 0xffc0 + CMP AX, mskx + JNE end1 + CMP BX, msky + JNE end1 + + CMP CX, maxcolumn + JGE end2 + JMP cic1 + //JL cic1 // !!! + +} end1: asm { + MOV mskx, AX + MOV msky, BX + MOV fcdest, DI + SHR BX, 6 + ADD AX, BX +} end2: asm { + MOV column, CX +} } + +int near fast_drawtfc(byte col) { +asm { + MOV DI, fcdest + DB 0x66; MOV DX, WORD PTR indincx + + MOV CX, column + LES SI, hid + MOV AX, CX + SHL AX, 1 + ADD SI, AX + // CLD no LODS +} cic1: asm { + MOV AX, WORD PTR ES:[SI] + CMP lineh, AX + JGE nodraw + + MOV AX, WORD PTR txt_indx[2] + AND AX, 0x0fc0 + MOV BX, WORD PTR cury[2] + AND BX, 0x003f + ADD AX, BX + //PUSH DS + MOV BX, SI + LDS SI, texture + ADD SI, AX + MOV AL, [SI] + MOV SI, BX + // !!! SS==DS !!! + MOV BX, SS + MOV DS, BX + //POP DS + OR AL, AL + JNZ shdal + OR AL, col + JZ nodraw + JMP store + +} shdal: asm { + // Shader (C)Nicosoft + MOV AH, AL + ADD AL, shade + XOR AH, AL + AND AH, HISHMASK + JZ store + XOR AL, AH + OR AL, LOSHMASK + +} store: asm { + MOV BX, ES + MOV ES, WORD PTR vpage[2] + MOV ES:[DI], AL + MOV ES, BX +} nodraw: asm { + INC CX + INC DI + INC SI + INC SI + + DB 0x66; ADD WORD PTR txt_indx, DX + DB 0x66; MOV AX, WORD PTR curincx + DB 0x66; ADD WORD PTR curx, AX + DB 0x66; MOV AX, WORD PTR curincy + DB 0x66; ADD WORD PTR cury, AX + + MOV AX, WORD PTR curx[2] // best time + AND AX, 0xffc0 + MOV BX, WORD PTR cury[2] + AND BX, 0xffc0 + CMP AX, mskx + JNE end1 + CMP BX, msky + JNE end1 + + CMP CX, maxcolumn + JGE end2 + JMP cic1 + //JL cic1 // !!! + +} end1: asm { + MOV mskx, AX + MOV msky, BX + MOV fcdest, DI + SHR BX, 6 + ADD AX, BX +} end2: asm { + MOV column, CX +} } + +int near fast_drawfcblack(byte black) { +asm { + MOV DI, fcdest + DB 0x66; MOV DX, WORD PTR indincx + + MOV CX, column + LES SI, hid + MOV AX, CX + SHL AX, 1 + ADD SI, AX + // CLD no LODS +} cic1: asm { + MOV BX, WORD PTR ES:[SI] + CMP lineh, BX + JL draw +} pass: asm { + INC CX + INC DI + INC SI + INC SI + + DB 0x66; ADD WORD PTR txt_indx, DX + DB 0x66; MOV BX, WORD PTR curincx + DB 0x66; ADD WORD PTR curx, BX + DB 0x66; MOV BX, WORD PTR curincy + DB 0x66; ADD WORD PTR cury, BX + + MOV AX, WORD PTR curx[2] // best time + AND AX, 0xffc0 + MOV BX, WORD PTR cury[2] + AND BX, 0xffc0 + CMP AX, mskx + JNE end1 + CMP BX, msky + JNE end1 + + CMP CX, maxcolumn + JL cic1 // !!! + JMP end2 + //JGE end2 // !!!!? + //JMP cic1 +} draw: asm { + MOV BX, ES + MOV ES, WORD PTR vpage[2] + //XOR AL, AL + MOV AL, black //127 // Nero shadable + MOV ES:[DI], AL + MOV ES, BX + JMP pass +} end1: asm { + MOV mskx, AX + MOV msky, BX + MOV fcdest, DI + SHR BX, 6 + ADD AX, BX +} end2: asm { + MOV column, CX +} } + +int near fast_passfc() { +asm { + DB 0x66; MOV DX, WORD PTR indincx + DB 0x66; MOV BX, WORD PTR curincx + DB 0x66; MOV SI, WORD PTR curincy + + MOV CX, column + // CLD no LODS +} cic1: asm { + INC CX + INC fcdest + + DB 0x66; ADD WORD PTR txt_indx, DX + DB 0x66; ADD WORD PTR curx, BX + DB 0x66; ADD WORD PTR cury, SI + + CMP CX, maxcolumn + JGE end2 + + MOV AX, WORD PTR curx[2] // best time + AND AX, 0xffc0 + MOV DI, WORD PTR cury[2] + AND DI, 0xffc0 + CMP AX, mskx + JNE end1 + CMP DI, msky + JE cic1 +} end1: asm { + MOV mskx, AX + MOV msky, DI + SHR DI, 6 + ADD AX, DI + TEST AX, 0xf000 + JNZ cic1 +} end2: asm { + MOV column, CX +} } + +void near drawcobjHP(int x, int y, word dex, word dey, + int vdx, int vdy, word dist, char shader, + void far *rfig) { + word savedi, cnt, totresx; + fixed adjy, adjx, adjo; + word *coldistptr = coldist; + int rdy = vdy; + + //if (!rfig) return; + +asm { + XOR AX, AX + MOV WORD PTR adjy, AX + MOV WORD PTR adjx, AX + MOV AX, dey + MOV WORD PTR adjy[2], AX + MOV AX, dex + MOV WORD PTR adjx[2], AX +} + adjy = fixdiv(adjy,vdy); + adjx = fixdiv(adjx,vdx); +/* + adjo = (lshl16(dex)-(adjx*vdx))>>1; // x +asm { + MOV AX, WORD PTR adjo + MOV totresx, AX +} +*/ + //adjy = fixdiv(lshl16(dey),vdy); + //adjx = fixdiv(lshl16(dex),vdx); + if (y < viewtop) { + adjo = adjy * (viewtop-y); // !!! + rdy -= viewtop-y; + y = viewtop; + } else adjo = 0l; + if (y+rdy > viewbottom) rdy = viewbottom-y; + if (rdy<=0) return; // !!! serve ? +asm { + //PUSH DS + MOV totresx, 0 + + MOV AX, WORD PTR adjx[2] + OR AX, AX + JZ nomul + MOV BX, dey + MUL BX + MOV WORD PTR adjx[2], AX +} nomul: asm { + LES DI, vpage + MOV AX, y + XCHG AH, AL + ADD DI, AX + SHR AX, 2 + ADD DI, AX + MOV BX, x + ADD DI, BX + + SUB BX, viewleft + SAL BX, 1 + MOV cnt, BX + + // CLD no LODS + MOV CX, vdx + JCXZ end // !!! serve ? + MOV savedi, DI +} ini: asm { + PUSH CX + + MOV BX, x + CMP BX, viewleft + // JL clipx + JGE gomax + JMP clipx +} gomax: asm { + CMP BX, viewright + // JG hardend + JL gomask // only LESS + JMP hardend +} gomask: asm { + MOV BX, cnt + LES DI, coldistptr + MOV AX, WORD PTR ES:[DI+BX] + CMP AX, dist + JL clipx + + MOV AX, WORD PTR vpage[2] + MOV ES, AX + + MOV DI, savedi + + //PUSH DS + LDS SI, rfig + + MOV CX, rdy + ADD SI, WORD PTR adjo[2] + MOV DX, WORD PTR adjo + MOV BX, WORD PTR adjy[2] +} draw: asm { + MOV AL, [SI] + OR AL, AL + JZ noplot + + // Shader + MOV AH, AL + ADD AL, shader + XOR AH, AL + AND AH, HISHMASK + JZ store + XOR AL, AH + OR AL, LOSHMASK + +} store: asm { + MOV ES:[DI], AL +} noplot: asm { + ADD DI, 320 + ADD DX, WORD PTR adjy + ADC SI, BX + LOOP draw + + // !!! SS==DS !!! + MOV BX, SS + MOV DS, BX + //POP DS + +} clipx: asm { + MOV AX, WORD PTR adjx[2] + ADD WORD PTR rfig, AX + MOV AX, WORD PTR adjx + ADD totresx, AX + JNC nocar + MOV AX, dey + ADD WORD PTR rfig, AX +} nocar: asm { + ADD WORD PTR cnt, 2 + INC x + INC savedi + POP CX + DEC CX + JZ end + JMP ini +} hardend: asm { + POP CX +} end: asm { + // !!! SS==DS !!! + MOV BX, SS + MOV DS, BX + //POP DS +} } + +void near drawrcobjHP(int x, int y, word dex, word dey, + int vdx, int vdy, word dist, char shader, + void far *rfig) { + word savedi, cnt, totresx; + fixed adjy, adjx, adjo; + word *coldistptr = coldist; + int rdy = vdy; + + //if (!rfig) return; + +asm { + XOR AX, AX + MOV WORD PTR adjy, AX + MOV WORD PTR adjx, AX + MOV AX, dey + MOV WORD PTR adjy[2], AX + MOV AX, dex + MOV WORD PTR adjx[2], AX +} + adjy = fixdiv(adjy,vdy); + adjx = fixdiv(adjx,vdx); + //adjy /= vdy; + //adjx /= vdx; + //adjy = fixdiv(lshl16(dey),vdy); + //adjx = fixdiv(lshl16(dex),vdx); + if (y < viewtop) { + adjo = adjy * (viewtop-y); // !!! + rdy -= viewtop-y; + y = viewtop; + } else adjo = 0l; + if (y+rdy > viewbottom) rdy = viewbottom-y; + if (rdy<=0) return; // !!! serve ? +asm { + //PUSH DS + MOV totresx, 0 + + MOV AX, WORD PTR adjx[2] + OR AX, AX + JZ nomul + MOV BX, dey + MUL BX + MOV WORD PTR adjx[2], AX +} nomul: asm { + LES DI, vpage + MOV AX, y + XCHG AH, AL + ADD DI, AX + SHR AX, 2 + ADD DI, AX + MOV BX, x + ADD BX, vdx + DEC BX + MOV x, BX + ADD DI, BX + SUB BX, viewleft + SAL BX, 1 + MOV cnt, BX + + // CLD no LODS + MOV CX, vdx + JCXZ end // !!! serve ? + MOV savedi, DI +} ini: asm { + PUSH CX + + MOV BX, x + CMP BX, viewright + JL gomax + JMP clipx +} gomax: asm { + CMP BX, viewleft + JGE gomask // only LESS + JMP hardend +} gomask: asm { + MOV BX, cnt + LES DI, coldistptr + MOV AX, WORD PTR ES:[DI+BX] + CMP AX, dist + JL clipx + + MOV AX, WORD PTR vpage[2] + MOV ES, AX + + MOV DI, savedi + + //PUSH DS + LDS SI, rfig + + MOV CX, rdy + ADD SI, WORD PTR adjo[2] + MOV DX, WORD PTR adjo + MOV BX, WORD PTR adjy[2] +} draw: asm { + MOV AL, [SI] + OR AL, AL + JZ noplot + + // Shader + MOV AH, AL + ADD AL, shader + XOR AH, AL + AND AH, HISHMASK + JZ store + XOR AL, AH + OR AL, LOSHMASK + +} store: asm { + MOV ES:[DI], AL +} noplot: asm { + ADD DI, 320 + ADD DX, WORD PTR adjy + ADC SI, BX + LOOP draw + + // !!! SS==DS !!! + MOV BX, SS + MOV DS, BX + //POP DS + +} clipx: asm { + MOV AX, WORD PTR adjx[2] + ADD WORD PTR rfig, AX + MOV AX, WORD PTR adjx + ADD totresx, AX + JNC nocar + MOV AX, dey + ADD WORD PTR rfig, AX +} nocar: asm { + SUB WORD PTR cnt, 2 + DEC x + DEC savedi + POP CX + DEC CX + JZ end + JMP ini +} hardend: asm { + POP CX +} end: asm { + // !!! SS==DS !!! + MOV BX, SS + MOV DS, BX + //POP DS +} } + +void drawbackground(int startcol, int y) { + if (y<=viewtop-halfheight || y>=viewbottom) return; +fixed startx = backx*startcol, starty, lhx, lhy; +int cnt, vieww = viewwidth-startcol, + toty, savedi, height; + if (yviewtop+halfheight) height = viewbottom-y; + else height = halfheight; + } +asm { + LES DI, vpage + MOV AX, y + XCHG AH, AL + ADD DI, AX + SHR AX, 2 + ADD DI, AX + ADD DI, viewleft + MOV savedi, DI + DB 0x66; MOV AX, WORD PTR backx + DB 0x66; MOV WORD PTR lhx, AX + DB 0x66; MOV AX, WORD PTR backy2 + DB 0x66; MOV WORD PTR lhy, AX + MOV AX, height + MOV cnt, AX + LDS SI, texture + MOV AX, WORD PTR starty[2] + XCHG AH, AL // Parte alta * 320 + ADD SI, AX + SHR AX, 2 + ADD SI, AX + MOV AX, WORD PTR starty // Parte bassa no + MOV toty, AX + CLD +} cic1: asm { + MOV BX, WORD PTR startx[2] + MOV DX, WORD PTR startx + MOV DI, savedi + MOV CX, vieww +} cic21: asm { // Draw from startcol to viewright + MOV AL, [SI+BX] + STOSB + ADD DX, WORD PTR lhx + ADC BX, WORD PTR lhx[2] + LOOP cic21 + + XOR BX, BX + MOV CX, startcol + JCXZ hop +} cic22: asm { // Draw from viewleft to startcol + MOV AL, [SI+BX] + STOSB + ADD DX, WORD PTR lhx + ADC BX, WORD PTR lhx[2] + LOOP cic22 + +} hop: asm { + MOV AX, WORD PTR lhy[2] + MOV BX, WORD PTR lhy + ADD toty, BX + JNC okcarry + ADD AX, 320 +} okcarry: asm { + ADD SI, AX + ADD savedi, 320 + DEC cnt + JNZ cic1 + // !!! SS==DS !!! + MOV AX, SS + MOV DS, AX +}} + +void near drawclightHP(int x, int y, word dex, word dey, + int vdx, int vdy, word dist, char shader, + void far *rfig) { + word savedi, cnt, totresx; + fixed adjy, adjx, adjo; + word *coldistptr = coldist; + int rdy = vdy; + + //if (!rfig) return; + +asm { + XOR AX, AX + MOV WORD PTR adjy, AX + MOV WORD PTR adjx, AX + MOV AX, dey + MOV WORD PTR adjy[2], AX + MOV AX, dex + MOV WORD PTR adjx[2], AX +} + adjy = fixdiv(adjy,vdy); + adjx = fixdiv(adjx,vdx); + if (y < viewtop) { + adjo = adjy * (viewtop-y); // !!! + rdy -= viewtop-y; + y = viewtop; + } else adjo = 0l; + if (y+rdy > viewbottom) rdy = viewbottom-y; + if (rdy<=0) return; // !!! serve ? +asm { + //PUSH DS + MOV totresx, 0 + + MOV AX, WORD PTR adjx[2] + OR AX, AX + JZ nomul + MOV BX, dey + MUL BX + MOV WORD PTR adjx[2], AX +} nomul: asm { + LES DI, vpage + MOV AX, y + XCHG AH, AL + ADD DI, AX + SHR AX, 2 + ADD DI, AX + MOV BX, x + ADD DI, BX + + SUB BX, viewleft + SAL BX, 1 + MOV cnt, BX + + // CLD no LODS + MOV CX, vdx + JCXZ end // !!! serve ? + MOV savedi, DI +} ini: asm { + PUSH CX + + MOV BX, x + CMP BX, viewleft + // JL clipx + JGE gomax + JMP clipx +} gomax: asm { + CMP BX, viewright + // JG hardend + JL gomask // only LESS + JMP hardend +} gomask: asm { + MOV BX, cnt + LES DI, coldistptr + MOV AX, WORD PTR ES:[DI+BX] + CMP AX, dist + JL clipx + + MOV AX, WORD PTR vpage[2] + MOV ES, AX + + MOV DI, savedi + + //PUSH DS + LDS SI, rfig + + MOV CX, rdy + ADD SI, WORD PTR adjo[2] + MOV DX, WORD PTR adjo + MOV BX, WORD PTR adjy[2] +} draw: asm { + MOV AL, ES:[DI] + + // Lighter + MOV AH, [SI] + OR AH, AH + JZ noplot + CMP shader, AH + JGE noplot + MOV AH, AL + ADD AL, shader + SUB AL, [SI] + XOR AH, AL + AND AH, HISHMASK + JZ store + XOR AL, AH // clipping + AND AL, HISHMASK + //OR AL, LOSHMASK + +} store: asm { + MOV ES:[DI], AL +} noplot: asm { + ADD DI, 320 + ADD DX, WORD PTR adjy + ADC SI, BX + LOOP draw + + // !!! SS==DS !!! + MOV BX, SS + MOV DS, BX + //POP DS + +} clipx: asm { + MOV AX, WORD PTR adjx[2] + ADD WORD PTR rfig, AX + MOV AX, WORD PTR adjx + ADD totresx, AX + JNC nocar + MOV AX, dey + ADD WORD PTR rfig, AX +} nocar: asm { + ADD WORD PTR cnt, 2 + INC x + INC savedi + POP CX + DEC CX + JZ end + JMP ini +} hardend: asm { + POP CX +} end: asm { + // !!! SS==DS !!! + MOV BX, SS + MOV DS, BX + //POP DS +} } diff --git a/KaosSrc/3dsdriv.cpp b/KaosSrc/3dsdriv.cpp new file mode 100644 index 0000000..d1a25af --- /dev/null +++ b/KaosSrc/3dsdriv.cpp @@ -0,0 +1,509 @@ +/************************************************************************ + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + ************************************************************************/ + +// Nicosoźt Galactic Poly-Sounds Player Driver - (C)1997 Nicosoźt + +#include +#include "std.hpp" +#include "3dsdriv.hpp" + +// DSP Commands +#define DSPC_SPEAKER_ON 0xd1 +#define DSPC_SPEAKER_OFF 0xd3 +#define DSPC_DMA_STOP 0xd0 +#define DSPC_DMA_CONTINUE 0xd4 + +// DSP I/O Ports +#define DSP_MIXER_ADDR 0x04 +#define DSP_MIXER_DATA 0x05 +#define DSP_RESET 0x06 +#define DSP_READ_DATA 0x0a +#define DSP_WRITE_DATA 0x0c +#define DSP_WRITE_STATUS 0x0c +#define DSP_DATA_AVAIL 0x0e + +#define MIXER_IRQ_NR 0x80 +#define MIXER_DMA_NR 0x81 +#define MIXER_AGC_ON 0 +#define MIXER_AGC_OFF 1 + +// SB16 Mixer output defs +#define MIX16_OUTPUT_LINE_LEFT 0x10 +#define MIX16_OUTPUT_LINE_RIGHT 0x08 +#define MIX16_OUTPUT_CD_LEFT 0x04 +#define MIX16_OUTPUT_CD_RIGHT 0x02 +#define MIX16_OUTPUT_LINE (MIX16_OUTPUT_LINE_LEFT | MIX16_OUTPUT_LINE_RIGHT) +#define MIX16_OUTPUT_CD (MIX16_OUTPUT_CD_LEFT | MIX16_OUTPUT_CD_RIGHT) +#define MIX16_OUTPUT_MIC 0x01 +#define MIX16_DEFAULT_OUTPUT (MIX16_OUTPUT_LINE) +// SB16 Mixer input defs +#define MIX16_INPUT_MIC_LEFT 0x01 +#define MIX16_INPUT_CD_LEFT 0x04 +#define MIX16_INPUT_LINE_LEFT 0x10 +#define MIX16_INPUT_MIDI_LEFT 0x40 +#define MIX16_DEFAULT_INPUT_LEFT (MIX16_INPUT_MIC_RIGHT|MIX16_INPUT_LINE_LEFT) +#define MIX16_INPUT_MIC_RIGHT 0x01 +#define MIX16_INPUT_CD_RIGHT 0x02 +#define MIX16_INPUT_LINE_RIGHT 0x08 +#define MIX16_INPUT_MIDI_RIGHT 0x20 +#define MIX16_DEFAULT_INPUT_RIGHT (MIX16_INPUT_MIC_RIGHT|MIX16_INPUT_LINE_RIGHT) +// SBPRO Mixer input defs +#define MIXPRO_INPUT_MIC 0x11 +#define MIXPRO_INPUT_LINE 0x13 +#define MIXPRO_INPUT_CD 0x17 +/* +#define DMA_VERIFY_TRANSFER_MODE 0x00 +#define DMA_WRITE_TRANSFER_MODE 0x04 +#define DMA_READ_TRANSFER_MODE 0x08 +#define DMA_AUTOINIT_MODE 0x10 +#define DMA_ADDRESS_DECREMENT_MODE 0x20 +#define DMA_ADDRESS_INCREMENT_MODE 0x00 +#define DMA_DEMAND_MODE 0x00 +#define DMA_SINGLE_MODE 0x40 +#define DMA_BLOCK_MODE 0x80 +#define DMA_CASCADE_MODE 0xc0 +*/ +typedef struct { + byte left, right; +} TMixIndxTab; + +// SB1 Mixer table ??? +TMixIndxTab SB1tab[MIXER_DEVICE_NUM]={ +//Left Right + {0x22,0x22}, //MIXER MASTER + {0x00,0x00}, //MIXER_BASS + {0x00,0x00}, //MIXER_TREBLE + {0x26,0x26}, //MIXER_MIDI + {0x04,0x04}, //MIXER_VOICE + {0x00,0x00}, //MIXER_SPEAKER + {0x2e,0x2e}, //MIXER_LINE + {0x0a,0x00}, //MIXER_MIC + {0x28,0x28}, //MIXER_CD + {0x00,0x00}, //MIXER_IMIX + {0x00,0x00}, //MIXER_ALTPCM + {0x00,0x00}, //MIXER_AGC + {0x00,0x00}, //MIXER_OUTPUTGAIN + {0x00,0x00} //MIXER_INPUTGAIN +}; + +// SBPro Mixer table +TMixIndxTab SBPROtab[MIXER_DEVICE_NUM]={ +//Left Right + {0x22,0x22}, //MIXER MASTER + {0x00,0x00}, //MIXER_BASS + {0x00,0x00}, //MIXER_TREBLE + {0x26,0x26}, //MIXER_MIDI + {0x04,0x04}, //MIXER_VOICE + {0x00,0x00}, //MIXER_SPEAKER + {0x2e,0x2e}, //MIXER_LINE + {0x0a,0x00}, //MIXER_MIC + {0x28,0x28}, //MIXER_CD + {0x00,0x00}, //MIXER_IMIX + {0x00,0x00}, //MIXER_ALTPCM + {0x00,0x00}, //MIXER_AGC + {0x00,0x00}, //MIXER_OUTPUTGAIN + {0x00,0x00} //MIXER_INPUTGAIN +}; + +// SB16 Mixer table +TMixIndxTab SB16tab[MIXER_DEVICE_NUM]={ +//Left Right + {0x30,0x31}, //MIXER MASTER + {0x46,0x47}, //MIXER_BASS + {0x44,0x45}, //MIXER_TREBLE + {0x34,0x35}, //MIXER_MIDI + {0x32,0x33}, //MIXER_VOICE + {0x3b,0x00}, //MIXER_SPEAKER + {0x38,0x39}, //MIXER_LINE + {0x3a,0x00}, //MIXER_MIC + {0x36,0x37}, //MIXER_CD + {0x00,0x00}, //MIXER_IMIX + {0x00,0x00}, //MIXER_ALTPCM + {0x43,0x00}, //MIXER_AGC + {0x41,0x42}, //MIXER_OUTPUTGAIN + {0x3f,0x40} //MIXER_INPUTGAIN +}; + +// SB Defaults +/* +unsigned SBdefault[MIXER_DEVICE_NUM] = +{// L R + 0xf0f0, // Master (SB16 Max 0xf8) + 0x9090, // Bass (SB16 Max 0xf0) + 0xd0d0, // Treble (SB16 Max 0xf0) + 0x0000, // MIDI (SB16 Max 0xf8) + 0xe0e0, // Voice (SB16 Max 0xf8) + 0x0000, // PC Speaker (SB16 Max 0xc0) + 0xc0c0, // Ext Line + 0x0000, // Mic + 0x0000, // CD + 0x0000, // Recor. Monitor + 0x0000, // SB PCM + 0x0000, // Agc On (AGC on = 0, off = 1) + 0x4040, // Output Gain = 2 (2^) + 0x0000 // Input Gain = 2 (Gain=1->0x00 2->0x40 4->0x80 8->0xc0) +}; +*/ +unsigned SBdefault[MIXER_DEVICE_NUM] = +{// L R + 0xc0c0, // Master (SB16 Max 0xf8) + 0xa0a0, // Bass (SB16 Max 0xf0) + 0x7070, // Treble (SB16 Max 0xf0) + 0x7070, // MIDI (SB16 Max 0xf8) + 0xc0c0, // Voice (SB16 Max 0xf8) + 0x0000, // PC Speaker (SB16 Max 0xc0) + 0x9090, // Ext Line + 0x0000, // Mic + 0x0000, // CD + 0x0000, // Recor. Monitor + 0x0000, // SB PCM + 0x0000, // Agc On (AGC on = 0, off = 1) + 0x4040, // Output Gain = 2 (2^) + 0x0000 // Input Gain = 2 (Gain=1->0x00 2->0x40 4->0x80 8->0xc0) +}; + +int sb_ioaddr = 0; +byte sb_DMA8ch = 1, // (1) 0..3 + sb_DMA16ch = 1, // (6) 4..7 NOT ACTIVE, not yet + sb_IRQnum = 5; +byte sb_type; +int DMApage[4] = {0x87,0x83,0x81,0x82}, + DMAaddr[4] = { 0, 2, 4, 6}, + DMAlen[4] = { 1, 3, 5, 7}; +TMixIndxTab *mixtab; +word DMAbuffer_size; +byte far *DMAbuffer, far *DMAbufhalf; +byte Old8259Mask; +void interrupt far (*oldsbvect)(...); + +#pragma warn -rvl +byte sbmix_read(byte port) { +asm { + MOV DX, sb_ioaddr + ADD DX, DSP_MIXER_ADDR + MOV AL, port + OUT DX, AL + + // Delay + MOV CX, 16 + CLD + REP IN AL, 0x80 + + MOV DX, sb_ioaddr + ADD DX, DSP_MIXER_DATA + IN AL, DX +}} +#pragma warn +rvl + +void sbmix_write(byte port, byte data) { +asm { + MOV DX, sb_ioaddr + ADD DX, DSP_MIXER_ADDR + MOV AL, port + OUT DX, AL + + // Delay + MOV CX, 16 + CLD + REP IN AL, 0x80 + + MOV DX, sb_ioaddr + ADD DX, DSP_MIXER_DATA + MOV AL, data + OUT DX, AL +}} +/* +byte sbmix_detect() { + // !!! Pu• provocare uno spike in output ??? + // ...ma tutto ci• serve a qualcosa ? Secondo me no + sbmix_write(0x26,0xff); // MIDI + sbmix_write(0x04,0x33); // VOICE + if (sbmix_read(0x26) != 0xff) return 0; + if (sbmix_read(0x04) != 0x33) return 0; + sbmix_write(0x26,0x00); // off MIDI + sbmix_write(0x04,0x00); // off VOICE + return 1; +} +*/ +char sbmix_setvol(byte dev, unsigned data) { + byte left = data & 0x00ff, + right = (data & 0xff00) >> 8; + if (sb_type == SBT_SBPRO) { + left >>= 4; + right >>= 4; + } + SBdefault[dev] = ((unsigned)right << 8) | left; // Questione visuale + if (mixtab[dev].left != 0x00) { + if (mixtab[dev].left == mixtab[dev].right) { + sbmix_write(mixtab[dev].left,(left<<4)|right); + return 1; + } + sbmix_write(mixtab[dev].left,left); + } + if (mixtab[dev].right != 0x00) + sbmix_write(mixtab[dev].right,right); + return 1; +} +/* +void sbmix_reset() { + !!! + for (int i=0; i=SBT_SB16) mixtab=SB16tab; else + if (sb_type==SBT_SBPRO) mixtab=SBPROtab; else + mixtab=SB1tab; //error("No Mixer ?\n"); return; + //sbmix_reset(); + + if (sb_type >= SBT_SB16) { + //sbmix_write(0x3c,MIX16_DEFAULT_OUTPUT); + //sbmix_write(0x3d,MIX16_DEFAULT_INPUT_LEFT); + //sbmix_write(0x3e,MIX16_DEFAULT_INPUT_RIGHT); + sbmix_setIRQ(); + sbmix_write(MIXER_DMA_NR,(1<> 8); +} + +void sb_settimeconst(byte tc) { + sb_writeDSPsafe(0x40); + sb_writeDSPsafe(tc); +} + +void sb_setsamplerate(unsigned sr) { + sb_writeDSPsafe(0x42); // = PLAY; 0x41 = REC + sb_writeDSPsafe(sr >> 8); // high + sb_writeDSPsafe(sr & 0xff); // low +} + +char sb_init(byte dma8, byte dma16, byte irq) { + if (sb_autodetect()) { + // SB identify + sb_resetDSP(); + sb_writeDSPsafe(0xe1); + sb_type = sb_readDSPsafe(); + sb_readDSPsafe(); // !!! non serve + if (sb_type + +#include "std.hpp" +#include "errorstr.hpp" +#include "fastmem.hpp" +#include "fixed.h" +#include "mm4.hpp" +#include "3dsdriv.hpp" +#include "3dsound.hpp" + +#include "events.hpp" +#include "kaos.hpp" +#include "objects.hpp" +#include "3dengine.hpp" // sound ray-casting + +#include +#include + +#include // per getenv() + +//#define FIRMRIFF ((long)'R'+((long)'I'<<8)+((long)'F'<<16)+((long)'F'<<24)) +//#define FIRMWAVE ((long)'W'+((long)'A'<<8)+((long)'V'<<16)+((long)'E'<<24)) +//#define FIRMfmt ((long)'f'+((long)'m'<<8)+((long)'t'<<16)+((long)' '<<24)) +#define FIRMdata ((unsigned long)'d'+((unsigned long)'a'<<8)+((unsigned long)'t'<<16)+((unsigned long)'a'<<24)) + +char synctab[17][9] = { +// 0 +1 +2 +3 +4 +5 +6 +7 +8 +{ 0, 0, 1, 2, 3, 4, 5, 5, 5}, +{ 0, 0, 1, 2, 3, 4, 5, 5, 6}, +{ 0, 0, 2, 3, 4, 5, 5, 6, 7}, +{ 0, 0, 3, 4, 4, 5, 5, 6, 7}, +{ 0, 1, 3, 4, 5, 6, 6, 7, 8}, +{ 0, 1, 4, 5, 6, 7, 7, 9, 9}, +{ 0, 2, 5, 8, 9, 9, 9, 9, 9}, +{ 0, 5, 8, 9, 9, 10, 10, 10, 10}, +{ 0, 10, 10, 10, 10, 10, 10, 10, 10}, +{ 0, 60, 8, 10, 10, 10, 10, 10, 10}, +{ 0, 80, 50, 20, 15, 15, 12, 12, 12}, +{ 0, 100, 70, 50, 30, 20, 15, 15, 15}, +{ 0, 110, 90, 60, 50, 30, 25, 20, 20}, +{ 0, 115, 100, 70, 55, 50, 40, 30, 25}, +{ 0, 120, 110, 80, 65, 55, 50, 40, 40}, +{ 0, 127, 120, 90, 70, 60, 55, 50, 45}, +{ 0, 127, 127, 100, 80, 65, 60, 55, 50}}; + +typedef struct { + int id; // 2 + int ownerid; // 2 + int memidx; // 2 + unsigned size; // 2 + unsigned curpos; // 2 + fixed x, y; // 8 + byte lvol, rvol; // 2 + char desync; // 1 + byte flags; // 1 + char fadespeed; // 1 + byte fadecount; // 1 +} TSound; // = 24 bytes + +typedef struct { + int memidx; + word size; +} TSoundData; + +int sm_soundnum = 0, + idcnt = 0, + sm_soundvol = SM_NORMVOL; +char bufferhigh = 0, + bufferready = 0, + playing = 0, + sm_lrinverted = 0, + sm_soundok = 0, + snd_dma_off = 1; +int *appbuf; +TSound soundlist[MAXSOUNDS]; +TSoundData *sounddata = new TSoundData[MAXSNDDATA]; + +void far interrupt soundISR(...) { + sb_ackDMA(); + if ((playing = --bufferready) != 0) { + if (sb_type < SBT_SB16) sb_enableDMA(); + } else + if (sb_type >= SBT_SB16) sb_stopDMA(); + asm { + MOV AL, 0x20 + OUT 0x20, AL + } +} + +void near resetbuffer() { +asm { + LES DI, appbuf + DB 0x66; MOV AX, 0x0080; DW 0x0080 // MOV EAX, 0x00800080 + MOV CX, DMAbuffer_size + SHR CX, 1 // solo diviso 2 perch‚ di INT + CLD + REP + DB 0x66; STOSW // REP STOSD +}} + +void adjsample(char far *sample, unsigned len) { +asm { + MOV CX, len + LES DI, sample + LDS SI, sample + MOV BL, -128 + CLD +} c1: asm { + LODSB + ADD AL, BL + STOSB + LOOP c1 + // !!! SS==DS !!! + MOV AX, SS + MOV DS, AX +}} + +void near adjstorebuffer(byte far *buffer) { +asm { + //PUSH DS + MOV CX, DMAbuffer_size + LES DI, buffer + LDS SI, appbuf + MOV DX, 255 + // MOV BX, 128 + CLD +} c1: asm { + LODSW // Int INPUT + // ADD AX, BX + OR AX, AX + JNS over + XOR AL, AL + JMP store +} over: asm { + CMP AX, DX + JLE store + MOV AL, DL +} store: asm { + STOSB // Byte OUTPUT + LOOP c1 + // !!! SS==DS !!! + MOV BX, SS + MOV DS, BX + //POP DS +} end:; } + +// !!! +void near delsound(int indx) { + TSound &sound = soundlist[indx]; + //mm_unlock(sound.memidx); //!!!!! + if (sound.ownerid!=SYSOWN) + eventmanager.senddirect(EV_ENDSOUND,sound.id,sound.ownerid,0,0); + else + eventmanager.sendshort(EV_ENDSOUND,sound.id,SYSOWN,0,0); + sound = soundlist[--sm_soundnum]; +} + +char near sm_mixmonosound(TSound &sound, char *data, int vol) { + register int curpos, i; + register char *sorg; + register int *dest; + int size; + + sorg = data + (curpos = sound.curpos); + dest = appbuf; + size = sound.size; + for (i = DMAbuffer_size>>1; i--;) { + *(dest++) += *(sorg++) * vol >> SM_VOLSHIFT; + if (++curpos >= size) + if (GETFLAG(sound.flags,SFL_CONTINUE)) { + sorg = data; + curpos = 0; + } else return 0; + } + sound.curpos = curpos; + return 1; +} + +char near sm_mixstereosound(TSound &sound, char *data, int lvol, int rvol) { + register int curpos, i; + register char *sorg; + register int *dest; + int sample,size; + + sorg = data + (curpos = sound.curpos); + dest = appbuf; + size = sound.size; + for (i = DMAbuffer_size>>1; i--;) { + *(dest++) += (sample = *(sorg++)) * lvol >> SM_VOLSHIFT; // L + *(dest++) += sample * rvol >> SM_VOLSHIFT; // R + if (++curpos >= size) { + if (GETFLAG(sound.flags,SFL_CONTINUE)) { + sorg = data; + curpos = 0; + } else return 0; + } + } + sound.curpos = curpos; + return 1; +} + +char near sm_mix3Dsound(TSound &sound, char *data, + int lvol, int rvol, char desync) { + register int lpos, rpos, i; + char *lsorg, *rsorg; + char sample, ldrive; + int *dest; + int size; + + lpos = rpos = (int)sound.curpos; + ldrive = (desync<0); + size = sound.size; + if (ldrive) { + rpos += desync; + if (rpos<0) + if (GETFLAG(sound.flags,SFL_CONTINUE)) + rpos += size; + } else { + lpos -= desync; + if (lpos<0) + if (GETFLAG(sound.flags,SFL_CONTINUE)) + lpos += size; + } + lsorg = data + lpos; + rsorg = data + rpos; + dest = appbuf; + if (ldrive) { + for (i=DMAbuffer_size>>1; i--;) { + // Left + //if (lpos>=0) + *(dest++) += ((int)*(lsorg++)) * lvol >> SM_VOLSHIFT; + //else {dest++;lsorg++;} + // Right + if (rpos>=0) + *(dest++) += ((int)*(rsorg++)) * rvol >> SM_VOLSHIFT; + else {dest++;rsorg++;} + if (++lpos >= size) { + if (GETFLAG(sound.flags,SFL_CONTINUE)) { + lsorg = data; + lpos = 0; + } else return 0; + //lpos = -32000; + } + if (++rpos >= size) { + if (GETFLAG(sound.flags,SFL_CONTINUE)) { + rsorg = data; + rpos = 0; + } // else return 0; + } + } + //if (lpos<0) return 0; + sound.curpos = lpos; + } else { + for (i=DMAbuffer_size>>1; i--;) { + // Left + if (lpos>=0) + *(dest++) += ((int)*(lsorg++)) * lvol >> SM_VOLSHIFT; + else {dest++;lsorg++;} + // Right + //if (rpos>=0) + *(dest++) += ((int)*(rsorg++)) * rvol >> SM_VOLSHIFT; + //else {dest++;rsorg++;} + if (++rpos >= size) { + if (GETFLAG(sound.flags,SFL_CONTINUE)) { + rsorg = data; + rpos = 0; + } else return 0; + //else rpos = -32000; + } + if (++lpos >= size) { + if (GETFLAG(sound.flags,SFL_CONTINUE)) { + lsorg = data; + lpos = 0; + } // else return 0; + } + } + //if (rpos<0) return 0; + sound.curpos = rpos; + } + return 1; +} + +void soundmanager(fixed cx, fixed cy, int angle) { + register int i, lk, rk; + int rv, lv, obstacles, vdr, vdl; + char desync, play; + fixed x,y,viewcos, viewsin; + char far *data; + + if (!sm_soundok || !sm_soundnum || bufferready==2) return; + + viewcos = costab[angle]; + viewsin = sintab[angle]; + + resetbuffer(); + for (i=0; i0) + if (sound.fadecount < sound.lvol) { + if ((sound.fadecount += 2) > sound.lvol) + sound.fadecount = sound.lvol; + } else sound.fadespeed=0; + else + if (sound.fadespeed<0) + if (sound.fadecount > 0) { + if (sound.fadecount < 2) + sound.fadecount = 0; + else + sound.fadecount -= 2; + } else { //sound.fadespeed=0; + delsound(i--); + continue; + } + lv = rv = sound.fadecount; + } else { + lv = sound.lvol; + rv = sound.rvol; + } + if (GETFLAG(sound.flags,SFL_3D) && cx>=0) { + if (GETFLAG(sound.flags,SFL_FOLLOW)) { + Object *obj; + if ((obj = objectslist.get(sound.ownerid)) != NULL) { + x = sound.x + obj->mover->x; + y = sound.y + obj->mover->y; + } //else continue; + } else { + x = sound.x; + y = sound.y; + } + // lk = y = dist + lk = lshr16(fixmul(x-cx,viewcos) + fixmul(y-cy,viewsin))>>4; + // rk = x = displ + rk = lshr16(fixmul(y-cy,viewcos) - fixmul(x-cx,viewsin))>>4; + vdl = intdist(lk,rk+1); // distanza aumenta se rk>0 + vdr = intdist(lk,rk-1); // distanza aumenta se rk<0 + if (rk>1) vdl+=rk-1; + if (rk<-1) vdr-=rk+1; + if (lk<0) {vdl+=4;vdr+=4;} + lv -= vdl; + rv -= vdr; + /* + lv -= intdist(lk,rk-1); + rv -= intdist(lk,rk+1); + if (lk<0) {lv-=2;rv-=2;} + */ + + if (GETFLAG(sound.flags,SFL_RAY)) { + obstacles = lookray(x,y,cx,cy,OMM_SOUNDABLE)<<2; + lv-=obstacles; + rv-=obstacles; + /* + char far *ptr = (char _seg *)0xAD20 + (char near *)0; + for (i=0;i<30;i++) + if (i>1; + if (sound.curpos >= sound.size) + sound.curpos -= sound.size; + } else delsound(i--); + continue; + } + if (sb_type >= SBT_SBPRO) { + while (ABS(lk)>8 || ABS(rk)>8) {lk>>=1;rk>>=1;} + if (rk>=0) desync = synctab[8-lk][ rk]; + else desync = -synctab[8-lk][-rk]; + + } else desync = 0; + } else { + if (sb_type>=SBT_SBPRO) desync = sound.desync; + else desync = 0; + } + //size = sound.size; + if (!(data = (char *)mm_recall(sound.memidx))) { + delsound(i--); + continue; + } + if (sm_lrinverted) { + asm { + MOV AX, lv + XCHG rv, AX + MOV lv, AX + } + desync = -desync; + } + if (!desync) + if (sb_type>=SBT_SBPRO) + play = sm_mixstereosound(sound,data, + lv*sm_soundvol>>SM_VOLSHIFT,rv*sm_soundvol>>SM_VOLSHIFT); + else + play = sm_mixmonosound(sound,data,lv*sm_soundvol>>SM_VOLSHIFT); + else + play = sm_mix3Dsound(sound,data, + lv*sm_soundvol>>SM_VOLSHIFT,rv*sm_soundvol>>SM_VOLSHIFT,desync); + if (!play) delsound(i--); + } + if (bufferhigh) { + adjstorebuffer(DMAbufhalf); + bufferhigh--; + } else { + adjstorebuffer(DMAbuffer); + bufferhigh++; + } + bufferready++; + if (!playing) { + if (sb_type < SBT_SB16 || snd_dma_off) { + sb_enableDMA(); + snd_dma_off=0; + } else sb_continueDMA(); + playing++; + } +} + +void loadsound(int sndnum, const char *wavname) { + TSoundData &snd = sounddata[sndnum]; + int handle; + unsigned long i; + char far *ptr; + + if (snd.memidx) error("loadsound","multiple assign"); + +#ifndef __DATAFILE__ + if (!sm_soundok) return; + if ((handle = _open(wavname,O_RDONLY|O_BINARY)) != -1) { + lseek(handle,0x10,SEEK_SET); // cut cut + do { + _read(handle,&i,4); + lseek(handle,i,SEEK_CUR); + _read(handle,&i,4); + } while (i != FIRMdata); + _read(handle,&i,4); + snd.size = (unsigned)i-2; + ptr = (char far *)mm_recall(snd.memidx = mm_alloc(snd.size)); + _read(handle,ptr,snd.size); + _close(handle); + adjsample(ptr,snd.size); + } else error("loadsound",err_filenotfound); +#else + //if (sb_soundok) { + snd.memidx = mm_alloc(0); // automatic size detection + snd.size = mm_getblocksize(snd.memidx); + /* + } else { + mm_alloc(2,snd.memidx); + snd.size = 2; + } + */ +#endif + mm_unload(snd.memidx); // il suono Š inutile... +} + +// !!! +int near getownsound(int owner, char all) { + int i; + if (owner!=SYSOWN) + for(i=0;i=0) { + TSoundData &snd = sounddata[sndnum]; + if (mm_recall(snd.memidx) == NULL) return -1; + if (indx<0 || !GETFLAG(flags,SFL_OVERSOUND)) + indx = sm_soundnum; + TSound &sound = soundlist[indx]; + sound.id = idcnt; + idcnt = (idcnt+1) & 0x7fff; + // bisognerebbe controllare se gi… c'Š quest'ID !!! + sound.ownerid = owner; + sound.memidx = snd.memidx; + //if ((sound.data = (char far *)mm_recall(snd.memidx)) == NULL) + // return -1; + //mm_lock(snd.memidx); //!!!!! + sound.size = snd.size; + sound.curpos = 0; + sound.x = x; + sound.y = y; + sound.flags = flags; + sound.desync = 0; + if (vol) { + sound.rvol = sound.lvol = vol; + } else { + sound.rvol = sound.lvol = SM_MAXVOL; + } + if (GETFLAG(flags,SFL_FADE)) { + sound.fadespeed = 1; + sound.fadecount = 0; + } + if (indx==sm_soundnum) sm_soundnum++; + return sound.id; + + + /* + if (indx>=0 && GETFLAG(flags,SFL_OVERSOUND)) { + TSound &sound = soundlist[indx]; + sound.memidx = snd.memidx; + //mm_lock(snd.memidx); //!!!!! + sound.size = snd.size; + sound.curpos = 0; + sound.x = x; + sound.y = y; + sound.flags = flags; + sound.desync = 0; + if (vol) { + sound.rvol = sound.lvol = vol; //(int)vol*SM_MAXVOL>>5; + + // sound.lvol = lv; + // sound.rvol = rv; + + } else { + sound.rvol = sound.lvol = SM_MAXVOL; + } + + if (GETFLAG(flags,SFL_FADE)) { + sound.fadespeed = 1; + sound.fadecount = 0; + } + + return sound.id; + } else { + TSound &sound = soundlist[sm_soundnum]; + sound.id = idcnt; + sound.ownerid = owner; + sound.memidx = snd.memidx; + //sound.data = (char far *)mm_recall(snd.memidx); + //if ((sound.data = (char far *)mm_recall(snd.memidx)) == NULL) + // return -1; + if (mm_recall(snd.memidx) == NULL) return -1; + //mm_lock(snd.memidx); //!!!!! + sound.size = snd.size; + sound.curpos = 0; + sound.x = x; + sound.y = y; + sound.flags = flags; + sound.desync = 0; + if (vol) { + sound.rvol = sound.lvol = vol; //(int)vol*SM_MAXVOL>>5; + //sound.rvol = (int)rv*SM_MAXVOL>>5; !!! + } else { + sound.rvol = sound.lvol = SM_MAXVOL; + } + idcnt = (idcnt+1) & 0x7fff; + // bisognerebbe controllare se gi… c'Š quest'ID !!! + sm_soundnum++; + + if (GETFLAG(flags,SFL_FADE)) { + sound.fadespeed = 1; + sound.fadecount = 0; + } + + return sound.id; + } + */ + } + } + return -1; +} + +int playsound(int sndnum, byte lvol, byte rvol, char desync, int owner, byte flags) { + if (sm_soundok && sndnum=0) { + TSoundData &snd = sounddata[sndnum]; + if (mm_recall(snd.memidx) == NULL) return -1; + //if (indx>=0 && GETFLAG(flags,SFL_OVERSOUND)) { + if (indx<0 || !GETFLAG(flags,SFL_OVERSOUND)) + indx = sm_soundnum; + TSound &sound = soundlist[indx]; + sound.id = idcnt; + idcnt = (idcnt+1) & 0x7fff; + // bisognerebbe controllare se gi… c'Š quest'ID !!! + sound.ownerid = owner; + sound.memidx = snd.memidx; + //if ((sound.data = (char far *)mm_recall(snd.memidx)) == NULL) + // return -1; + //mm_lock(snd.memidx); //!!!!! + sound.size = snd.size; + sound.curpos = 0; + sound.flags = flags; + sound.desync = desync; + if (lvol) { + sound.lvol = lvol; + sound.rvol = rvol; + } else { + sound.rvol = sound.lvol = SM_MAXVOL; + } + if (GETFLAG(flags,SFL_FADE)) { + sound.fadespeed = 1; + sound.fadecount = 0; + } + if (indx==sm_soundnum) sm_soundnum++; + return sound.id; + } + } + return -1; +} + +void ownerdead(int owner) { + int indx; + + if (!sm_soundok) return; + while ((indx = getownsound(owner,1)) >= 0) { + TSound &sound = soundlist[indx]; + if (GETFLAG(sound.flags,SFL_AUTOSTOP)) { + // stop sound now ! + delsound(indx); + } else + if (GETFLAG(sound.flags,SFL_CONTINUE)) { + // sound will stop... + CLRFLAG(sound.flags,SFL_CONTINUE); + //sound.flags & ~SFL_CONTINUE; + } + } +} + +char stopsound(int id) { + if (!sm_soundok) return 0; + for (int i=0; i='0' && *value<='9') + irq = number*10 + (*(value++)-'0'); + break; + default: value--; // mmm, non Š molto efficiente... + // ...ma Š corto. + } + } + if (dmalo!=1 && dmalo!=0 && dmalo!=3) dmalo=1; + if (dmahi!=5 && dmahi!=6 && dmahi!=7) dmahi=dmalo; + if (irq!=5 && irq!=7 && irq!=2 && irq!=10) irq=5; + } +} + +void initsounds() { + int _dmalo=1,_dmahi=1,_irq=5; + sm_soundok = 0; + fdfill(sounddata,0l,sizeof(TSoundData)*MAXSNDDATA); + findblasterenv(_dmalo,_dmahi,_irq); + if (sb_init(_dmalo,_dmahi,_irq)) { // !!! + if ((appbuf = new int[DMAbuffer_size]) == NULL) { + donesounds(); + return; + } + if (sb_type == SBT_SBPRO) sm_lrinverted=1; + sm_soundok = 1; + } //else sb_ioaddr = 0; automatico + //error("initsounds - No sound card detected"); +} + +void donesounds() { + if (sm_soundok) { + sb_stopDMA(); + sb_done(); + sb_ioaddr = 0; + } +} + +#pragma exit donesounds 120 \ No newline at end of file diff --git a/KaosSrc/3dsound.hpp b/KaosSrc/3dsound.hpp new file mode 100644 index 0000000..ef06252 --- /dev/null +++ b/KaosSrc/3dsound.hpp @@ -0,0 +1,47 @@ +/************************************************************************ + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + ************************************************************************/ + +#define MAXSOUNDS 16 +#define MAXSNDDATA 53 +#define SYSOWN -1 + +// Sound Flags +#define SFL_CONTINUE 0x01 +#define SFL_3D 0x02 +#define SFL_RAY 0x04 +#define SFL_FOLLOW 0x08 +#define SFL_AUTOSTOP 0x10 +#define SFL_OVERSOUND 0x20 // only one sound ! +#define SFL_FADE 0x40 + +#define SFL_FIXED 0x00 +#define SFL_BASIC SFL_3D +#define SFL_MULTI (SFL_3D|SFL_RAY|SFL_AUTOSTOP) +#define SFL_NORMAL (SFL_3D|SFL_RAY|SFL_AUTOSTOP|SFL_OVERSOUND) +#define SFL_AUTO (SFL_3D|SFL_RAY|SFL_FOLLOW|SFL_AUTOSTOP|SFL_OVERSOUND) + +#define SM_MAXVOL 40 // 32 // 48 +#define SM_NORMVOL 32 // 24 +#define SM_LOWVOL 24 // 16 +#define SM_VOLSHIFT 5 + +extern int sm_soundnum; +extern char sm_lrinverted; +extern char sm_soundok; +extern int sm_soundvol; + +extern void initsounds(); +extern void donesounds(); +extern void soundmanager(long cx, long cy, int angle); +extern void loadsound(int sndnum, const char *wavname); +extern int play3Dsound(fixed x, fixed y, int sndnum, byte vol, + int owner, byte flags); +extern int playsound(int sndnum, byte lvol, byte rvol, + char desync, int owner, byte flags); +extern void ownerdead(int id); +extern char stopsound(int id); +extern void stopallsounds(); \ No newline at end of file diff --git a/KaosSrc/AUTHORS b/KaosSrc/AUTHORS new file mode 100644 index 0000000..e5931f4 --- /dev/null +++ b/KaosSrc/AUTHORS @@ -0,0 +1 @@ +Domenico Valentini (Njc) diff --git a/KaosSrc/BIG.LFN b/KaosSrc/BIG.LFN new file mode 100644 index 0000000..5dd41e3 Binary files /dev/null and b/KaosSrc/BIG.LFN differ diff --git a/KaosSrc/COPYING b/KaosSrc/COPYING new file mode 100644 index 0000000..3a39732 --- /dev/null +++ b/KaosSrc/COPYING @@ -0,0 +1,280 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc. + 675 Mass Ave, Cambridge, MA 02139, USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Library General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS diff --git a/KaosSrc/EDITOR.DSK b/KaosSrc/EDITOR.DSK new file mode 100644 index 0000000..f5ce4e7 Binary files /dev/null and b/KaosSrc/EDITOR.DSK differ diff --git a/KaosSrc/EDITOR.PRJ b/KaosSrc/EDITOR.PRJ new file mode 100644 index 0000000..2907537 Binary files /dev/null and b/KaosSrc/EDITOR.PRJ differ diff --git a/KaosSrc/GREETING.SLF b/KaosSrc/GREETING.SLF new file mode 100644 index 0000000..a14b087 --- /dev/null +++ b/KaosSrc/GREETING.SLF @@ -0,0 +1,83 @@ + + + + + + + + + + + + + + +Saluti e ringraziamenti a: + + + +>PRIMA NATURALMENTE LE DONNE + +ORA LI OMINI + +"Peppe cogghione" + +"Fatti un AMD pi— grosso invece del Pentium !" +a proposito: +un "in bocca al lupo" per il suo OverShaft + +"Dammi l'eseguibile che al resto ci penso io" + +"Ho in mente una musica..." + +"Ma non si pu• alzare il soffitto ?" + +"Allora, l'avete finito il giochetto ?!" + + +/ ? +R.SHIFT +* (KEYPAD) +L.ALT +SPACE + CAPSLOCK +F1 +F2 +F3 + F4 + F5 +F6 +F7 +F8 +F9 +F10 + NUMLOCK + SCR.LOCK +7 (KEYPAD) +8 (KEYPAD) +9 (KEYPAD) +- (KEYPAD) +4 (KEYPAD) +5 (KEYPAD) +6 (KEYPAD) ++ (KEYPAD) +1 (KEYPAD) +2 (KEYPAD) +3 (KEYPAD) +0 (KEYPAD) +. (KEYPAD) + + +< \ +F11 +F12 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - EXTENDED SCANCODES - + + + + + + + + + + + + + + + + + + + + + + + + + + + +ENTER (KEYPAD) +R.CTRL + + + + + + + + + + + + + PRINTSCR + + + + + + + + + + +/ (KEYPAD) + + PRINTSCR +R.ALT + + + + + + + + + + + + + + +HOME +UP +PGUP + +LEFT + +RIGHT + +END +DOWN +PGDOWN +INSERT +DELETE +ő diff --git a/KaosSrc/LBM/EDITOR.LBM b/KaosSrc/LBM/EDITOR.LBM new file mode 100644 index 0000000..750f7cd Binary files /dev/null and b/KaosSrc/LBM/EDITOR.LBM differ diff --git a/KaosSrc/LBM/NICTEST.LBM b/KaosSrc/LBM/NICTEST.LBM new file mode 100644 index 0000000..8240a1e Binary files /dev/null and b/KaosSrc/LBM/NICTEST.LBM differ diff --git a/KaosSrc/LFONTS.LBM b/KaosSrc/LFONTS.LBM new file mode 100644 index 0000000..093e280 Binary files /dev/null and b/KaosSrc/LFONTS.LBM differ diff --git a/KaosSrc/LITTLE.LFN b/KaosSrc/LITTLE.LFN new file mode 100644 index 0000000..5c29ac8 Binary files /dev/null and b/KaosSrc/LITTLE.LFN differ diff --git a/KaosSrc/MAKEBDF.DSK b/KaosSrc/MAKEBDF.DSK new file mode 100644 index 0000000..276570b Binary files /dev/null and b/KaosSrc/MAKEBDF.DSK differ diff --git a/KaosSrc/MAKEBDF.PRJ b/KaosSrc/MAKEBDF.PRJ new file mode 100644 index 0000000..9142a27 Binary files /dev/null and b/KaosSrc/MAKEBDF.PRJ differ diff --git a/KaosSrc/MAKEFONT.DSK b/KaosSrc/MAKEFONT.DSK new file mode 100644 index 0000000..b775354 Binary files /dev/null and b/KaosSrc/MAKEFONT.DSK differ diff --git a/KaosSrc/MAKEFONT.PRJ b/KaosSrc/MAKEFONT.PRJ new file mode 100644 index 0000000..b785e67 Binary files /dev/null and b/KaosSrc/MAKEFONT.PRJ differ diff --git a/KaosSrc/MESSAGES.SLF b/KaosSrc/MESSAGES.SLF new file mode 100644 index 0000000..51e7769 --- /dev/null +++ b/KaosSrc/MESSAGES.SLF @@ -0,0 +1,36 @@ +Hai preso + la pistola + il fucile + il mitra + il bazooka + una bomba + il Bonus + il soldo grande: hard mode + il soldo piccolo: ? + cure da + 30% + 10% + la chiave + gialla + rossa + anti-Kaos + le munizioni per + la pistola + il fucile + il mitra + il bazooka +Il tempo sta per scadere... +Trova la chiave per l'anti-Kaos +Il Kaos !!! +Ti serve la chiave + gialla + rossa +Sei + immortale + invisibile + morto + resuscitato + stato avvelenato +Armi superpotenti +God mode + diff --git a/KaosSrc/MP.DSK b/KaosSrc/MP.DSK new file mode 100644 index 0000000..1185a16 Binary files /dev/null and b/KaosSrc/MP.DSK differ diff --git a/KaosSrc/MP.PRJ b/KaosSrc/MP.PRJ new file mode 100644 index 0000000..102a1ce Binary files /dev/null and b/KaosSrc/MP.PRJ differ diff --git a/KaosSrc/NEWFONT.LBM b/KaosSrc/NEWFONT.LBM new file mode 100644 index 0000000..ed85167 Binary files /dev/null and b/KaosSrc/NEWFONT.LBM differ diff --git a/KaosSrc/ORDERING.SLF b/KaosSrc/ORDERING.SLF new file mode 100644 index 0000000..4cec8c3 --- /dev/null +++ b/KaosSrc/ORDERING.SLF @@ -0,0 +1,48 @@ +Nella versione registrata di KAOS avrai la +possibilit… di giocare in modalit… MultiPlayer +fino a 3 giocatori contemporaneamente SULLO +STESSO COMPUTER e con tutti i mostri. + + + + + + +Saranno inoltre disponibili tutte le armi e +nuovi e pi— terrificanti mostri con strategie +d'attacco e caratteristiche diverse + + + + + + + +Ad ogni episodio saranno aggiunti 3 livelli +progettati appositamente per un'appassionante +sfida "tutti contro tutti"; sar… inoltre +possibile giocare sia in modalit… competitiva +su ogni livello dell'episodio, che in modalit… +cooperativa per completare i livelli standard +aiutandosi a vicenda. +Il gioco completo viene distribuito in 4 +diverse modalit…: + +1) gioco completo + 3 episodi (L. 20.000) +2) gioco + episodi + editor dei + livelli (L. 30.000) +3) gioco + episodi + editor + file + grafici (.LBM) e sonori (.WAV) + + BDF_Maker (L. 50.000) +4) TUTTO: gioco + episodi + editor + + file dati + sorgenti C/C++ (comprese + le routine assembler) + documentazione + completa (L. 100.000) +Per ordinare: +spedire a mezzo vaglia postale la +somma corrispondente all'ordinazione +desiderata al ????? + +per ulteriori informazioni leggere +il file ORDERING.TXT + diff --git a/KaosSrc/Quotes.slf b/KaosSrc/Quotes.slf new file mode 100644 index 0000000..bd7ff9d --- /dev/null +++ b/KaosSrc/Quotes.slf @@ -0,0 +1,279 @@ + + + + + + + + + + + + + + some quotes from The Millennium Group + + + +I giochi sono la cosa pi— difficile da fare: +bisogna stabilire le regole, accettare compromessi, +mettere le mani un po' dappertutto, fare 10 volte +di pi— di quello che si era programmato, ma +soprattutto si deve evitare di giocarci prima che +sia finito. + + + +Nico: + "Ehi! Cavolo, ora c'abbiamo anche le 'quotes' !" + +Max: + "SŤ, ma che significa ?" + +Nico: + "Sul dizionario c'Š scritto 'citazioni' " + +Max: + "Allora Š un giochetto serio !" + + *** + + +Nico: + "Inizio Io..." + + "Programmare questo gioco Š stato un vero piacere, + ho potuto esprimere tutto me stesso. Mi sentivo + quasi un D..." + +Max: + "Ma che c#@*o dici !" + +Andy: + "Oh! Ci sono anch'io. Di che si parlava ?" + +Max: + "Niente, le solite str#@’*te !" + + *** + + +Nico: + "A dire la verit… non Š che questo gioco mi + piaccia molto." + +Andy: + "Quale gioco ?" + +Max: + "Ma come no, t'ho fatto pure il sangue che ti + piaceva tanto !" + +Nico: + "Beh, effettivamente Š un gioco pulp." + +Max: + "Molto purp !" + +Andy + "Pure troppo" + +Remo: + "Pipp !" + +Max: + "Peeppa, fatt 'a babba !" + + *** + + +Max: + "Allora, hai fatto la classifica ?" + +Nico: + "Veramente no, Š una parte inutile e pallosa !" + +Max: + "E che vuoi fare, senza punti ?!" + +Nico: + "Perch‚ a te forse te ne frega qualcosa di + aver fatto il punteggio pi— alto ?" + +Max: + "No, per• dovremmo mettere delle statistiche..." + +Nico: + "Ok, allora togliamo i punti e mettiamo una cosa + pi— utile" + +Max: + "Ho un'idea: mettiamo le percentuali di cattiveria, + mira, sangue, ecc." + +Nico: + + "Forse erano meglio i punti..." + + *** + + +Nico: + "Ho visto che Duke tira pure le bombe" + +Max: + "SŤ lo so, ma a noi sarebbe impossibile" + +Nico: + "Beh, niente Š impossibile" + +Max: + "Vuoi dire che possiamo mettere le bombe che + rimbalzano..." + +Nico: + "SŤ, ma aspet..." + +Max: + "...posso dire ad Andrea di disegnare la mano..." + +Nico: + "Ma ?!" + +Max: + "...gi… lo vedo; ti ridisegno tutta la barra di stato + con tutte e sei le armi..." + +Nico: + "Ci potrebbero essere dei probl..." + +Max: + "Ti faccio pure il suono della bomba che rimbalza... + naturalmente mentre vola deve anche ruotare..." + +Andy: + "Allora Š deciso: la mano in 3 posizioni" + +Nico: + + "La prossima volta sto zitto." + + *** + + +Nico: + "Dobbiamo assolutamente mettere i doppi muri !" + +Max: + "Nooo, cosŤ devo disegnare altre texture !" + +Nico: + "Ma no, sono poche; ho qui una piccola lista" + +Max: + "Non voglio guardare" + +Andy: + "Ha ragione, c'Š una sola scritta" + +Max: + "Grande !" + +Andy: + "C'Š scritto: 'Rifai tutto' " + + *** + + +Max: + "Hai messo le nuove texture ?" + +Nico: + "SŤ, ma c'Š una novit…" + +Max: + "Noo, ancora !? + Ma quando lo spediamo questo gioco !?" + +Nico: + "E' LUI, il mitico, l'unico + l'inimitabile... + + L'effetto luce" + + + +Max: + "Dove ? Ah, Š quel cerchietto lŤ ?" + +Nico: + + + *** + + +Nico: + "Beh, il gioco Š quasi finito, ma + come spieghiamo tutto questo + intruglio di roba ?" + +Max: + "Non ti preoccupare, ho gi… in + mente la storia..." + +Nico: + "Solo lui pu• trovare un legame + tra un castello medievale e + un lanciarazzi." + + *** + + +Nico: + "Mitico! Mi sono rivisto TRON !" + + "Quello sŤ che Š un vero film + di veri mondi reali e virtuali, + di Programmatori e Programmi, + di Pensiero e Tecnologia e + eh sŤ, anche di Fantasia + una cosa che nemmeno oggi si + riesce a comprare." + + *** + + +Beh, allora queste citazioni ? + + +Nico: "Questo Š un replicante !" + (cercando di correggere un errore + del gestore di memoria) + + +Maxy: "C'Š da cambiare qualcosa" + (prima del ricovero di Nico) + + +Nico: "100% errors free !!!" + (...ma dopo 5 secondi il sistema + and• in crash) + + +Maxy: "Fatto questo, spediamo il gioco" + (questo cosa ? Mmah) + + + + + + + + + + + + + + + diff --git a/KaosSrc/SETFIRM.DSK b/KaosSrc/SETFIRM.DSK new file mode 100644 index 0000000..8097ac9 Binary files /dev/null and b/KaosSrc/SETFIRM.DSK differ diff --git a/KaosSrc/SETFIRM.PRJ b/KaosSrc/SETFIRM.PRJ new file mode 100644 index 0000000..e6cb00c Binary files /dev/null and b/KaosSrc/SETFIRM.PRJ differ diff --git a/KaosSrc/STD.LFN b/KaosSrc/STD.LFN new file mode 100644 index 0000000..5a2beae Binary files /dev/null and b/KaosSrc/STD.LFN differ diff --git a/KaosSrc/TESTMID.DSK b/KaosSrc/TESTMID.DSK new file mode 100644 index 0000000..bd3ab4c Binary files /dev/null and b/KaosSrc/TESTMID.DSK differ diff --git a/KaosSrc/TESTMID.PRJ b/KaosSrc/TESTMID.PRJ new file mode 100644 index 0000000..8a13ec1 Binary files /dev/null and b/KaosSrc/TESTMID.PRJ differ diff --git a/KaosSrc/crcio.cpp b/KaosSrc/crcio.cpp new file mode 100644 index 0000000..0e0abcd --- /dev/null +++ b/KaosSrc/crcio.cpp @@ -0,0 +1,152 @@ +/************************************************************************ + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + ************************************************************************/ + +// CRC I/O - (C)1997 Valentini Domenico +// CRCio - I/O with 16 bit CRC checking, multiple channels + +#include "std.hpp" +#include "mm4.hpp" +#include "fastmem.hpp" +#include "io.h" +#include "fcntl.h" +#include "crcio.hpp" + +#define CRC_MAXCHANNELS 4 +#define CRC_BUFLEN 8192 + +#define CRC_validchannel(x) (x>=0 && x(long)CRC_BUFLEN) toread=CRC_BUFLEN; else toread=size; + _read(handle,p,toread); + CRC_add(channel,p,toread); + size-=toread; + } while (size); + delete p; + _read(handle,&toread,sizeof(toread)); + lseek(handle,initpos,SEEK_SET); + return toread==CRC_tot[channel]; +} + +#pragma warn -rvl +int CRC_newchannel() { + for (int i=0; i=0) { + int channel = CRC_newchannel(); + CRC_handle[channel] = handle; + CRC_status[channel] = CRCS_READING; + if (CRC_check(channel)) + return channel; + CRC_close(channel); + } + } + return -1; +} + +int CRC_openwrite(const char *filename) { + if (CRC_channels=0) { + int channel = CRC_newchannel(); + CRC_handle[channel] = handle; + CRC_reset(channel); + CRC_status[channel] = CRCS_WRITING; + return channel; + } + } + return -1; +} + +int CRC_eof(int handle) { + return eof(handle); +} + +void CRC_read(int channel, void far *ptr, word size) { + //if (CRC_validchannel(channel) && CRC_status[channel]==CRCS_READING) { + if (size) _read(CRC_handle[channel],ptr,size); + //} else error("Not reading"); +} + +void CRC_write(int channel, void far *ptr, word size) { + //if (CRC_validchannel(channel) && CRC_status[channel]==CRCS_WRITING) { + if (size) { + _write(CRC_handle[channel],ptr,size); + CRC_add(channel,ptr,size); + } + //} else error("Not writing"); +} + +void CRC_lseek(int channel, long displ, int from) { + //if (CRC_validchannel(channel) && CRC_status[channel]==CRCS_READING) { + lseek(CRC_handle[channel],displ,from); + //else error("CRC_lseek - error"); +} + +void CRC_close(int channel) { + if (!CRC_validchannel(channel) || + CRC_status[channel]==CRCS_IDLE) return; + if (CRC_status[channel]==CRCS_WRITING) + _write(CRC_handle[channel],&(CRC_tot[channel]),sizeof(CRC_tot[channel])); + _close(CRC_handle[channel]); + CRC_status[channel] = CRCS_IDLE; + CRC_channels--; +} \ No newline at end of file diff --git a/KaosSrc/crcio.hpp b/KaosSrc/crcio.hpp new file mode 100644 index 0000000..a138a6a --- /dev/null +++ b/KaosSrc/crcio.hpp @@ -0,0 +1,14 @@ +/************************************************************************ + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + ************************************************************************/ + +extern int CRC_openread(const char *filename); +extern int CRC_openwrite(const char *filename); +extern int CRC_eof(int channel); +extern void CRC_read(int channel, void far *ptr, word size); +extern void CRC_write(int channel, void far *ptr, word size); +extern void CRC_lseek(int channel, long displ, int from); +extern void CRC_close(int channel); \ No newline at end of file diff --git a/KaosSrc/doors.cpp b/KaosSrc/doors.cpp new file mode 100644 index 0000000..0856fe3 --- /dev/null +++ b/KaosSrc/doors.cpp @@ -0,0 +1,207 @@ +/************************************************************************ + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + ************************************************************************/ + +// DOORS - (C)1997 Nicosoźt (Valentini Domenico) + +#include "std.hpp" +#include "fastmem.hpp" +#include "events.hpp" +#include "doors.hpp" + +#include "mm4.hpp" // per Kaos.hpp +#include "crcio.hpp" // per save() +#include "kaos.hpp" + +#include "fixed.h" +#include "3dengine.hpp" + +#include "3dsound.hpp" + +#include "messages.hpp" + +#define MAXDOORS 96 +#define MAXFLDOORS 24 // <256 +#define MAXDOORWAIT 80 + +// Door States +#define DST_OPENING 0 +#define DST_WAITING 1 +#define DST_CLOSING 2 + +#define DOORFLAGS OMF_STANDARD + +DoorManager::DoorManager() { + doorlist = new byte[MAXDOORS]; + doortype = new byte[MAXDOORS]; + fldoorlist = new TDoor[MAXFLDOORS]; + doornum = 0; + fldoornum = 0; + //fdfill(doorlist,0l,MAXDOORS); // chiude porte +} + +void DoorManager::load(int handle) { + CRC_read(handle,&doornum,sizeof(doornum)); + CRC_read(handle,doorlist,MAXDOORS); + CRC_read(handle,doortype,MAXDOORS); + CRC_read(handle,&fldoornum,sizeof(fldoornum)); + CRC_read(handle,fldoorlist,fldoornum*sizeof(TDoor)); +} + +void DoorManager::save(int handle) { + CRC_write(handle,&doornum,sizeof(doornum)); + CRC_write(handle,doorlist,MAXDOORS); + CRC_write(handle,doortype,MAXDOORS); + CRC_write(handle,&fldoornum,sizeof(fldoornum)); + CRC_write(handle,fldoorlist,fldoornum*sizeof(TDoor)); +} + +int DoorManager::add(byte image) { + if (doornum < MAXDOORS) { + doortype[doornum] = image; + doorlist[doornum] = 0; + return doornum++; + } else error("DoorList::add","too many doors"); +} + +void DoorManager::makeslots() { + TMapInfo *mapptr = Map+65; + byte m; + for (int i=0; i<3966 /*4096-65-65*/; i++, mapptr++) { + if ((m = mapptr->type) == MTP_DOOR1 || + m == MTP_DOOR2) { + mapptr-=64; if (mapptr->stop && mapptr->type == MTP_WALL) mapptr->type = MTP_SLOT; + mapptr+=63; if (mapptr->stop && mapptr->type == MTP_WALL) mapptr->type = MTP_SLOT; + mapptr+= 2; if (mapptr->stop && mapptr->type == MTP_WALL) mapptr->type = MTP_SLOT; + mapptr+=63; if (mapptr->stop && mapptr->type == MTP_WALL) mapptr->type = MTP_SLOT; + mapptr-=64; + } + } +} + +char DoorManager::open(int idx, byte key) { + int i, index; + byte t; + + t = Map[idx].type; + if (t == MTP_DOOR1 || t == MTP_DOOR2) { + i = doorlist[index = Map[idx].data]; + if (i || fldoornum= 64) { + door.opennum = 64; + door.status = DST_WAITING; + door.animcount = 0; + objmap[door.idx] -= DOORFLAGS; + play3Dsound(lshl16((door.idx & 0x7fc0)+32), + lshl16(((door.idx & 63)<<6)+32),SND_CLOSE, + 0,SYSOWN,SFL_NORMAL); + } + } else + if (door.status == DST_CLOSING) { + if ((door.opennum -= 4) <= 0) { + play3Dsound(lshl16((door.idx & 0x7fc0)+32), + lshl16(((door.idx & 63)<<6)+32),SND_CLOSE, + 0,SYSOWN,SFL_NORMAL); + doorlist[Map[door.idx].data] = 0; + if (i != --fldoornum) { + door = fldoorlist[fldoornum]; + // avoid conflicts + doorlist[Map[door.idx].data] = i+1; + } + i--; + } + } else + if (door.status == DST_WAITING) { + if (door.animcount >= MAXDOORWAIT) { + // door.animcount = MAXDOORWAIT; + //if (!(ObjMap[door.idx].unwalkable)) { + if (IDMap[door.idx]<0) { + door.status = DST_CLOSING; + objmap[door.idx] += DOORFLAGS; + play3Dsound(lshl16((door.idx & 0x7fc0)+32), + lshl16(((door.idx & 63)<<6)+32),SND_PORTA2, + 0,SYSOWN,SFL_NORMAL); + } + } else ++door.animcount; + } + } +} + +int DoorManager::doorpos(int indx) { + register int i; + if ((i = doorlist[indx]) != 0) return fldoorlist[i-1].opennum; + return 0; +} + +void DoorManager::eraseall() { + doornum=0; fldoornum=0; +} + +void DoorManager::handle_event(TEvent &event) { + switch (event.what) { + case EV_ACTIVATE: + open(event.data.msg.x,event.data.msg.y); + break; + case EV_PLACTIVATE: + int msg = -1; + switch (open(event.data.msg.x,event.data.msg.y)) { + case -3: msg = MSG_NEEDKEY_RED; break; + case -2: msg = MSG_NEEDKEY_YELLOW; break; + } + if (msg>=0) eventmanager.sendcom(EV_MESSAGE,msg); + break; + /* + case EV_HIT: + byte idx; + if ((idx = Map[event.x]) & FL_DOOR) { + idx &= ~FL_DOOR; + if (event.y>=20 && + doortype[idx] != C_PORTAG && + doortype[idx] != C_PORTAR) { + Map[event.x] = 0; + ObjMap[event.x] &= ~FL_UNWALKABLE; + } + } + break; + */ + } +} \ No newline at end of file diff --git a/KaosSrc/doors.hpp b/KaosSrc/doors.hpp new file mode 100644 index 0000000..329f1db --- /dev/null +++ b/KaosSrc/doors.hpp @@ -0,0 +1,44 @@ +/************************************************************************ + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + ************************************************************************/ + +#ifndef __DOORS__ +#define __DOORS__ + +// per ora il fattore di bloccaggio Š dato dal type... + +typedef struct { + int idx, opennum, animcount, status; + } TDoor; + +class DoorManager +{ + TDoor *fldoorlist; + int doornum, fldoornum; + public: + byte *doorlist; + // byte *doorinfo; //in seguito conterr… LOCKTYPEs ... + byte *doortype; + DoorManager(); + ~DoorManager() { + delete fldoorlist; + delete doortype; + delete doorlist; + } + void load(int handle); + void save(int handle); + int add(byte image); + void makeslots(); + char open(int idx, byte key); + void animate(); + int doorpos(int indx); + void eraseall(); + void handle_event(TEvent &event); +}; + +extern DoorManager doormanager; + +#endif // __DOORS__ \ No newline at end of file diff --git a/KaosSrc/editor.cpp b/KaosSrc/editor.cpp new file mode 100644 index 0000000..475665f --- /dev/null +++ b/KaosSrc/editor.cpp @@ -0,0 +1,996 @@ +/************************************************************************ + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + ************************************************************************/ + +// The KAOS Editor v3.2 - (C)1997 NicoSoźt (Valentini Domenico) + +#include "std.hpp" +#include "fastmem.hpp" +#include "vgatool3.hpp" +#include "lgraph.hpp" +#include "lmouse.hpp" +#include "xms.hpp" +#include "mm4.hpp" +#include "lfont2.hpp" +#include "kaosc.hpp" +#include +#include +#include +#include +#include +#include +#include +#include "crcio.hpp" + +#define MAXHOTRECTS 32 + +#define NUM_TEXTURES TEXTNUM +#define NUM_OBJECTS (T_OBJECTS-T_TEXTURES) +#define NUM_ENEMIES (T_ENEMIES-T_OBJECTS) +#define MAXTEXTURES (NUM_TEXTURES+NUM_OBJECTS+NUM_ENEMIES+12) + +#define LVL_FLOOR 0 +#define LVL_WALL 1 +#define LVL_CEILING 2 + +#define MLV_TEXTURES1 0 +#define MLV_TEXTURES2 1 +#define MLV_OBJECTS 2 +#define MLV_ACTORS 3 +#define MLV_TABLES 4 + +#define COM_LOAD 1 +#define COM_SAVE 2 +#define COM_LEVELC 3 +#define COM_LEVELW 4 +#define COM_LEVELF 5 +#define COM_NOOBJ 6 +#define COM_NOUNDER 7 + +typedef struct { + int x,y,dx,dy; + char *decr; + } TArea; +typedef struct { + int x,y,dx,dy; + char *descr; + } THotRect; +typedef struct { + char active; + char name[24]; + byte backnum; + int wallidx,flooridx,ceilidx; + } TLevel; +typedef struct { + char x, y; + } TPlayerpos; + +char *strKaosfirm = "The KAOS Editor v0.5beta", + *strLoad = "Load .DLF file [L]", + *strSave = "Save .DLF file [S]", + *strclickput = "Left:put, Right:delete, Cursor:scroll", + *strmenu01 = "Left:get, Right:change list (Textures 1)", + *strmenu02 = "Left:get, Right:change list (Textures 2)", + *strmenu1 = "Left:get, Right:change list (Objects)", + *strmenu2 = "Left:get, Right:change list (Actors)", + *strmenu3 = "Left:sel/activ, Right:change, under:background", + *strshape0 = "Shape: square", + *strshape1 = "Shape: vertical", + *strshape2 = "Shape: horizontal", + *strshape3 = "Shape: diagonal (1)", + *strshape4 = "Shape: diagonal (2)", + *strshape5 = "Shape: h/v inverted (doors)", + *strtype0 = "Type: wall", + *strtype1 = "Type: door (slide right)", + *strtype2 = "Type: door (middle)", + *strtype3 = "Type: grid (4-8)", + *strceiling = "Edit Level: Ceiling [1]", + *strfloor = "Edit Level: Floor [2]", + *strwalls = "Edit Level: Walls [3]", + *strtable = "Select Tables", + *strmap = "Global map", + *strgetmap = "Get from map", + *strgetsee = "Left:get, Right:see, Cursor:scroll", + *strnoobj = "No objects drawing [O]", + *strnounder = "No under-wall textures in floor/ceiling map [U]", + *strfill = "Fills the entire plane with current texture"; +char strlname[40]; + +const char idDLF[9] = "NICdlf\x7\x1a"; +char filename[9] = "KAOS"; +char *vpage = new char[64000]; +PPal pal = new char[768]; +Font *litfont = new Font("little"); +MouseCursor crsr_std, crsr_get; +char *undermem = new char[32*32]; // !!!!! +THotRect *HotArray = new THotRect[MAXHOTRECTS]; +int numrects = 0; +int oldrect = -1; +TLevel Level[16]; +char **TextAr = new char *[MAXTEXTURES]; +byte *floormap, *ceilmap; +TMapInfo *map, curstore, nullinf = {0,0,0,0,0}; +int curlvl = -1, + levelnum = -1, + menulvl = -1, + curshape = 0, + curtype = 0; +char getmode = 0, + nounder = 0, + noobj = 0; + +int command; // enhanced commands broadcasting + +TPlayerpos playerpos[16][3]; +int viewleft = 0, viewtop = 0; +char **MaskAr = new char *[6]; +char *nullText = new char[64], + *door1Text = new char[64], + *door2Text = new char[64], + *gridText = new char[64], + *selText = new char[64], + *udoffText = new char[64], + *udonText = new char[64], + *rainoffText = new char[64], + *rainonText = new char[64], + *menuText; +char **TableNum = new char *[17]; +int p_noobj, p_nounder; + +void far *ddf = NULL; +unsigned ddfnum = 0; + +void alloc_ddf(int num) { + if (ddf) delete ddf; + if (ddfnum = num) ddf = mm_reserve(num<<2); // non == !!! + else ddf = NULL; +} + +int addrect(int _x,int _y,int _dx,int _dy, char *_descr) { + if (numrects0 && n0 && n=rect.x && x=rect.y && ywrite(4,192,127,117,s); + vtransf(4,191,208,8); + for (int i=0;i<40;i++) waitvsync(); + oldrect=-1; +} + +void paint(int x, int y, char transf) { + if (x=viewleft+30 || + y=viewtop+19) return; + int vx = 4+((x-viewleft)<<3), + vy = 36+((y-viewtop)<<3), + idx = (x<<6)+y; + byte mask; + char wall=0; + // draws map + if (map[idx].stop) { + if ((mask=map[idx].shape)!=0) { + storelfig(vx,vy,8,8,nullText); + storelmfig(vx,vy,8,8,MaskAr[mask],TextAr[map[idx].data]); + } else + storelfig(vx,vy,8,8,TextAr[map[idx].data]); + switch(map[idx].type) { + case MTP_DOOR1: + putlfig(vx,vy,8,8,door1Text); + break; + case MTP_DOOR2: + putlfig(vx,vy,8,8,door2Text); + break; + case MTP_GRID1: + putlfig(vx,vy,8,8,gridText); + break; + } + wall++; + } else { + storelfig(vx,vy,8,8,nullText); + if (map[idx].none) { + if (!noobj) putlfig(vx,vy,8,8,TextAr[map[idx].data]); + } + } + if (curlvl==LVL_FLOOR) { + if (!(nounder && wall)) + storelmfig(vx,vy,8,8,MaskAr[0],TextAr[floormap[idx]]); + } else + if (curlvl==LVL_CEILING) { + if (!(nounder && wall)) + storelmfig(vx,vy,8,8,MaskAr[0],TextAr[ceilmap[idx]]); + } + if (transf) vtransf(vx,vy,8,8); +} + +void paintrect(int x, int y, int dx, int dy) { + int i,j; + if (xviewleft+30) dx=viewleft+30-x; + if (yviewtop+19) dy=viewtop+19-y; + for (i=x;i64) newl=64-30; + if (newt<0) newt=0; else + if (newt+19>64) newt=64-19; + + mouse.update(4,36,30<<3,19<<3); + if (newl!=viewleft) { + if (newl>viewleft) { + dx = newl-viewleft; + viewleft = newl; + fcopyblock(4+(dx<<3),36,4,36,(30-dx)<<3,19<<3,VMEMPTR); + setvbuff(VMEMPTR); + ftransfblock(4,36,(30-dx)<<3,19<<3,vpage); + setvbuff(vpage); + paintrect(newl+30-dx,newt,dx,19); + } else { + dx = viewleft-newl; + viewleft = newl; + fcopyblock(4,36,4+(dx<<3),36,(30-dx)<<3,19<<3,VMEMPTR); + setvbuff(VMEMPTR); + ftransfblock(4+(dx<<3),36,(30-dx)<<3,19<<3,vpage); + setvbuff(vpage); + paintrect(newl,newt,dx,19); + } + } + if (newt!=viewtop) { + if (newt>viewtop) { + dy = newt-viewtop; + viewtop = newt; + fcopyblock(4,36+(dy<<3),4,36,30<<3,(19-dy)<<3,VMEMPTR); + setvbuff(VMEMPTR); + ftransfblock(4,36,30<<3,(19-dy)<<3,vpage); + setvbuff(vpage); + paintrect(newl,newt+19-dy,30,dy); + } else { + dy = viewtop-newt; + viewtop = newt; + fcopyblock(4,36,4,36+(dy<<3),30<<3,(19-dy)<<3,VMEMPTR); + setvbuff(VMEMPTR); + ftransfblock(4,36+(dy<<3),30<<3,(19-dy)<<3,vpage); + setvbuff(vpage); + paintrect(newl,newt,30,dy); + } + } + mouse.show(); +} + +void store(int x,int y) { + int idx = (x<<6)+y; + if (curstore.data>2; + if (playerpos[levelnum][i].x>=0) { + map[(playerpos[levelnum][i].x<<6)+playerpos[levelnum][i].y] = nullinf; + paint(playerpos[levelnum][i].x,playerpos[levelnum][i].y,1); + } + playerpos[levelnum][i].x = x; playerpos[levelnum][i].y = y; + map[idx] = curstore; + } else return; + paint(x,y,1); +} + +void changelevel(int num) { + if (num != levelnum && num>=0 && num<16) { + if (levelnum != -1) { + mm_unlock(Level[levelnum].wallidx); + mm_unlock(Level[levelnum].flooridx); + mm_unlock(Level[levelnum].ceilidx); + } + levelnum = num; + mm_reset(); + map = (TMapInfo *)mm_recall(Level[levelnum].wallidx); + mm_lock(Level[levelnum].wallidx); + floormap = (byte *)mm_recall(Level[levelnum].flooridx); + mm_lock(Level[levelnum].flooridx); + ceilmap = (byte *)mm_recall(Level[levelnum].ceilidx); + mm_lock(Level[levelnum].ceilidx); + paintrect(viewleft,viewtop,30,19); + storelfig(168,8,8,8,TableNum[levelnum]); + vtransf(168,8,8,8); + strcpy(strlname,"Change name ("); + strcat(strlname,Level[levelnum].name); + strcat(strlname,")"); + } +} + +void changelvl(int lvlnum) { + if (curlvl != lvlnum) { + curlvl=lvlnum; + ffillblock(228,191,88,8,0x72727272l); + switch(lvlnum) { + case LVL_WALL: + litfont->write(228,192,127,117,"Level: Walls"); + break; + case LVL_FLOOR: + litfont->write(228,192,127,117,"Level: Floor"); + break; + case LVL_CEILING: + litfont->write(228,192,127,117,"Level: Ceiling"); + break; + default: error("changelvl","level unknown"); + } + vtransf(228,191,88,8); + paintrect(viewleft,viewtop,30,19); + } +} + +void changemenu(int lvlnum) { + int i; + if (lvlnum != menulvl) { + putlfig(250,36,68,84,menuText); + switch (menulvl = lvlnum) { + case MLV_TEXTURES1: + //for(i=0;i=42 && sel<45) { + Level[levelnum].backnum = (Level[levelnum].backnum & 0xf0) | (sel-42); + } else + if (sel==46) { + Level[levelnum].backnum ^= 0x80; + } else + if (sel==47) { + Level[levelnum].backnum ^= 0x40; + } + break; + } + /* + sel = menulvl; + menulvl = -1; + changemenu(sel); + */ + updatesel(); +} + +char *input(const char *str, char *first, char maxchar, char filter) { + char app[80]; + char nome[33] = ""; + byte c, len; + int anim = 0; + + if (maxchar<1 || maxchar>32) maxchar=32; + len = strlen(strcpy(nome,first)); + + mouse.hide(); + while (1) { + if (++anim>40) anim=0; + ffillblock(4,191,208,8,0x72727272l); + strcpy(app,str); + strcat(app,nome); + if (anim>20) strcat(app,"_"); + litfont->write(4,192,127,117,app); + waitvsync(); + ftransfblock(4,191,208,8,VMEMPTR); + if (kbhit()) + switch (c = getch()) { + case 27: + mouse.show(); + return NULL; + case 13: + mouse.show(); + return strcpy(first,nome); + case 8: if (len) nome[--len]=0; break; + default: + if (filter) { + c = toupper(c); + if (c>='0' && c<='Z') { + if (len=' ' && c<=(byte)'—') { + if (len=NUM_TEXTURES+NUM_OBJECTS+NUM_ENEMIES) { + i = ((int)(*mptr).data-(NUM_TEXTURES+NUM_OBJECTS+NUM_ENEMIES))>>2; + playerpos[levelnum][i].x = x; + playerpos[levelnum][i].y = y; + } +} + +void LoadFile() { + int handle, + i = 0,j; + char id[8] = "........"; + char app[13]; + byte num; + + strcpy(app,filename); + strcat(app,".DLF"); + + if ((handle = CRC_openread(app)) >= 0) { + CRC_read(handle,id,8); + if (!fwcomp(id,(void *)&idDLF,8)) { + CRC_close(handle); + return; + } + for (i=0;i<16;i++) Level[i].active=0; + CRC_read(handle,&num,sizeof(num)); + for (j=0;j= 0) { + CRC_write(handle,(void far *)idDLF,8); + byte num = 0; + for (i=0;i<16;i++) if (Level[i].active) num++; + CRC_write(handle,&num,sizeof(num)); + for (i=0;i<16;i++) + if (Level[i].active) { + CRC_write(handle,&i,1); + changelevel(i); + CRC_write(handle,&Level[levelnum].name,24); + CRC_write(handle,&Level[levelnum].backnum,1); + //CRC_write(handle,&playerpos[i],6); + CRC_write(handle,map,8192); + CRC_write(handle,floormap,4096); + CRC_write(handle,ceilmap,4096); + } + CRC_write(handle,&ddfnum,sizeof(ddfnum)); + if (ddfnum) CRC_write(handle,ddf,ddfnum<<2); + CRC_close(handle); + changelevel(oldlev); + statuswrite("Ok."); + } else statuswrite("Failed!"); +} + +void main() { + char ch; + int i,mx,omx,my,omy; + byte mb,omb; + char moved, pushed; + int x,y; + + initL(); + fadeout(pal,0,256,1); + setvbuff(vpage); + loadLBM("lbm\\editor.lbm",pal); + ftransfscreen(VMEMPTR); + fwfill(pal,0,3); + fadein(pal,0,256,30); + if (!mouse.install()) error("main","mouse driver needed"); + litfont->setdispl(1,0); + + addrect(0,0,80,32,strKaosfirm); // 0 + addrect(80,0,32,16,strLoad); // 1 + addrect(80,16,32,16,strSave); // 2 + addrect(250,36,68,84,strmenu01); // 3 + addrect(4,36,240,152,strclickput); // 4 + addrect(224,0,16,16,strshape0); // 5 + addrect(240,0,16,16,strshape1); // 6 + addrect(256,0,16,16,strshape2); // 7 + addrect(272,0,16,16,strshape3); // 8 + addrect(288,0,16,16,strshape4); // 9 + addrect(304,0,16,16,strshape5); // 10 + addrect(224,16,16,16,strtype0); // 11 + addrect(240,16,16,16,strtype1); // 12 + addrect(256,16,16,16,strtype2); // 13 + addrect(272,16,16,16,strtype3); // 14 + addrect(180,0,32,10,strceiling); // 15 + addrect(180,10,32,12,strwalls); // 16 + addrect(180,22,32,10,strfloor); // 17 + addrect(160,0,20,18,strtable); // 18 + addrect(160,18,20,14,strmap); // 19 + addrect(168,8,8,8,strlname); // 20 + addrect(136,16,24,16,strgetmap); // 21 + addrect(136,0,24,16,strnoobj); // 22 + addrect(112,0,24,16,strnounder); // 23 + addrect(112,16,24,16,strfill); // 24 + + getlfig(4,36,8,8,nullText); + menuText = new char[68*84]; + getlfig(250,36,68,84,menuText); + + loadLBM("lbm\\nictest.lbm",NULL); + + crsr_std.hotx = 0; crsr_std.hoty = 0; + crsr_std.dx = 16; crsr_std.dy = 16; + crsr_std.data = new char[16*16]; + getlfig(0,88,16,16,crsr_std.data); + mouse.setcursormem(&crsr_std,undermem); + crsr_get.hotx = 0; crsr_get.hoty = 11; + crsr_get.dx = 16; crsr_get.dy = 16; + crsr_get.data = new char[16*16]; + getlfig(16,88,16,16,crsr_get.data); + + fwfill(playerpos,0xffff,sizeof(playerpos)); + + for(i=0;iwrite(4,192,127,117,HotArray[i].descr); + vtransf(4,191,208,8); + } + if (pushed) { + i=1; + switch(oldrect) { + case 4: i=0; break; + case 3: // Menu + if (mb==MB_LEFT) { + x = (mx-250)/10; + y = (my-36)/10; + menuselect(x,y); + } else + if (mb==MB_RIGHT) + if (menulvl>3)+viewleft; + y = ((my-36)>>3)+viewtop; + if (getmode) { + i = (x<<6)+y; + switch (curlvl) { + case LVL_WALL: curstore = map[i]; break; + case LVL_FLOOR: curstore.data = floormap[i]; break; + case LVL_CEILING: curstore.data = ceilmap[i]; break; + } + updatesel(); + i = (mb==MB_LEFT); + } else { + if (mb==MB_LEFT) store(x,y); else + if (mb==MB_RIGHT) { + TMapInfo app = curstore; + curstore = nullinf; + store(x,y); + curstore = app; + } + } + } + if (getmode && i) { + mouse.setcursormem(&crsr_std,undermem); + changestr(4,strclickput); + getmode=0; + oldrect=-1; + } + } + if (kbhit()) { + ch=toupper(getch()); + switch(ch) { + case 0: + ch=getch(); + switch(ch) { + case 72: scroll(0,-2); break; + case 80: scroll(0,2); break; + case 75: scroll(-4,0); break; + case 77: scroll(4,0); break; + } + break; + case '1': command = COM_LEVELF; break; + case '2': command = COM_LEVELW; break; + case '3': command = COM_LEVELC; break; + case 'L': command = COM_LOAD; break; + case 'S': command = COM_SAVE; break; + case 'O': command = COM_NOOBJ; break; + case 'U': command = COM_NOUNDER; break; + } + } + switch (command) { + case 0: break; // NONE + case COM_LOAD: + if (input("Load file: ",filename,8,1)) + LoadFile(); + else statuswrite("Abort load."); + break; + case COM_SAVE: + if (input("Save file: ",filename,8,1)) + SaveFile(); + else statuswrite("Abort save."); + break; + case COM_LEVELC: + case COM_LEVELW: + case COM_LEVELF: changelvl(2+COM_LEVELC-command); break; + case COM_NOOBJ: + noobj = !noobj; + if (noobj) { + setvbuff(VMEMPTR); + mouse.hide(); + putlfig(136,0,24,16,mm_recall(p_noobj)); + mouse.show(); + setvbuff(vpage); + } else vtransf(136,0,24,16); + paintrect(viewleft,viewtop,30,19); + break; + case COM_NOUNDER: + nounder = !nounder; + if (nounder) { + setvbuff(VMEMPTR); + mouse.hide(); + putlfig(112,0,24,16,mm_recall(p_nounder)); + mouse.show(); + setvbuff(vpage); + } else vtransf(112,0,24,16); + if (curlvl!=LVL_WALL) paintrect(viewleft,viewtop,30,19); + break; + } + } while (ch!=27); + mm_done(); + fadeout(pal,0,256,30); + doneL(); +} \ No newline at end of file diff --git a/KaosSrc/errorstr.cpp b/KaosSrc/errorstr.cpp new file mode 100644 index 0000000..334cf1e --- /dev/null +++ b/KaosSrc/errorstr.cpp @@ -0,0 +1,10 @@ +/************************************************************************ + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + ************************************************************************/ + +const char *err_filenotfound = "file not found"; +const char *err_notenoughmemory = "not enough memory"; +const char *err_invalidformat = "invalid format"; \ No newline at end of file diff --git a/KaosSrc/errorstr.hpp b/KaosSrc/errorstr.hpp new file mode 100644 index 0000000..1ebcd60 --- /dev/null +++ b/KaosSrc/errorstr.hpp @@ -0,0 +1,10 @@ +/************************************************************************ + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + ************************************************************************/ + +extern const char *err_filenotfound; +extern const char *err_notenoughmemory; +extern const char *err_invalidformat; \ No newline at end of file diff --git a/KaosSrc/events.cpp b/KaosSrc/events.cpp new file mode 100644 index 0000000..193ce29 --- /dev/null +++ b/KaosSrc/events.cpp @@ -0,0 +1,98 @@ +/************************************************************************ + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + ************************************************************************/ + +// EVENTS - (C)1997 Nicosoźt (Valentini Domenico) + +#include "std.hpp" +#include "events.hpp" +#include "fixed.h" + +//#include "mm2.hpp" +#include "kaos.hpp" +#include "objects.hpp" // solo per senddirect + +char EventManager::get(TEvent &event) { + if (num) { // ready() + event = eventlist[head]; + if (++head >= MAXEVENTS) head = 0; + num--; + return 1; + } + return 0; +}; + +char EventManager::put(TEvent &event) { + if (num < MAXEVENTS) { + register int idx; + if ((idx = head+(num++)) >= MAXEVENTS) idx -= MAXEVENTS; + eventlist[idx] = event; + return 1; + } // error("EventManager::put - overflow"); + return 0; +} + +char EventManager::send(unsigned what, unsigned sorg, + unsigned dest, int x, int y, int z, + int a, int b) { + TEvent evnt; + evnt.what = what; + evnt.source = sorg; + evnt.data.msg.dest = dest; + evnt.data.msg.x = x; + evnt.data.msg.y = y; + evnt.data.msg.z = z; + evnt.data.msg.d1 = a; + evnt.data.msg.d2 = b; + return put(evnt); +} + +char EventManager::sendshort(unsigned what, unsigned sorg, + unsigned dest, int x, int y) { + TEvent evnt; + evnt.what = what; + evnt.source = sorg; + evnt.data.msg.dest = dest; + evnt.data.msg.x = x; + evnt.data.msg.y = y; + return put(evnt); +} + +char EventManager::senddirect(unsigned what, unsigned sorg, + unsigned dest, int x, int y) { + Object *obj = objectslist.get(dest); + if (obj) { + TEvent evnt; + evnt.what = what; + evnt.source = sorg; + evnt.data.msg.dest = dest; + evnt.data.msg.x = x; + evnt.data.msg.y = y; + //evnt.data.msg.z = z; + obj->handle_event(evnt); + return 1; + } else return 0; +} + +char EventManager::sendcom(unsigned what, unsigned sorg) { + TEvent evnt; + evnt.what = what; + evnt.source = sorg; + return put(evnt); +} + +char EventManager::sendpos(unsigned what, unsigned sorg, + long x, long y, long z) { + TEvent evnt; + evnt.what = what; + evnt.source = sorg; + evnt.data.pos.x = x; + evnt.data.pos.y = y; + evnt.data.pos.z = z; + return put(evnt); +} + +EventManager eventmanager; \ No newline at end of file diff --git a/KaosSrc/events.hpp b/KaosSrc/events.hpp new file mode 100644 index 0000000..4b4c9f9 --- /dev/null +++ b/KaosSrc/events.hpp @@ -0,0 +1,97 @@ +/************************************************************************ + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + ************************************************************************/ + +#ifndef __EVENTS__ +#define __EVENTS__ + +#define MAXEVENTS 64 + +// Events: +/* + Bit 7: 0 - system; + 1 - broadcast; + Bit 6: 0 - to all objects; + 1 - only actors; +*/ +// ***** System Events +#define EV_ACKTAKE 0x01 // !!! WARNING !!! +#define EV_ERASEACT 0x02 // !!! NON deve mai essere >= 64 + // altrim. actorslist.erase in .animate ! + // NUOVA MODIFICA ! +#define EV_UPDATEBAR 0x03 // con parametri +#define EV_DEAD 0x04 // ??? Š davvero un system ??? +#define EV_RESURRECT 0x05 // non serve praticamente a niente... +#define EV_ENDPLAYBACK 0x06 // ferma il gioco, subito ! +#define EV_CHGTEXTURE 0x07 +#define EV_ANTIKAOS 0x08 // ferma il Kaos countdown +#define EV_MESSAGE 0x09 // command: = numero del messaggio +// ***** Direct Events +#define EV_HIT 0x21 // !!! WARNING !!! + // Il Barile chiama MakeActor mentre si + // esegue l'actorslist.handleevent !!! +#define EV_GET 0x22 +#define EV_GOT 0x23 +#define EV_ADDSTAT 0x24 // x = type, y = num +#define EV_ENDSOUND 0x25 // solo id +#define EV_POISON 0x26 // ...come EV_HIT +#define EV_ALERT 0x27 // sistema di avvertimento per Soldier + // puntato da missile +// ***** Broadcast Object-Oriented Events +#define EV_KILL 0x81 +#define EV_ACTIVATE 0x82 +#define EV_PLACTIVATE 0x83 +#define EV_SCODE 0x84 +#define EV_BOOM 0x85 +#define EV_PLKILLED 0x86 // player ucciso da (dest) +#define EV_PLNOISE 0x87 // player (sorg) ha fatto rumore +// ***** Broadcast Actor-Oriented Events +#define EV_REQTAKE 0xC1 + +/* +NOTA: +tutti i messaggi spediti da un oggetto arrivano prima della sua morte, +anch'essa gestita da questa coda di eventi. +*/ + +typedef struct { // 16= + unsigned what; // 2+ + int source; // 2+ + union { // 12+ + struct { + int dest, x, y, z, d1, d2; + } msg; + struct { + long x, y, z; + } pos; + } data; + } TEvent; + +class EventManager +{ + TEvent eventlist[MAXEVENTS]; + unsigned char head, num; + public: + EventManager() { flush(); }; + char ready() { return num; }; + char get(TEvent &event); + char put(TEvent &event); + char send(unsigned what, unsigned sorg, + unsigned dest, int x, int y, int z, + int a, int b); + char sendshort(unsigned what, unsigned sorg, + unsigned dest, int x, int y); + char senddirect(unsigned what, unsigned sorg, + unsigned dest, int x, int y); + char sendcom(unsigned what, unsigned sorg); + char sendpos(unsigned what, unsigned sorg, + long x, long y, long z); + void flush() { head = 0; num = 0; }; +}; + +extern EventManager eventmanager; + +#endif // __EVENTS__ \ No newline at end of file diff --git a/KaosSrc/fastmem.cpp b/KaosSrc/fastmem.cpp new file mode 100644 index 0000000..382aa7e --- /dev/null +++ b/KaosSrc/fastmem.cpp @@ -0,0 +1,254 @@ +/************************************************************************ + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + ************************************************************************/ + +// FASTMEM - (C)1997 Nicosoźt (Valentini Domenico) +// very very very fast memory tranfer routines + +#include "std.hpp" + +// Moves forward bytes +void fmove(void far *dest, void far *sorg, word bytes) { +asm { + LDS SI, sorg + LES DI, dest + MOV CX, bytes + CLD + REP MOVSB + // !!! SS==DS !!! + MOV BX, SS + MOV DS, BX +}} + +// Moves forward words +void fwmove(void far *dest, void far *sorg, word bytes) { +asm { + LDS SI, sorg + LES DI, dest + CLD + MOV CX, bytes + SHR CX, 1 + JNC _fmov + MOVSB +} _fmov: asm { + REP MOVSW + // !!! SS==DS !!! + MOV BX, SS + MOV DS, BX +}} + +// Moves forward dwords +void fdmove(void far *dest, void far *sorg, word bytes) { +asm { + LDS SI, sorg + LES DI, dest + CLD + MOV CX, bytes + SHR CX, 1 + JNC _fgo2 + MOVSB +} _fgo2: asm { + SHR CX, 1 + JNC _fmov + MOVSW +} _fmov: asm { + REP + DB 0x66; MOVSW + // !!! SS==DS !!! + MOV BX, SS + MOV DS, BX +}} + +// Fast Omnidirectional word move +void fowmove(void far *dest, void far *sorg, word bytes) { +// if (dest == sorg || !bytes) return; +if (!bytes) return; +if (dest < sorg) { + asm { + LDS SI, sorg + LES DI, dest + CLD + MOV CX, bytes + SHR CX, 1 + JNC _fcpy + MOVSB + } _fcpy: asm { + REP MOVSW + // !!! SS==DS !!! + MOV BX, SS + MOV DS, BX + } +} else { + asm { + LDS SI, sorg + LES DI, dest + STD + MOV CX, bytes + ADD SI, CX + DEC SI + ADD DI, CX + DEC DI + SHR CX, 1 + JNC _bcpy + MOVSB + } _bcpy: asm { + DEC SI + DEC DI + REP MOVSW + CLD + // !!! SS==DS !!! + MOV BX, SS + MOV DS, BX + } +}} + +// Fast Omnidirectional dword move +void fodmove(void far *dest, void far *sorg, word bytes) { +// if (dest == sorg || !bytes) return; +if (!bytes) return; +if (dest < sorg) { + asm { + LDS SI, sorg + LES DI, dest + CLD + MOV CX, bytes + SHR CX, 1 + JNC _fgo2 + MOVSB + } _fgo2: asm { + SHR CX, 1 + JNC _fcpy + MOVSW + } _fcpy: asm { + REP + DB 0x66; MOVSW + // !!! SS==DS !!! + MOV BX, SS + MOV DS, BX + } +} else { + asm { + LDS SI, sorg + LES DI, dest + STD + MOV CX, bytes + ADD SI, CX + DEC SI + ADD DI, CX + DEC DI + SHR CX, 1 + JNC _bgo2 + MOVSB + } _bgo2: asm { + SHR CX, 1 + JNC _bcpy + DEC SI + DEC DI + MOVSW + INC SI + INC DI + } _bcpy: asm { + DEC SI + DEC SI + DEC SI + DEC DI + DEC DI + DEC DI + REP + DB 0x66; MOVSW + CLD + // !!! SS==DS !!! + MOV BX, SS + MOV DS, BX + } +}} + +// fills forward words +void fwfill(void far *dest, word val, word bytes) { +asm { + LES DI, dest + MOV AX, val + CLD + MOV CX, bytes + SHR CX, 1 + JNC _fsto + STOSB +} _fsto: asm { + REP STOSW +}} + +// fills forward dwords +void fdfill(void far *dest, long val, word bytes) { +asm { + LES DI, dest + DB 0x66; MOV AX, WORD PTR val // MOV EAX, val + CLD + MOV CX, bytes + SHR CX, 1 + JNC _fgo2 + STOSB +} _fgo2: asm { + SHR CX, 1 + JNC _fsto + STOSW +} _fsto: asm { + REP + DB 0x66; STOSW // STOSD +}} + +#pragma warn -rvl +char fwcomp(void far *s1, void far *s2, word len) { +asm { + //PUSH DS + LDS SI, s1 + LES DI, s2 + XOR AL, AL + CLD + MOV CX, len + SHR CX, 1 + JNC wor + CMPSB + JNE end +} wor: asm { + REP CMPSW + JNE end + INC AL +} end: asm { + // !!! SS==DS !!! + MOV BX, SS + MOV DS, BX + //POP DS +} /*return _AL;*/ } + +char fdcomp(void far *s1, void far *s2, word len) { +asm { + //PUSH DS + LDS SI, s1 + LES DI, s2 + XOR AL, AL + CLD + MOV CX, len + SHR CX, 1 + JNC wor2 + CMPSB + JNE end +} wor2: asm { + SHR CX, 1 + JNC wor + CMPSW + JNE end +} wor: asm { + REP + DB 0x66; CMPSW + JNE end + INC AL +} end: asm { + // !!! SS==DS !!! + MOV BX, SS + MOV DS, BX + //POP DS +} /*return _AL;*/ } +#pragma warn +rvl \ No newline at end of file diff --git a/KaosSrc/fastmem.hpp b/KaosSrc/fastmem.hpp new file mode 100644 index 0000000..c8c78b0 --- /dev/null +++ b/KaosSrc/fastmem.hpp @@ -0,0 +1,16 @@ +/************************************************************************ + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + ************************************************************************/ + +extern void fmove(void far *dest, void far *sorg, word bytes); +extern void fwmove(void far *dest, void far *sorg, word bytes); +extern void fdmove(void far *dest, void far *sorg, word bytes); +extern void fowmove(void far *dest, void far *sorg, word bytes); +extern void fodmove(void far *dest, void far *sorg, word bytes); +extern void fwfill(void far *dest, word val, word bytes); +extern void fdfill(void far *dest, long val, word bytes); +extern char fwcomp(void far *s1, void far *s2, word len); +extern char fdcomp(void far *s1, void far *s2, word len); \ No newline at end of file diff --git a/KaosSrc/fixed.c b/KaosSrc/fixed.c new file mode 100644 index 0000000..82e8c36 --- /dev/null +++ b/KaosSrc/fixed.c @@ -0,0 +1,281 @@ +/************************************************************************ + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + ************************************************************************/ + +#include "fixed.h" + +// pu• servire ? +// #pragma inline + +#pragma warn -rvl + +long lshr6(long x) { +asm { + MOV AX, WORD PTR x + MOV DX, WORD PTR x[2] + SHR AX, 6 + MOV BL, DL + SHL BL, 2 + OR AH, BL + SAR DX, 6 // SAR... ma il numero serve positivo ! +}} + +long lshl6(long x) { +asm { + MOV AX, WORD PTR x + MOV DX, WORD PTR x[2] + SHL DX, 6 + MOV BL, AH + SHR BL, 2 + OR DL, BL + SHL AX, 6 +}} + +long lshr8(long x) { +asm { + MOV AX, WORD PTR x + MOV DX, WORD PTR x[2] + MOV AL, AH + MOV AH, DL + MOV DL, DH + XOR DH, DH + TEST DL, 0x80 + JZ fine + NOT DH +} fine:; } + +long lshl8(long x) { +asm { + MOV AX, WORD PTR x + MOV DX, WORD PTR x[2] + MOV DH, DL + MOV DL, AH + MOV AH, AL + XOR AL, AL +}} + +int lshr16(fixed x) { +asm MOV AX, WORD PTR x[2] +} + +fixed lshl16(int x) { +asm { + MOV DX, x + XOR AX, AX +}} + +#pragma warn -par +// A Nicosoft's hack ! (It will be only one !) +fixed fixmul(fixed a, fixed b) { +asm { + DB 0x66; DB 0x8B; DB 0x46; DB 0x06 // MOV EAX, [BP+6] + DB 0x66; DB 0xF7; DB 0x6E; DB 0x0A // IMUL [BP+10] + DB 0x66; DB 0x05; DB 0x00; DB 0x80; DB 0x00; DB 0x00 // ADD EAX, 0x8000 + ADC DX, 0 + //DB 0x66; DB 0x83; DB 0xD2; DB 0x00 // ADC EDX, 0 + DB 0x66; DB 0x0F; DB 0xAC; DB 0xD0; DB 0x10 // SHRD EAX, EDX, 16 + DB 0x66; DB 0x8B; DB 0xD0 // MOV EDX, EAX + DB 0x66; DB 0xC1; DB 0xEA; DB 0x10 // SHR EDX, 16 +} } + +// A Nicosoft's hack ! (It will be only one !) +fixed fixdiv(fixed a, fixed b) { +asm { + DB 0x66; DB 0x8B; DB 0x46; DB 0x06 // MOV EAX, a + DB 0x66; DB 0x99 // CDQ + DB 0x66; DB 0xF7; DB 0x7E; DB 0x0A // IDIV b + DB 0x66; DB 0x8B; DB 0xD0 // MOV EDX, EAX + DB 0x66; DB 0xC1; DB 0xEA; DB 0x10 // SHR EDX, 16 +}} + +// A Nicosoft's hack ! (It will be only one !) +fixed fixdiv64(fixed a_l,fixed a_h, fixed b) { +asm { + DB 0x66; DB 0x8B; DB 0x46; DB 0x06 // MOV EAX, a_l + DB 0x66; DB 0x8B; DB 0x56; DB 0x0A // MOV EDX, a_h + DB 0x66; DB 0xF7; DB 0x7E; DB 0x0E // IDIV b + DB 0x66; DB 0x8B; DB 0xD0 // MOV EDX, EAX + DB 0x66; DB 0xC1; DB 0xEA; DB 0x10 // SHR EDX, 16 +}} + +// A Nicosoft's hack ! (It will be only one !) +fixed fixdiv64shl16(fixed a, fixed b) { +asm { + DB 0x66; DB 0x8B; DB 0x46; DB 0x06 // MOV EAX, a + DB 0x66; DB 0x99 // CDQ + DB 0x66; DB 0x0F; DB 0xA4; DB 0xC2; DB 0x10 // SHLD EDX, EAX, 16 + DB 0x66; DB 0xF7; DB 0x7E; DB 0x0A // IDIV b + DB 0x66; DB 0x8B; DB 0xD0 // MOV EDX, EAX + DB 0x66; DB 0xC1; DB 0xEA; DB 0x10 // SHR EDX, 16 +}} + +// A Nicosoft's hack ! (It will be only one ! OOOOOhhh ) +fixed fixmuldiv64(fixed a, fixed b, fixed c) { +asm { + // a*b + DB 0x66; DB 0x8B; DB 0x46; DB 0x06 // MOV EAX, [BP+6] + DB 0x66; DB 0xF7; DB 0x6E; DB 0x0A // IMUL [BP+10] + DB 0x66; DB 0x05; DB 0x00; DB 0x80; DB 0x00; DB 0x00 // ADD EAX, 0x8000 + DB 0x66; DB 0x83; DB 0xD2; DB 0x00 // ADC EDX, 0 + // /c + DB 0x66; DB 0xF7; DB 0x7E; DB 0x0e // IDIV c + DB 0x66; DB 0x8B; DB 0xD0 // MOV EDX, EAX + DB 0x66; DB 0xC1; DB 0xEA; DB 0x10 // SHR EDX, 16 +}} + +fixed fixsqrt(fixed a) { +asm { + DB 0x66; MOV CX, WORD PTR a // MOV ECX, a + DB 0x66; XOR AX, AX // XOR EAX, EAX + DB 0x66; MOV BX, 0x0000; DW 0x4000 // MOV EBX, 0x40000000l +} sq1: asm { + DB 0x66; MOV DX, CX // MOV EDX, ECX + DB 0x66; SUB DX, BX // SUB EDX, EBX + JB sq2 + DB 0x66; SUB DX, AX // SUB EDX, EAX + JB sq2 + DB 0x66; MOV CX, DX // MOV ECX, EDX + DB 0x66; SHR AX, 1 // SHR EAX, 1 + DB 0x66; OR AX, BX // OR EAX, EBX + DB 0x66; SHR BX, 2 // SHR EBX, 2 + JNZ sq1 + JZ sq5 +} sq2: asm { + DB 0x66; SHR AX, 1 // SHR EAX, 1 + DB 0x66; SHR BX, 2 // SHR EBX, 2 + JNZ sq1 +} sq5: asm { + DB 0x66; MOV BX, 0x4000; DW 0x0000 // MOV EBX, 0x00004000l + DB 0x66; SHL AX, 16 // SHL EAX, 16 + DB 0x66; SHL CX, 16 // SHL ECX, 16 +} sq3: asm { + DB 0x66; MOV DX, CX // MOV EDX, ECX + DB 0x66; MOV DX, BX // MOV EDX, EBX + JB sq4 + DB 0x66; SUB DX, AX // SUB EDX, EAX + JB sq4 + DB 0x66; MOV CX, DX // MOV ECX, EDX + DB 0x66; SHR AX, 1 // SHR EAX, 1 + DB 0x66; OR AX, BX // OR EAX, EBX + DB 0x66; SHR BX, 2 // SHR EBX, 2 + JNZ sq3 + //DB 0x66; SHR AX, 1 // SHR EAX, 1 + JMP sq6 +} sq4: asm { + DB 0x66; SHR AX, 1 // SHR EAX, 1 + DB 0x66; SHR BX, 2 // SHR EBX, 2 + JNZ sq3 + //DB 0x66; SHR AX, 1 // SHR EAX, 1 +} sq6: asm { + DB 0x66; MOV DX, AX // MOV EDX, EAX + DB 0x66; SHR DX, 16 // SHR EDX, 16 +}} + +fixed fixdist(fixed dex, fixed dey) { + if (LABS(dex)>255l<<16) dex=255l<<16; + if (LABS(dey)>255l<<16) dey=255l<<16; +asm { + // dex**2 + DB 0x66; MOV AX, WORD PTR dex // MOV EAX, dx + DB 0x66; IMUL AX // IMUL EAX + DB 0x66; DB 0x05; DB 0x00; DB 0x80; DB 0x00; DB 0x00 // ADD EAX, 0x8000 + DB 0x66; DB 0x83; DB 0xD2; DB 0x00 // ADC EDX, 0 + DB 0x66; DB 0x0F; DB 0xAC; DB 0xD0; DB 0x10 // SHRD EAX, EDX, 16 + // dey**2 + DB 0x66; MOV CX, AX // MOV EBX, EAX + DB 0x66; MOV AX, WORD PTR dey // MOV EAX, dy + DB 0x66; IMUL AX // IMUL EAX + DB 0x66; DB 0x05; DB 0x00; DB 0x80; DB 0x00; DB 0x00 // ADD EAX, 0x8000 + DB 0x66; DB 0x83; DB 0xD2; DB 0x00 // ADC EDX, 0 + DB 0x66; DB 0x0F; DB 0xAC; DB 0xD0; DB 0x10 // SHRD EAX, EDX, 16 + // ECX = dex**2 + dey**2 + DB 0x66; ADD CX, AX // ADD ECX, EAX + JNC calc + DB 0x66; MOV CX, 0xffff; DW 0x7fff // MOV ECX, 0x7fffffffl + JMP sq6 +} calc: asm { + DB 0x66; XOR AX, AX // XOR EAX, EAX + DB 0x66; MOV BX, 0x0000; DW 0x4000 // MOV EBX, 0x40000000l +} sq1: asm { + DB 0x66; MOV DX, CX // MOV EDX, ECX + DB 0x66; SUB DX, BX // SUB EDX, EBX + JB sq2 + DB 0x66; SUB DX, AX // SUB EDX, EAX + JB sq2 + DB 0x66; MOV CX, DX // MOV ECX, EDX + DB 0x66; SHR AX, 1 // SHR EAX, 1 + DB 0x66; OR AX, BX // OR EAX, EBX + DB 0x66; SHR BX, 2 // SHR EBX, 2 + JNZ sq1 + JMP sq5 +} sq2: asm { + DB 0x66; SHR AX, 1 // SHR EAX, 1 + DB 0x66; SHR BX, 2 // SHR EBX, 2 + JNZ sq1 +} sq5: asm { + DB 0x66; MOV BX, 0x4000; DW 0x0000 // MOV EBX, 0x00004000l + DB 0x66; SHL AX, 16 // SHL EAX, 16 + DB 0x66; SHL CX, 16 // SHL ECX, 16 +} sq3: asm { + DB 0x66; MOV DX, CX // MOV EDX, ECX + DB 0x66; MOV DX, BX // MOV EDX, EBX + JB sq4 + DB 0x66; SUB DX, AX // SUB EDX, EAX + JB sq4 + DB 0x66; MOV CX, DX // MOV ECX, EDX + DB 0x66; SHR AX, 1 // SHR EAX, 1 + DB 0x66; OR AX, BX // OR EAX, EBX + DB 0x66; SHR BX, 2 // SHR EBX, 2 + JNZ sq3 + //DB 0x66; SHR AX, 1 // SHR EAX, 1 + JMP sq6 +} sq4: asm { + DB 0x66; SHR AX, 1 // SHR EAX, 1 + DB 0x66; SHR BX, 2 // SHR EBX, 2 + JNZ sq3 + //DB 0x66; SHR AX, 1 // SHR EAX, 1 +} sq6: asm { + DB 0x66; MOV DX, AX // MOV EDX, EAX + DB 0x66; SHR DX, 16 // SHR EDX, 16 +}} + +int intdist(int dex, int dey) { + if (ABS(dex)>255l) dex=255l; + if (ABS(dey)>255l) dey=255l; +asm { + MOV AX, dex + DB 0x66; CBW + DB 0x66; IMUL AX + DB 0x66; MOV CX, AX + MOV AX, dey + DB 0x66; CBW + DB 0x66; IMUL AX + DB 0x66; ADD CX, AX + + DB 0x66; XOR AX, AX // XOR EAX, EAX + DB 0x66; MOV BX, 0x0000; DW 0x4000 // MOV EBX, 0x4000000l +} sq1: asm { + DB 0x66; MOV DX, CX + DB 0x66; SUB DX, BX + JL sq2 + DB 0x66; SUB DX, AX + JL sq2 + DB 0x66; MOV CX, DX + DB 0x66; SHR AX, 1 + DB 0x66; OR AX, BX + DB 0x66; SHR BX, 2 + JNZ sq1 + //DB 0x66; SHL AX, 7 + JMP sq3 +} sq2: asm { + DB 0x66; SHR AX, 1 + DB 0x66; SHR BX, 2 + JNZ sq1 + //DB 0x66; SHL AX, 7 +} sq3:; } +#pragma warn +par + +#pragma warn +rvl diff --git a/KaosSrc/fixed.h b/KaosSrc/fixed.h new file mode 100644 index 0000000..0112198 --- /dev/null +++ b/KaosSrc/fixed.h @@ -0,0 +1,31 @@ +/************************************************************************ + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + ************************************************************************/ + +#define FIXSHIFT 16 +#define FIXONE (1l << FIXSHIFT) + +#define SGN(x) ((x)>0?1:-1) +#define ABS(x) ((int)(x)>0?(x):-(x)) +#define LABS(x) ((long)(x)>0?(x):-(x)) + +#define fixed long + +extern long lshr6(long); +extern long lshl6(long); +extern long lshr8(long); +extern long lshl8(long); +extern int lshr16(fixed); +extern fixed lshl16(int); + +extern fixed fixmul(fixed,fixed); +extern fixed fixdiv(fixed,fixed); +extern fixed fixdiv64(fixed a_l,fixed a_h, fixed b); +extern fixed fixdiv64shl16(fixed a, fixed b); +extern fixed fixmuldiv64(fixed a, fixed b, fixed c); +extern fixed fixsqrt(fixed a); +extern fixed fixdist(fixed dx, fixed dy); +extern int intdist(int dex, int dey); \ No newline at end of file diff --git a/KaosSrc/ftest.cpp b/KaosSrc/ftest.cpp new file mode 100644 index 0000000..5496081 --- /dev/null +++ b/KaosSrc/ftest.cpp @@ -0,0 +1,25 @@ +/************************************************************************ + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + ************************************************************************/ + +#include +#include + +void main() { + char *prima = "Prima", + *dopo = "Dopo"; + int handle; + + if ((handle = _creat("test.lsk",FA_ARCH)) >= 0) { + _write(handle,dopo,5); + _write(handle,dopo,4); + lseek(handle,0,SEEK_SET); + _write(handle,prima,5); + lseek(handle,0,SEEK_END); + _write(handle,dopo,4); + _close(handle); + } +} \ No newline at end of file diff --git a/KaosSrc/infobar.cpp b/KaosSrc/infobar.cpp new file mode 100644 index 0000000..a003654 --- /dev/null +++ b/KaosSrc/infobar.cpp @@ -0,0 +1,344 @@ +/************************************************************************ + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + ************************************************************************/ + +#include "std.hpp" +#include "fixed.h" +#include "lgraph.hpp" +#include "mm4.hpp" +#include "events.hpp" +#include "kaos.hpp" +#include "objects.hpp" +#include "player.hpp" +#include "infobar.hpp" +#include "3dengine.hpp" + +#include // random() + +TFig BigBar, LitBar; + +#define C_VERDE 100 +#define C_GIALLO 131 +#define C_GRIGIO 118 + +extern TFig RedKey, YellowKey; +extern TFig ArmFig[6]; + +InfoBar::InfoBar(int ownerid) { + x = 0; y = 168; + dx = 320; dy = 32; + memidx = BigBar.memidx; + owner = ownerid; + animstate = 0; + timeslice = 1; + oldface=-1; +} + +void InfoBar::drawface(int face, char transf) { + putlfig(157,170,24,29,mm_recall(happyface[oldface=face].memidx)); + if (transf && !menustate) ftransfblock(157,170,24,29,VMEMPTR); +} + +void InfoBar::repaint(byte what) { + char repaint = GETEFLAG(what,IBR_REPAINT), + notransf = (what==IBR_REPNOTRANSF) || menustate; + Player *obj; + void far *pbar; + char validbar; + if (owner<0 || (obj = (Player *)objectslist.get(owner)) == NULL) return; + + validbar = ((pbar = mm_recall(memidx)) != NULL); + + pbar = mm_recall(memidx); + mm_lock(memidx); + if (repaint) + if (validbar) storelfig(x,y,dx,dy,pbar); + else ffillarea(y,dy,0x7f7f7f7fl); + /* + if (GETFLAG(what,IBR_SCORE)) { + if (!repaint) { + setvbuff(pbar); + fcopyblock(46,174-168,46,174,50,11,vpage); //only Big Bar ! + setvbuff(vpage); + } + drawnum(86,174,1,2,bignumf,obj->score); + if (!notransf) + ftransfblock(46,174,50,11,VMEMPTR); + } + */ + if (GETFLAG(what,IBR_HEALTH)) { + if (!GETFLAG(obj->pflags,PFL_GOD)) { + if (!repaint) { + if (validbar) { + setvbuff(pbar); + fcopyblock(92,174-168,92,174,50,11,vpage); //only Big Bar ! + setvbuff(vpage); + } else ffillblock(92,174,50,11,0x7f7f7f7fl); + } + int i; + if ((i = obj->health)<0) i=0; + else if (i>100) i=100+((i-100)>>5); + drawnum(124,174,1,2,bignumf,i); + if (!notransf) + ftransfblock(92,174,50,11,VMEMPTR); + if (!repaint) { + animstate = 0; + timeslice = 1; + } + } + } + if (GETFLAG(what,IBR_KEYS)) { + if (!repaint) { + if (validbar) { + setvbuff(pbar); + fcopyblock(5,172-168,284,172,34,24,vpage); //only Big Bar ! + setvbuff(vpage); + } else ffillblock(284,172,34,24,0x7f7f7f7fl); + } + if (GETFLAG(obj->keys,LCKT_L1)) + putlfig(/*284*/5,172,YellowKey.dx,YellowKey.dy,mm_recall(YellowKey.memidx)); + if (GETFLAG(obj->keys,LCKT_L2)) + putlfig(/*302*/23,172,RedKey.dx,RedKey.dy,mm_recall(RedKey.memidx)); + if (!notransf) + ftransfblock(5,172,34,24,VMEMPTR); + } + if (GETFLAG(what,IBR_ARMS)) { + char col; + if (!repaint) { + if (validbar) { + setvbuff(pbar); + fcopyblock(204,171-168,204,171,112,28,vpage); //only Big Bar ! + setvbuff(vpage); + } else ffillblock(204,171,112,28,0x7f7f7f7fl); + } + if (GETFLAG(obj->armflag,AFL_ASCIA)) { + if (obj->curarm == ARM_ASCIA) col = C_GIALLO; + else col = C_VERDE; + //if (obj->curarm == ARM_PISTOLA) col = C_GIALLO; else col = C_VERDE; + putlchar(207,172,ArmFig[ARM_ASCIA].dx,ArmFig[ARM_ASCIA].dy, + col,0,mm_recall(ArmFig[ARM_ASCIA].memidx)); + } + if (GETFLAG(obj->armflag,AFL_PISTOLA)) { + if (obj->curarm == ARM_PISTOLA) col = C_GIALLO; else + if (obj->Armbull[ARM_PISTOLA-1]) col = C_VERDE; else + col = C_GRIGIO; + //if (obj->curarm == ARM_PISTOLA) col = C_GIALLO; else col = C_VERDE; + putlchar(252,171,ArmFig[ARM_PISTOLA].dx,ArmFig[ARM_PISTOLA].dy, + col,0,mm_recall(ArmFig[ARM_PISTOLA].memidx)); + } + if (GETFLAG(obj->armflag,AFL_FUCILE)) { + if (obj->curarm == ARM_FUCILE) col = C_GIALLO; else + if (obj->Armbull[ARM_FUCILE-1]) col = C_VERDE; else + col = C_GRIGIO; + //if (obj->curarm == ARM_FUCILE) col = C_GIALLO; else col = C_VERDE; + putlchar(283,171,ArmFig[ARM_FUCILE].dx,ArmFig[ARM_FUCILE].dy, + col,0,mm_recall(ArmFig[ARM_FUCILE].memidx)); + } + if (GETFLAG(obj->armflag,AFL_MITRA)) { + if (obj->curarm == ARM_MITRA) col = C_GIALLO; else + if (obj->Armbull[ARM_MITRA-1]) col = C_VERDE; else + col = C_GRIGIO; + putlchar(204,186,ArmFig[ARM_MITRA].dx,ArmFig[ARM_MITRA].dy, + col,0,mm_recall(ArmFig[ARM_MITRA].memidx)); + } + if (GETFLAG(obj->armflag,AFL_BAZOOKA)) { + if (obj->curarm == ARM_BAZOOKA) col = C_GIALLO; else + if (obj->Armbull[ARM_BAZOOKA-1]) col = C_VERDE; else + col = C_GRIGIO; + //if (obj->curarm == ARM_BAZOOKA) col = C_GIALLO; else col = C_VERDE; + putlchar(245,185,ArmFig[ARM_BAZOOKA].dx,ArmFig[ARM_BAZOOKA].dy, + col,0,mm_recall(ArmFig[ARM_BAZOOKA].memidx)); + } + if (GETFLAG(obj->armflag,AFL_BOMB)) { + if (obj->curarm == ARM_BOMB) col = C_GIALLO; else + if (obj->Armbull[ARM_BOMB-1]) col = C_VERDE; else + col = C_GRIGIO; + //if (obj->curarm == ARM_BAZOOKA) col = C_GIALLO; else col = C_VERDE; + putlchar(297,186,ArmFig[ARM_BOMB].dx,ArmFig[ARM_BOMB].dy, + col,0,mm_recall(ArmFig[ARM_BOMB].memidx)); + } + if (!notransf) + ftransfblock(204,171,112,28,VMEMPTR); + + // Ammo + if (!repaint) { + if (validbar) { + setvbuff(pbar); + fcopyblock(46,174-168,46,174,50,11,vpage); //only Big Bar ! + setvbuff(vpage); + } else ffillblock(46,174,50,11,0x7f7f7f7fl); + } + if (obj->curarm) + drawnum(86,174,1,2,bignumf,obj->Armbull[obj->curarm-1]); + if (!notransf) + ftransfblock(46,174,50,11,VMEMPTR); + /* + if (!repaint) { + setvbuff(pbar); + fcopyblock(2,174-168,2,174,40,11,vpage); //only Big Bar ! + setvbuff(vpage); + } + if (obj->curarm) + drawnum(40,174,1,2,bignumf,obj->Armbull[obj->curarm-1]); + if (!notransf) + ftransfblock(2,174,40,11,VMEMPTR); + */ + } + if (repaint) { + // faccia + if (oldface>0) drawface(oldface,!notransf); + else drawface(0,!notransf); + // trasferisce tutto + if (!notransf) + ftransfblock(x,y,dx,dy,VMEMPTR); + } + mm_unlock(memidx); +} + +void InfoBar::animate() { + Player *obj; + int i, newface; + if (animstate == 5) return; + if (owner<0 || (obj = (Player *)objectslist.get(owner)) == NULL) return; + if (GETFLAG(obj->pflags,PFL_GOD) || obj->health>100) { + if (animstate != 4) { + animstate=4; + drawface(13,1); + } + } else + if (animstate==4) { + animstate=0; + timeslice=1; + } else + if (obj->health<=0) { // !!! + animstate=5; + drawface(3,1); + } + switch (animstate) { + case 0: + if (--timeslice > 0) return; + timeslice = 14+random(18); + newface = obj->health/33; + if (newface>2) newface=0; else newface=2-newface; + switch (random(7)) { + case 0: break; + case 1: + case 2: + case 3: newface+=4; break; + case 4: + case 5: + case 6: newface+=10; break; + } + if (newface!=oldface) drawface(newface,1); + break; + case 1: + if (timeslice==28) { + i = obj->health/33; + if (i>2) i=0; else i=2-i; + drawface(7+i,1); + timeslice--; + } else { + if (!(--timeslice)) { + animstate=0; + timeslice=1; + } + } + break; + case 2: + if (timeslice==36) { + i = obj->health/33; + if (i>2) i=0; else i=2-i; + drawface(14+i,1); + timeslice--; + } else { + if (!(--timeslice)) { + animstate=0; + timeslice=1; + } + } + break; + } +} + +void InfoBar::handle_event(TEvent &event) { + switch(event.what) { + case EV_KILL: + case EV_DEAD: + if (event.source==owner) owner=-1; + break; + case EV_UPDATEBAR: + if (event.source==owner) { + repaint(event.data.msg.x); + if (GETFLAG(event.data.msg.x,IBR_FACEHIT)) { + animstate=1; + timeslice=28; + } else + if (GETFLAG(event.data.msg.x,IBR_SMILE)) { + animstate=2; + timeslice=36; + } + } + break; + } +} + +LittleInfoBar::LittleInfoBar(int ownerid,int _x,int _y) + :InfoBar(ownerid) { + x = _x; y = _y; + dx = LitBar.dx; dy = LitBar.dy; + memidx = LitBar.memidx; +} + +void LittleInfoBar::repaint(byte what) { + char repaint = GETEFLAG(what,IBR_REPAINT), + notransf = (what==IBR_REPNOTRANSF) || menustate; + Player *obj; + void far *pbar; + if (owner<0 || (obj = (Player *)objectslist.get(owner)) == NULL) return; + if ((pbar = mm_recall(memidx)) != NULL) storelfig(x,y,dx,dy,pbar); + else ffillblock(x,y,dx,dy,0x7f7f7f7fl); + + if (GETFLAG(what,IBR_HEALTH)) { + //if (!GETFLAG(obj->pflags,PFL_GOD)) { + int i; + if ((i = obj->health)<0) i=0; + else if (i>100) i=100+((i-100)>>5); + drawnum(x+82,y+2,1,2,normnumf,i); + if (!notransf) + ftransfblock(x+82-22,y+2,22,9,VMEMPTR); + //} + } + // Arms & Ammo + if (GETFLAG(what,IBR_ARMS)) { + char col; + int dx,dy,arm = obj->curarm; + + if (arm) { + if (obj->Armbull[arm-1]) col=C_GIALLO; + else col=C_GRIGIO; + drawnum(x+122,y+2,1,2,normnumf,obj->Armbull[arm-1]); + } else col = C_GIALLO; + dx = (41-ArmFig[arm].dx)>>1; + dy = (13-ArmFig[arm].dy)>>1; + putlchar(x+11+dx,y+3+dy,ArmFig[arm].dx,ArmFig[arm].dy, + col,0,mm_recall(ArmFig[arm].memidx)); + if (!notransf) { + ftransfblock(x+11,y+3,42,13,VMEMPTR); + ftransfblock(x+122-22,y+2,22,9,VMEMPTR); + } + } + if (GETFLAG(what,IBR_PLKILLED)) { + drawnum(x+145,y+11,1,2,litnumf,obj->plkilled); + if (!notransf) + ftransfblock(x+145-12,y+11,12,5,VMEMPTR); + } + if (repaint && !notransf) + ftransfblock(x,y,dx,dy,VMEMPTR); +} + +void LittleInfoBar::animate() { + // niente per ora +} \ No newline at end of file diff --git a/KaosSrc/infobar.hpp b/KaosSrc/infobar.hpp new file mode 100644 index 0000000..3774371 --- /dev/null +++ b/KaosSrc/infobar.hpp @@ -0,0 +1,43 @@ +/************************************************************************ + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + ************************************************************************/ + +#define IBR_HEALTH 0x01 +#define IBR_ARMS 0x02 +#define IBR_KEYS 0x04 +//#define IBR_SCORE 0x08 // da togliere +#define IBR_FACEHIT 0x10 +#define IBR_SMILE 0x20 +#define IBR_PLKILLED 0x40 + +#define IBR_REPAINT 0x1f +#define IBR_REPNOTRANSF 0x9f + +class InfoBar +{ + protected: + int x, y, dx, dy; + word memidx; + int owner; + byte animstate, timeslice; + int oldface; + public: + InfoBar(int); + virtual void drawface(int,char); + virtual void repaint(byte); + virtual void animate(); + void handle_event(TEvent &); +}; + +class LittleInfoBar : public InfoBar +{ + public: + LittleInfoBar(int,int,int); + virtual void repaint(byte); + virtual void animate(); +}; + +extern TFig BigBar, LitBar; \ No newline at end of file diff --git a/KaosSrc/kaos.cpp b/KaosSrc/kaos.cpp new file mode 100644 index 0000000..d3a0775 --- /dev/null +++ b/KaosSrc/kaos.cpp @@ -0,0 +1,4245 @@ +/************************************************************************ + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + ************************************************************************/ + +// KAOS V0.99 - the Real KAOS Enhanced version +// Copyright (C)1997 NicoSoźt (Valentini Domenico) + +//#define __ALLOWENEMY__ +//#define __CANCAPT__ +#define __CHECKFIRM__ + +#define MAXBACKGROUND 3 +#define MAXRESETCNT 36 +#define MAXPLAYBACKS 3 +#define MAXPLAYBACKWAIT 360 + +#define MESSAGE_TIME 54 + +#include +#include +#include // solo per getch().. +#include // solo per sound().. e per i parametri (?) +#include +#include +#include +#include // ??? solo per coreleft() + +#include "std.hpp" +#include "errorstr.hpp" +#include "fastmem.hpp" +#include "fixed.h" +#include "mm4.hpp" +#include "crcio.hpp" +#include "key.hpp" +#include "events.hpp" +#include "lgraph.hpp" +#include "vgatool3.hpp" +#include "kaos.hpp" +#include "doors.hpp" +#include "objects.hpp" +#include "objects2.hpp" +#include "player.hpp" +#include "3dengine.hpp" +#include "3dsdriv.hpp" +#include "3dsound.hpp" +#include "lfont2.hpp" +#include "infobar.hpp" +#include "strlist.hpp" + +char *KaosFirm = "KAOS V0.99 - (C)1997 The Millennium Group"; +const int KaosCheck = 3095; //2774 +#define NicCheck 1304 +#define MaxCheck 1249 +#define AndCheck 1218 +char *NicFirm = "DOMENICO VALENTINI", + *MaxFirm = "MASSIMILIANO TESO", + *AndFirm = "ANDREA FIORENTINI"; + +// Palette GAMMA-correction +#define MINGAMMA -6 +#define STDGAMMA 0 +#define MAXGAMMA 6 + +char *levfile = "KAOS"; +const char idDLF[9] = "NICdlf\x7\x1a"; +const char idGAM[9] = "NICgam\x7\x1a"; +const char idDEM[9] = "NICdem\x7\x1a"; + +int origpal, castlepal; +PPal startpal = new char[768], + endpal = new char[768], + gammapal = new char[768]; + +TFig ArmFig[6]; + +TMapInfo *Map = new TMapInfo[4096]; +TObjInfo *ObjMap = new TObjInfo[4096]; +int *IDMap = new int[4096]; +char *LightMap = new char[4096]; +// int WallText[MAXTEXTURES]; +#ifndef __DATAFILE__ +byte ChangeWallText[MAXTEXTURES] = { +T_WALL1S/*T_WALL1*/ ,T_WALL1MS/*T_WALL1M*/, +T_WALL1SS/*T_WALL1S*/ ,T_WALL1MSS/*T_WALL1MS*/, +T_WALL1SS/*T_WALL1SS*/ ,T_WALL1MSS/*T_WALL1MSS*/, +T_TAPS/*T_TAP*/ ,T_TAPMS/*T_TAPM*/, +T_TAPSS/*T_TAPS*/ ,T_TAPMSS/*T_TAPMS*/, +T_TAPSS/*T_TAPSS*/ ,T_TAPMSS/*T_TAPMSS*/, +T_SCUDOS/*T_SCUDO*/ ,T_SCUDOMS/*T_SCUDOM*/, +T_SCUDOSS/*T_SCUDOS*/ ,T_SCUDOMSS/*T_SCUDOMS*/, +T_SCUDOSS/*T_SCUDOSS*/ ,T_SCUDOMSS/*T_SCUDOMSS*/, +T_ARC/*T_ARC*/ ,T_ARCM/*T_ARCM*/, +T_PIETR1S/*T_PIETR1*/ ,T_PIETR1MS/*T_PIETR1M*/, +T_PIETR1SS/*T_PIETR1S*/ ,T_PIETR1MSS/*T_PIETR1MS*/, +T_PIETR1SS/*T_PIETR1SS*/,T_PIETR1MSS/*T_PIETR1MSS*/, +T_ASCES/*T_ASCE*/ ,T_ASCEMS/*T_ASCEM*/, +T_ASCESS/*T_ASCES*/ ,T_ASCEMSS/*T_ASCEMS*/, +T_ASCESS/*T_ASCESS*/ ,T_ASCEMSS/*T_ASCEMSS*/, +T_ROCKS/*T_ROCK*/ ,T_ROCKSS/*T_ROCKS*/, +T_ROCKSS/*T_ROCKSS*/ , +T_WOOD1S/*T_WOOD1*/ ,T_WOOD1SS/*T_WOOD1S*/, +T_WOOD1SS/*T_WOOD1SS*/ , +T_WBOXS/*T_WBOX*/ ,T_WBOXSS/*T_WBOXS*/, +T_WBOXSS/*T_WBOXSS*/ , +T_DOOR1S/*T_DOOR1*/ ,T_DOOR1S/*T_DOOR1S*/, +T_DOOR2S/*T_DOOR2*/ ,T_DOOR2S/*T_DOOR2S*/, +T_DOORYS/*T_DOORY*/ ,T_DOORYS/*T_DOORYS*/, +T_DOORRS/*T_DOORR*/ ,T_DOORRS/*T_DOORRS*/, +T_WOOD2S/*T_WOOD2*/ ,T_WOOD2SS/*T_WOOD2S*/, +T_WOOD2SS/*T_WOOD2SS*/ , +T_SBARRES/*T_SBARRE*/ ,T_SBARRES/*T_SBARRES*/, +T_SWITCHU/*T_SWITCHU*/ , + +T_WALL1Z,T_WALL1MZ,T_PIETR1Z,T_PIETR1MZ,T_ROCKZ,T_WOOD1Z,T_WBOXZ,T_WOOD2Z, +T_WALL2Z/*T_WALL2*/ ,T_WALL2MZ/*T_WALL2M*/, +T_WALL2Z/*T_WALL2Z*/ ,T_WALL2MZ/*T_WALL2MZ*/, +T_PIETR2Z/*T_PIETR2*/ ,T_PIETR2MZ/*T_PIETR2M*/, +T_PIETR2Z/*T_PIETR2Z*/ ,T_PIETR2MZ/*T_PIETR2MZ*/, +T_EARTHZ/*T_EARTH*/ ,T_EARTHZ/*T_EARTHZ*/, +T_SOFTZ/*T_SOFT*/ ,T_SOFTMZ/*T_SOFTM*/, +T_SOFTZ/*T_SOFTZ*/ ,T_SOFTMZ/*T_SOFTMZ*/, + +T_DRAGON ,T_DRAGON+1,T_DRAGON+2,T_DRAGON+3,T_DRAGON+4, +T_DRAGON+5,T_DRAGON+6,T_DRAGON+7,T_DRAGON+8, + +T_GRATAWZ/*T_GRATAW*/ ,T_GRATAWZ/*T_GRATAWZ*/, +T_GRATABZ/*T_GRATAB*/ ,T_GRATABZ/*T_GRATABZ*/, +T_FLROCKZ/*T_FLROCK*/ ,T_FLROCKZ/*T_FLROCKZ*/, +//T_GRIGLIA +T_OVERDOOR,T_DOORSLOT,T_SWITCHD + }; + +byte ChangeFloorText[MAXTEXTURES] = { +T_WALL1Z/*T_WALL1*/ ,T_WALL1MZ/*T_WALL1M*/, +T_WALL1SS/*T_WALL1S*/ ,T_WALL1MSS/*T_WALL1MS*/, +T_WALL1SS/*T_WALL1SS*/ ,T_WALL1MSS/*T_WALL1MSS*/, +T_TAPS/*T_TAP*/ ,T_TAPMS/*T_TAPM*/, +T_TAPSS/*T_TAPS*/ ,T_TAPMSS/*T_TAPMS*/, +T_TAPSS/*T_TAPSS*/ ,T_TAPMSS/*T_TAPMSS*/, +T_SCUDOS/*T_SCUDO*/ ,T_SCUDOMS/*T_SCUDOM*/, +T_SCUDOSS/*T_SCUDOS*/ ,T_SCUDOMSS/*T_SCUDOMS*/, +T_SCUDOSS/*T_SCUDOSS*/ ,T_SCUDOMSS/*T_SCUDOMSS*/, +T_ARC/*T_ARC*/ ,T_ARCM/*T_ARCM*/, +T_PIETR1Z/*T_PIETR1*/ ,T_PIETR1MZ/*T_PIETR1M*/, +T_PIETR1SS/*T_PIETR1S*/ ,T_PIETR1MSS/*T_PIETR1MS*/, +T_PIETR1SS/*T_PIETR1SS*/,T_PIETR1MSS/*T_PIETR1MSS*/, +T_ASCES/*T_ASCE*/ ,T_ASCEMS/*T_ASCEM*/, +T_ASCESS/*T_ASCES*/ ,T_ASCEMSS/*T_ASCEMS*/, +T_ASCESS/*T_ASCESS*/ ,T_ASCEMSS/*T_ASCEMSS*/, +T_ROCKZ/*T_ROCK*/ ,T_ROCKSS/*T_ROCKS*/, +T_ROCKSS/*T_ROCKSS*/ , +T_WOOD1Z/*T_WOOD1*/ ,T_WOOD1SS/*T_WOOD1S*/, +T_WOOD1SS/*T_WOOD1SS*/ , +T_WBOXZ/*T_WBOX*/ ,T_WBOXSS/*T_WBOXS*/, +T_WBOXSS/*T_WBOXSS*/ , +T_DOOR1S/*T_DOOR1*/ ,T_DOOR1S/*T_DOOR1S*/, +T_DOOR2S/*T_DOOR2*/ ,T_DOOR2S/*T_DOOR2S*/, +T_DOORYS/*T_DOORY*/ ,T_DOORYS/*T_DOORYS*/, +T_DOORRS/*T_DOORR*/ ,T_DOORRS/*T_DOORRS*/, +T_WOOD2Z/*T_WOOD2*/ ,T_WOOD2SS/*T_WOOD2S*/, +T_WOOD2SS/*T_WOOD2SS*/ , +T_SBARRES/*T_SBARRE*/ ,T_SBARRES/*T_SBARRES*/, +T_SWITCHU/*T_SWITCHU*/ , + +T_WALL1Z,T_WALL1MZ,T_PIETR1Z,T_PIETR1MZ,T_ROCKZ,T_WOOD1Z,T_WBOXZ,T_WOOD2Z, +T_WALL2Z/*T_WALL2*/ ,T_WALL2MZ/*T_WALL2M*/, +T_WALL2Z/*T_WALL2Z*/ ,T_WALL2MZ/*T_WALL2MZ*/, +T_PIETR2Z/*T_PIETR2*/ ,T_PIETR2MZ/*T_PIETR2M*/, +T_PIETR2Z/*T_PIETR2Z*/ ,T_PIETR2MZ/*T_PIETR2MZ*/, +T_EARTHZ/*T_EARTH*/ ,T_EARTHZ/*T_EARTHZ*/, +T_SOFTZ/*T_SOFT*/ ,T_SOFTMZ/*T_SOFTM*/, +T_SOFTZ/*T_SOFTZ*/ ,T_SOFTMZ/*T_SOFTMZ*/, + +T_DRAGON ,T_DRAGON+1,T_DRAGON+2,T_DRAGON+3,T_DRAGON+4, +T_DRAGON+5,T_DRAGON+6,T_DRAGON+7,T_DRAGON+8, + +T_GRATAWZ/*T_GRATAW*/ ,T_GRATAWZ/*T_GRATAWZ*/, +T_GRATABZ/*T_GRATAB*/ ,T_GRATABZ/*T_GRATABZ*/, +T_FLROCKZ/*T_FLROCK*/ ,T_FLROCKZ/*T_FLROCKZ*/, +//T_GRIGLIA +T_OVERDOOR,T_DOORSLOT,T_SWITCHD + }; +#endif +int changewtext,changeftext; // MM index of the tables + +TFigure FigList[MAXFIGURES]; + +TFig RedKey, YellowKey; + +#define SqrLumaca 0 +TFig Sqrs[11]; + +TFig *litnumf = new TFig[10], + *normnumf = new TFig[10], + *bignumf = new TFig[10], + *stdnumf = new TFig[10]; +TFig *happyface = new TFig[17]; + +char ValidGame = 0, + //OkExit = 0, + init_pause = 0, + gamma = STDGAMMA; +char initlev = 0; +// publics +char players = 0; +#define STDGFLAGS (GFL_AUTOCENTER|GFL_SHOWBLOOD) +byte gameflags = STDGFLAGS; +char useslim = 0, slowmode = 0; + +char quake = 0; // Quake visual effect +int windsound = -1; // Wind sound ID +int sursound = -1; // Surround sound ID +int action, actioncount; // Local events managment + // (non voglio rompere le scatole + // all'eventmanager per cosŤ poco...) +word maxdim = 320, // Max window/s size !!! togliere... ? + viewdim[3] = {320,152,148}; +int palanimstate = 0, // Palette animation counters... + palanimcount = 0; +int cbackg0,fbackg0, // Backgrounds MM's IDs (MM_ID) + cbackg1,fbackg1, + fbacki[MAXBACKGROUND][2],cbacki[MAXBACKGROUND][2], + dragon1[4],dragon2[4],castle[4]; //, Sample3P; +int corner[8]; +int thunder, // immagine fulmine + volume_bar, volume_sel, // immagini barra e selettore volume + toggle_on, toggle_off, // immagini selection box + woodblock, kidwarn, + levelblock, matchblock, + sl_greetings, sl_quotes, + sl_ordering, sl_help, + sl_info, sl_messages; + +Font *Std, *Big; //, *Lit; +int menustate = 0, + oldmenustate = -1, + menuitem = 0; +char viewstate = 0, + repaint = 1; +int numenemies = 0; +//char Kaos_enable = 1; // !!!K +int Kaos_count; // !!!K +int minibox_I, minibox_F; +char s_autocenter = 1, s_Kaos_enable = 1; + +char message[3][80] = {"","",""}; +char message_num=0, message_count=0; + +Actor *PlayAr[3] = {NULL,NULL,NULL}; +InfoBar *InfoBarAr[3] = {NULL,NULL,NULL}; +struct {int vidx,vidy; // Players video coords + char cd, fd;} PlayVid[3] = { + {160,84,0,0},{160,100,0,0},{160,100,0,0} + }; +TPlayerData PlayerData[3]; +int KAOSMark[4]; +int MNID_Nico, MNID_Maxy, MNID_Andy; +int PlayerAscia[3],PlayerPist[3],PlayerFuc[3],PlayerMitr[5],PlayerBaz; +int WorkID[3], KeyLeft, KeyRight; +char levnum, levname[24]; + +// playback managment +word playbackwait = MAXPLAYBACKWAIT; +char saveplayback = 0; +int playbackhandle = -1; + +// Timer Sync vars +volatile byte Sync = 0; +volatile char SyncTrig = 1; +char SyncOk = 0; + +TControl PControl[4] = {{ + KB_UP, KB_DOWN, KB_LEFT, KB_RIGHT, + KB_SPACE, KB_CTRL, KB_RSHIFT, KB_ALT, + KB_ENTER, KB_t3, KB_t1, KB_CANC, + KB_Z + },{ + KB_E, KB_D, KB_S, KB_F, + KB_TAB, KB_A, KB_Q, KB_Z, + KB_BSLASH, KB_4, KB_3, KB_2, + KB_1 + },{ + KB_t5, KB_DOWN, KB_t1, KB_t3, + KB_RIGHT, KB_t0, KB_UP, KB_LEFT, + KB_tPLUS, KB_MINUS, KB_PER, KB_SLASH, + KB_t7 + },{ + KB_P, KB_O_, KB_L, KB_A_, + KB_J, KB_K, KB_U, KB_H, + KB_COMMA, KB_13, KB_12, KB_0, + KB_9 + } +}; + +ObjectsList objectslist; +ActorsList actorslist; +DoorManager doormanager; + +#pragma warn -rvl +int xytoidx(fixed x, fixed y) { +asm { + MOV AX, WORD PTR x[2] + AND AX, 0x7fc0 + MOV BX, WORD PTR y[2] + SHR BX, 6 + ADD AX, BX +}} +#pragma warn +rvl + +int is_nearPlayer(fixed x, fixed y, fixed maxdist) { + Actor *plyr; + for (int i=0;imover->x - x)mover->y - y)getid(); + } + return -1; +} + +void drawnum(int x, int y, byte col1, byte col2, + TFig *numfont, int num) { + int i; + char s[16]; + void far *p; + sprintf(s,"%d",ABS(num)); // addirittura la sprintf ! Eh, sŤ + // tanto ormai ce l'ho messa... + for(i=0;s[i];i++); + if (i>0) + for(i--;i>=0;i--) { + TFig &fig = numfont[s[i]-'0']; + x-=fig.dx; + if ((p = mm_recall(fig.memidx)) != NULL) + putlchar(x--,y,fig.dx,fig.dy,col1,col2,p); + } +} + +static char changegamma(char newgamma) { + int i; + PPal app, app1; + + if (newgamma>=MINGAMMA && newgamma<=MAXGAMMA) { + gamma = newgamma; + app = gammapal; + app1 = (PPal)mm_recall(origpal); + if (newgamma>STDGAMMA) { + for (i=0;i<768;i++,app++,app1++) + *app = *app1+((int)(63-(*app1)) * newgamma / MAXGAMMA); + } else + if (newgamma maxdim) { + viewdim[pnum] = maxdim; + setit++; + } + switch(newval) { + case -1: // stringe + if (viewdim[pnum]>96) { + if ((viewdim[pnum] -= 16) < 96) + viewdim[pnum] = 96; + setit++; + } + break; + case 1: + if (viewdim[pnum] maxdim) + viewdim[pnum] = maxdim; + setit++; + } + break; + default: + if (newval<96) newval=96; else + if (newval>maxdim) newval=maxdim; + viewdim[pnum] = newval; + setit++; // la modifica sempre, se diretta + break; + } + if (setit) { + dy = viewdim[pnum]*10/19; + if (dy > 168) dy = 168; + setviewsize(viewdim[pnum],dy); + Sync=0; + repaint=1; + } + return setit; +} + +static void loadconfig() { + int handle; + unsigned i; + if ((handle = CRC_openread("KAOS.CFG"))>=0) { + CRC_read(handle,&sm_soundvol,2); + //sbmix_setvol(MIXER_VOICE,i); + //sm_soundvol = i; + CRC_read(handle,&i,2); + sbmix_setvol(MIXER_MIDI,i); + CRC_read(handle,&viewdim,2+2+2); + CRC_read(handle,&gamma,sizeof(gamma)); + changegamma(gamma); + CRC_read(handle,&sm_lrinverted,1); + CRC_read(handle,&gameflags,sizeof(gameflags)); + CLRFLAG(gameflags,GFL_TOTALMAP); + s_Kaos_enable = GETFLAG(gameflags,GFL_KAOSENABLE); + s_autocenter = GETFLAG(gameflags,GFL_AUTOCENTER); +#ifndef __SHAREWARE__ + CRC_read(handle,&initlev,1); + if (initlev>12 || initlev<-16) initlev=0; +#else + initlev=0; // ...si poteva fare un giochetto con la riga sopra... +#endif + CRC_close(handle); + } else changegamma(STDGAMMA); +} + +static void saveconfig() { + int handle; + + if ((handle = CRC_openwrite("KAOS.CFG"))>=0) { + //_write(handle,&SBdefault[MIXER_VOICE],2); + CRC_write(handle,&sm_soundvol,2); + CRC_write(handle,&SBdefault[MIXER_MIDI],2); + CRC_write(handle,&viewdim,2+2+2); + CRC_write(handle,&gamma,sizeof(gamma)); + //CRC_write(handle,&messages,1); + CRC_write(handle,&sm_lrinverted,1); + MAKEFLAG(gameflags,GFL_KAOSENABLE,s_Kaos_enable); + MAKEFLAG(gameflags,GFL_AUTOCENTER,s_autocenter); + CRC_write(handle,&gameflags,sizeof(gameflags)); +#ifndef __SHAREWARE__ + CRC_write(handle,&initlev,1); +#endif + CRC_close(handle); + } +} + +#ifdef __DATAFILE__ +static void near pre_loadtext() { + TMapInfo *mappa = Map; + byte *fmap = floormap, *cmap = ceilmap; + int i; + soundmanager(-1,0,0); + mm_recall(cbackg0); mm_recall(fbackg1); + mm_recall(cbackg1); mm_recall(fbackg0); + objectslist.preloadall(); + for (i=4096; i--; mappa++) { + if (!(i & 255)) soundmanager(-1,0,0); + if (mappa->stop) + switch(mappa->type) { + case MTP_DOOR1: + case MTP_DOOR2: + mm_recall(doormanager.doortype[mappa->data]); + break; + case MTP_GRID1: + mm_recall(mappa->data); + break; + default: + mm_recall(mappa->data); + } + mm_recall(*(fmap++)); + mm_recall(*(cmap++)); + } +} +#endif + +static Object * near wlkobj(fixed x, fixed y, word fig, char takeable) { + Object *object; + delete mm_reserve(sizeof(Object)); + object = new Object(x,y,fig,1,MVT_0); + object->mover->flags &= ~(OMF_UNWALKABLE | OMF_HITABLE); + if (takeable) object->oflags |= OFL_TAKEABLE; + objectslist.put(object); + return object; +} + +// New !!! +static void near adjustmap() { + TMapInfo *mappa = Map; + int x, y, fig; + fixed fx, fy; + fixed p[6]; + int dir[3] = {ANG0,ANG0,ANG0}; + Object *object; + byte data; + word ogg = OMF_STANDARD; + word *oggmap = objmap; + int pvalid = 0; + + numenemies = 0; + for (x=0;x<64;x++) + for (y=0;y<64;y++,mappa++,oggmap++) { + if (!mappa->stop) { + if (mappa->none) { + fx = lshl16((x<<6)+32); + fy = lshl16((y<<6)+32); + //mappa->data++; // !!! Questioni legate all'EDITOR livelli + if (mappa->data >= T_TEXTURES) { + if (mappa->data < T_OBJECTS) { + switch(data = mappa->data-T_TEXTURES) { + case 0: // Fucile + wlkobj(fx,fy,F_FUCILE,1); + break; + case 1: // Mitra + wlkobj(fx,fy,F_MITRA,1); + break; + case 2: // BAZOOKA + wlkobj(fx,fy,F_BAZOOKA,1); + break; + case 3: // Barile + delete mm_reserve(sizeof(Barile)); + objectslist.put(new Barile(fx,fy)); + break; + case 4: // Torcia + case 5: + case 6: + case 7: + case 8: + case 9: + case 10: + case 11: + delete mm_reserve(sizeof(Torcia)); + switch ((data-4) & 3) { + case 0: fx+=(28l<<16); break; + case 1: fy+=(28l<<16); break; + case 2: fx-=(28l<<16); break; + case 3: fy-=(28l<<16); break; + } + if (data>=8) fig = F_TORCIAM; + else fig = F_TORCIA; + object = new Torcia(fx,fy,fig); + objectslist.put(object); + break; + case 12: // Colonna + case 13: + delete mm_reserve(sizeof(Object)); + if (data == 12) fig = F_COLUMN; + else fig = F_COLUMNM; + object = new Object(fx,fy,fig,1,MVT_0); + object->mover->z = 30l<mover->shdim = 3; + objectslist.put(object); + break; + case 14: // Lamp & Trespolo + case 15: + delete mm_reserve(sizeof(Lampadario)); + if (data==14) fig = F_LAMP; + else fig = F_TRESPOLO; + object = new Lampadario(fx,fy,fig); + /* + if (data==15) { + object->changefig(F_TRESPOLO,1); + object->mover->z=32l<mover->flags |= OMF_UNWALKABLE | OMF_HITABLE; + } + */ + objectslist.put(object); + break; + case 16: // Keys + case 17: + if (data==16) fig=F_KEYRED; + else fig=F_KEYELLOW; + wlkobj(fx,fy,fig,1); + break; + case 18: // Cartucce + case 19: + case 20: + case 21: + case 22: + switch(data) { + case 18: fig=F_CARTUCCIA1; break; + case 19: fig=F_CARTUCCIA2; break; + case 20: fig=F_CARTUCCIA3; break; + case 21: fig=F_CARTUCCIA4; break; + case 22: fig=F_BOMB; break; + } + wlkobj(fx,fy,fig,1); + break; + case 23: // Ossa + case 24: + delete mm_reserve(sizeof(Ossa)); + if (data==23) fig = F_OSSALIT; + else fig = F_OSSABIG; + object = new Ossa(fx,fy,fig); + if (data==24) { + object->mover->z = 18l<mover->shdim = 5; + } + objectslist.put(object); + break; + case 25: // Vaso + case 26: // +gadgets: fucile + case 27: // +mitra + case 28: // +bazooka + case 29: // +cartuccia1 + case 30: // + " 2 + case 31: // + " 3 + case 32: // + " 4 + case 33: // +bomba + case 34: // +boom + case 35: // +Pianta + case 36: // +gadgets: fucile + case 37: // +mitra + case 38: // +bazooka + case 39: // +cartuccia1 + case 40: // + " 2 + case 41: // + " 3 + case 42: // + " 4 + case 43: // +bomba + case 44: // +boom + delete mm_reserve(sizeof(Vaso)); + if (data<35) { + fig = F_VASO; + data -= 25; + } else { + fig = F_PIANTA; + data -= 35; + } + objectslist.put(new Vaso(fx,fy,fig,data)); + // per la specializzazione procedere in + // fase di new !!!!!!!!!!!! + break; + case 45: // Bonus + //(object = wlkobj(fx,fy,F_BONUS,1))->mover->z = 24l<<16; + delete mm_reserve(sizeof(Bonus)); + objectslist.put(new Bonus(fx,fy)); + break; + case 46: // Farma + case 47: + if (data==46) fig = F_FARMABIG; + else fig = F_FARMALIT; + wlkobj(fx,fy,fig,1); + break; + case 48: // Soldo + case 49: + if (data==48) fig = F_SOLDOBIG; + else fig = F_SOLDOLIT; + wlkobj(fx,fy,fig,1); + break; + case 50: // Alberi + case 51: + delete mm_reserve(sizeof(Object)); + /* + if (data == 50) fig = F_ALBERO; + else fig = F_ALBERO+1; + */ + fig = F_ALBERO+data-50; + object = new Object(fx,fy,fig,1,MVT_0); + object->mover->z = 28l<mover->shdim = 4; + objectslist.put(object); + break; + case 52: // Brazier + delete mm_reserve(sizeof(Torcia)); + objectslist.put(new Torcia(fx,fy,F_BRAZIER)); + break; + case 53: // Anti Kaos ! + delete mm_reserve(sizeof(AntiKaos)); + objectslist.put(new AntiKaos(fx,fy)); + break; + } + } else + if (mappa->data < T_ENEMIES) { + switch(data = mappa->data-T_OBJECTS) { + case 0: // Slimer + delete mm_reserve(sizeof(Slimer)); + objectslist.put(new Slimer(fx,fy)); break; + case 1: // Face +#ifdef __ALLOWENEMY__ + delete mm_reserve(sizeof(Enemy)); + objectslist.put(new Enemy(fx,fy,F_FACE)); +#else + //error("Face not allowed in This version"); +#endif + break; + case 2: // Spider + delete mm_reserve(sizeof(Spider)); + objectslist.put(new Spider(fx,fy)); break; + case 3: // Soldier + delete mm_reserve(sizeof(Soldier)); + objectslist.put(new Soldier(fx,fy)); break; + case 4: // Mouse + delete mm_reserve(sizeof(Mouse)); + objectslist.put(new Mouse(fx,fy)); break; + case 5: // Bub +#ifdef __ALLOWENEMY__ + delete mm_reserve(sizeof(Enemy)); + objectslist.put(new Enemy(fx,fy,F_BUB)); +#else + //error("Bub not allowed in This version"); +#endif + break; + default: + switch(data) { + case 6: fig = F_SLIMER+21; // Slimer dead + break; + case 7: fig = F_FACE+16; // Face dead + break; + case 8: fig = F_SPIDER+18; // Spider dead + break; + case 9: fig = F_SOLDIER+34; // Soldier dead + break; + case 10: fig = F_MOUSE+9; // Mouse dead + break; + case 11: fig = F_BUB+19; // Bub dead + break; + } + delete mm_reserve(sizeof(Object)); + object = new Object(fx,fy,fig,1,MVT_0); + object->mover->z = (-(long)FigList[fig].height-(FigList[fig].dy>>3))<mover->flags,OMF_UNWALKABLE|OMF_HITABLE); + objectslist.put(object); + break; + } + } else + if (mappa->data < T_PLAYERS) { + data = mappa->data-T_ENEMIES; + if (data<12) { + fig = (data>>1) & 0xfffe; + p[fig]=fx; p[fig+1]=fy; + fig>>=1; + pvalid |= 1<data = 0; + // inutili + mappa->type = 0; + mappa->shape= 0; + mappa->none = 0; + } + } else { + switch(mappa->type) { + case MTP_DOOR1: + case MTP_DOOR2: + mappa->data = doormanager.add(mappa->data); + // !!! DOORFLAGS == OMF_STANDARD !!! + break; + case MTP_GRID1: + ogg &= ~OMF_SOUNDABLE; + break; + } + if (mappa->data == T_NULL+1) { + mappa->data--; + mappa->stop=0; + ogg = OMF_UNWALKABLE; + } + *oggmap += ogg; + ogg = OMF_STANDARD; + } + } + + doormanager.makeslots(); + + switch (players) { + case 1: + if (!(pvalid & 1)) + error("adjustmap","no Player"); + delete mm_reserve(sizeof(Player)); + if (ValidGame) + PlayAr[0] = new Player(p[0],p[1],dir[0],PlayerData[0],0); + else + PlayAr[0] = new Player(p[0],p[1],dir[0],0); + objectslist.put(PlayAr[0]); + + if (!playbackwait) { + ((Player *)PlayAr[0])->setcomtype(COM_LOAD); + } else + if (saveplayback) { + ((Player *)PlayAr[0])->setcomtype(COM_SAVE); + } + delete mm_reserve(sizeof(InfoBar)); + InfoBarAr[0] = new InfoBar(PlayAr[0]->getid()); + break; + case 2: + if ((pvalid & 3) != 3) + error("adjustmap","no 2 Players"); + delete mm_reserve(sizeof(Player)); + if (ValidGame) + PlayAr[0] = new Player(p[0],p[1],dir[0],PlayerData[0],1); + else + PlayAr[0] = new Player(p[0],p[1],dir[0],1); + + if (!useslim) { + delete mm_reserve(sizeof(Player)); + if (ValidGame) + PlayAr[1] = new Player(p[2],p[3],dir[1],PlayerData[1],2); + else + PlayAr[1] = new Player(p[2],p[3],dir[1],2); + } else { + delete mm_reserve(sizeof(Slimer)); + PlayAr[1] = new Slimer(p[2],p[3]); + PlayAr[1]->seen(); + } + objectslist.put(PlayAr[0]); + objectslist.put(PlayAr[1]); + if (!playbackwait) { + ((Player *)PlayAr[0])->setcomtype(COM_LOAD); + ((Player *)PlayAr[1])->setcomtype(COM_LOAD); + } else + if (saveplayback) { + ((Player *)PlayAr[0])->setcomtype(COM_SAVE); + ((Player *)PlayAr[1])->setcomtype(COM_SAVE); + } + delete mm_reserve(sizeof(LittleInfoBar)); + InfoBarAr[0] = new LittleInfoBar(PlayAr[0]->getid(),4,176); + if (!useslim) { + delete mm_reserve(sizeof(LittleInfoBar)); + InfoBarAr[1] = new LittleInfoBar(PlayAr[1]->getid(),163,92); + } + break; + case 3: + if ((pvalid & 7) != 7) + error("adjustmap","no 3 Players"); + delete mm_reserve(sizeof(Player)); + if (ValidGame) + PlayAr[0] = new Player(p[0],p[1],dir[0],PlayerData[0],1); + else + PlayAr[0] = new Player(p[0],p[1],dir[0],1); + if (!useslim) { + delete mm_reserve(sizeof(Player)); + if (ValidGame) + PlayAr[1] = new Player(p[2],p[3],dir[1],PlayerData[1],2); + else + PlayAr[1] = new Player(p[2],p[3],dir[1],2); + } else { + delete mm_reserve(sizeof(Slimer)); + PlayAr[1] = new Slimer(p[2],p[3]); + PlayAr[1]->seen(); + } + if (!useslim) { + delete mm_reserve(sizeof(Player)); + if (ValidGame) + PlayAr[2] = new Player(p[4],p[5],dir[2],PlayerData[2],3); + else + PlayAr[2] = new Player(p[4],p[5],dir[2],3); + } else { + delete mm_reserve(sizeof(Slimer)); + PlayAr[2] = new Slimer(p[4],p[5]); + PlayAr[2]->seen(); + } + objectslist.put(PlayAr[0]); + objectslist.put(PlayAr[1]); + objectslist.put(PlayAr[2]); + if (!playbackwait) { + ((Player *)PlayAr[0])->setcomtype(COM_LOAD); + ((Player *)PlayAr[1])->setcomtype(COM_LOAD); + ((Player *)PlayAr[2])->setcomtype(COM_LOAD); + } else + if (saveplayback) { + ((Player *)PlayAr[0])->setcomtype(COM_SAVE); + ((Player *)PlayAr[1])->setcomtype(COM_SAVE); + ((Player *)PlayAr[2])->setcomtype(COM_SAVE); + } + delete mm_reserve(sizeof(LittleInfoBar)); + InfoBarAr[0] = new LittleInfoBar(PlayAr[0]->getid(),4,180); + if (!useslim) { + delete mm_reserve(sizeof(LittleInfoBar)); + InfoBarAr[1] = new LittleInfoBar(PlayAr[1]->getid(),164,180); + delete mm_reserve(sizeof(LittleInfoBar)); + InfoBarAr[2] = new LittleInfoBar(PlayAr[2]->getid(),84,80); + } + break; + } +#ifdef __DATAFILE__ + pre_loadtext(); +#endif +} + +char initgame(int plrs) { + int i; + + if (plrs != players) { + + switch (plrs) { + case 1: + maxdim=320; + PlayVid[0].vidx = 160; + PlayVid[0].vidy = 84; + break; +#ifndef __SHAREWARE__ + case 2: + maxdim=152; + PlayVid[0].vidx = 80; + PlayVid[0].vidy = 130; + PlayVid[1].vidx = 239; + PlayVid[1].vidy = 46; + break; + case 3: + maxdim=148; + PlayVid[0].vidx = 80; + PlayVid[0].vidy = 142; + PlayVid[1].vidx = 240; + PlayVid[1].vidy = 142; + PlayVid[2].vidx = 160; + PlayVid[2].vidy = 42; + break; +#endif + default: return 0; + } + + players = plrs; + changeviewsize(viewdim[plrs-1]); + } + return 1; +} + +char delgame() { + int i; + if (ValidGame) { + for (i=0;igetdata(PlayerData[i]); + // l'oggetto verr… cancellato dall'objectslist + PlayAr[i] = NULL; + } + // deletes the current game + ShutDown=1; // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + for (i=0;i<3;i++) + if (InfoBarAr[i]) { + delete InfoBarAr[i]; + InfoBarAr[i]=NULL; + } + objectslist.eraseall(); + actorslist.eraseall(); + doormanager.eraseall(); + eventmanager.flush(); + stopallsounds(); + windsound=-1; + numenemies=0; + ShutDown=0; + ValidGame=0; + return 1; + } + return 0; +} + +void drawdisk() { + setvbuff(VMEMPTR); + storerfig(8,8,32,24,mm_recall(Sqrs[10].memidx)); + setvbuff(vpage); + repaint = 1; +} + +void drawpict(int *pictpiece, void far *dest) { + int i; + void far *ptr; + for (i=0;i<4;i++) { + if ((ptr = mm_recall(pictpiece[i])) != NULL) { + setvbuff(ptr); + fcopyarea(0,i*50,50,dest); + } else ffillarea(i*50,50,0x7f7f7f7fl); + } + setvbuff(vpage); +} + +void drawcorners(int x, int y) { + int i,app; + app = x+viewwidth-24; + setvrect(0,0,320,200); + storelcfig(app,y-4,24,4,mm_recall(corner[4])); + storelcfig(app,y+viewheight,24,4,mm_recall(corner[7])); + for(i=0,app=x;icolorwrite(16,8,50,"KAOS Policy Subsystem"); + Big->colorwrite(32, 36,2,"Il Millennium Group ha"); + Big->colorwrite(32, 58,2,"limitato la diffusione"); + Big->colorwrite(32, 80,2,"di questi nuovi livelli."); + Big->colorwrite(8,106,4,"Non hai i privilegi per poter"); + Big->colorwrite(8,128,4,"giocare con questo episodio."); + setvbuff(vpage); + kb_onepressed(KB_ESC); + kb_onepressed(KB_ENTER); + kb_onepressed(KB_SPACE); + while (!kb_onepressed(KB_ESC) && !kb_onepressed(KB_ENTER) && + !kb_onepressed(KB_SPACE)) ; + //Sync = 0; + repaint = 1; +} + +void congratulations() { + drawpict(dragon1,VMEMPTR); + setvbuff(VMEMPTR); + Big->colorwrite(47, 7,48,"Episodio completato"); + Big->colorwrite(48, 8,50,"Episodio completato"); + Big->colorwrite(32, 48,2,"Congratulazioni !!!"); + Big->colorwrite(32, 72,2,"Sei uscito dal mondo"); + Big->colorwrite(32, 96,2,"del Kaos"); + //Big->colorwrite(32,124,4,"per tornare nel tuo"); + //Big->colorwrite(32,148,4,"che pure peggio"); + /* + Finalmente hai completato la tua missione nel mondo del Kaos + Ora insegui il tuo sogno nel mondo reale + */ + setvbuff(vpage); + kb_onepressed(KB_ESC); + kb_onepressed(KB_ENTER); + kb_onepressed(KB_SPACE); + while (!kb_onepressed(KB_ESC) && !kb_onepressed(KB_ENTER) && + !kb_onepressed(KB_SPACE)) ; + //Sync = 0; + repaint = 1; +} + +// New !!! +char loadmap(int level) { + char id[9] = "........"; + int handle, i, j; + byte num; + //byte p[6] = {32,32,32,32,32,32}; + sprintf(levname,"%s.DLF",levfile); + //strcpy(levname,levfile); // uso levname per risparmiare + //strcat(levname,".DLF"); + + if ((handle = CRC_openread(levname)) >= 0) { + drawdisk(); +#ifdef __DATAFILE__ + mm_flushall(); +#ifdef __VISUALIZE__ + mm_visualize(); + sound(500);delay(50);nosound();delay(50); +#endif +#else + mm_resetall(); +#endif + if (delgame()) { + ValidGame=1; + // NON MODIFICARE ValidGame ! + // avverte l'adjustmap() che il gioco prosegue... + } + CRC_read(handle,&id,8); + if (fwcomp(id,(void *)&idDLF,8)) { + CRC_read(handle,&num,sizeof(num)); + for (j=0,i=0;j=MAXBACKGROUND) i=0; + cbackg0 = cbacki[i][0]; + fbackg0 = fbacki[i][0]; + cbackg1 = cbacki[i][1]; + fbackg1 = fbacki[i][1]; + //} else error("loadmap() - Invalid background"); + //CRC_read(handle,p,6); + CRC_read(handle,Map,8192); + CRC_read(handle,floormap,4096); + CRC_read(handle,ceilmap,4096); + } else { + CRC_close(handle); + return ValidGame=0; + } +#ifdef __CHECKFIRM__ + //if (!level) { + for (j++;j= 0) { + //drawdisk(); + CRC_read(handle,&id,8); + if (fwcomp(id,(void *)&idDLF,8)) { + CRC_read(handle,&num,sizeof(num)); + for (j=0,i=0;j=MAXBACKGROUND) i=0; + cbackg0 = cbacki[i][0]; + fbackg0 = fbacki[i][0]; + cbackg1 = cbacki[i][1]; + fbackg1 = fbacki[i][1]; + //} else error("loadmap() - Invalid background"); + //_read(handle,p,6); // inutilizzato + //_read(handle,Map,8192); // inutilizzato + CRC_lseek(handle,8192l+4096l,SEEK_CUR); + //CRC_read(handle,floormap,4096); + CRC_read(handle,ceilmap,4096); + } else { + CRC_close(handle); + return 0; + } +#ifdef __CHECKFIRM__ + //if (!level) { + for (j++;j7) return 0; + int handle, i, j; + char s[32], lev, plrnum; + int plrids[3]; + byte objtype; + Object *obj; + + sprintf(s,"KAOS%1d.GAM",game); + if ((handle = CRC_openread(s)) >= 0) { + drawdisk(); + + CRC_read(handle,s,8); + if (!fwcomp(s,(void *)&idGAM,8)) {CRC_close(handle); return 0;} + CRC_read(handle,s,32); + CRC_read(handle,&plrnum,sizeof(plrnum)); + CRC_read(handle,&plrids,2+2+2); // PlayAr sync + CRC_read(handle,&objtype,sizeof(objtype)); + MAKEFLAG(gameflags,GFL_COMPETITIVE,GETFLAG(objtype,GFL_COMPETITIVE)); + MAKEFLAG(gameflags,GFL_KAOSENABLE,GETFLAG(objtype,GFL_KAOSENABLE)); + CRC_read(handle,s,8); s[8]=0; + if (strcmp(s,levfile)) {CRC_close(handle); return 0;} +#ifdef __DATAFILE__ + mm_flushall(); +#else + mm_resetall(); +#endif + delgame(); + if (!initgame(plrnum)) {CRC_close(handle); return 0;} + CRC_read(handle,&lev,sizeof(lev)); + if (!loadgamedat(lev)) {CRC_close(handle); return 0;} + //levnum = lev; implicito nel loadgamemap, ma ormai il gioco Š morto. + CRC_read(handle,Map,8192); + CRC_read(handle,ObjMap,8192); + CRC_read(handle,IDMap,8192); + CRC_read(handle,LightMap,4096); + CRC_read(handle,floormap,4096); + //CRC_read(handle,ceilmap,4096); + + doormanager.load(handle); + numenemies = 0; + do { + // Ho la spiacevole sensazione che si sarebbe potuto evitare + // tutto questo con qualche tecno-trucco... + CRC_read(handle,&objtype,sizeof(objtype)); + if (objtype==OBJT_END) break; + switch (objtype) { + case OBJT_OBJECT: + delete mm_reserve(sizeof(Object)); + obj = new Object(handle); + break; + case OBJT_ACTOR: + delete mm_reserve(sizeof(Actor)); + obj = new Actor(handle); + break; + case OBJT_LIGHTACTOR: + delete mm_reserve(sizeof(LightActor)); + obj = new LightActor(handle); + break; + case OBJT_CANFIREACTOR: + delete mm_reserve(sizeof(CanFireActor)); + obj = new CanFireActor(handle); + break; + case OBJT_OSSA: + delete mm_reserve(sizeof(Ossa)); + obj = new Ossa(handle); + break; + case OBJT_FLOSSA: + delete mm_reserve(sizeof(FlOssa)); + obj = new FlOssa(handle); + break; + case OBJT_BONUS: + delete mm_reserve(sizeof(Bonus)); + obj = new Bonus(handle); + break; + case OBJT_SLIMER: + delete mm_reserve(sizeof(Slimer)); + obj = new Slimer(handle); + break; + case OBJT_SPIDER: + delete mm_reserve(sizeof(Spider)); + obj = new Spider(handle); + break; + case OBJT_SOLDIER: + delete mm_reserve(sizeof(Soldier)); + obj = new Soldier(handle); + break; + case OBJT_MOUSE: + delete mm_reserve(sizeof(Mouse)); + obj = new Mouse(handle); + break; + case OBJT_FIREBOOM: + delete mm_reserve(sizeof(FireBoom)); + obj = new FireBoom(handle); + break; + case OBJT_FIREBALL: + delete mm_reserve(sizeof(Fireball)); + obj = new Fireball(handle); + break; + case OBJT_TORCIA: + delete mm_reserve(sizeof(Torcia)); + obj = new Torcia(handle); + break; + case OBJT_LAMPADARIO: + delete mm_reserve(sizeof(Lampadario)); + obj = new Lampadario(handle); + break; + case OBJT_BARILE: + delete mm_reserve(sizeof(Barile)); + obj = new Barile(handle); + break; + case OBJT_VASO: + delete mm_reserve(sizeof(Vaso)); + obj = new Vaso(handle); + break; + case OBJT_PLAYER: + // per il multiplayer si aggiunge: + // players=0 all'inizio + // players++ da queste parti + // poi si usa questo contatore... + delete mm_reserve(sizeof(Player)); + obj = new Player(handle); + + j = obj->getid(); // old game IDs are kept + for (i=0;i<3;i++) + if (plrids[i]==j) { + PlayAr[i] = (Player *)obj; + delete mm_reserve(sizeof(InfoBar)); + InfoBarAr[i]=new InfoBar(PlayAr[i]->getid()); + i=-1; + break; + } + if (i>=0) error("loadgame","invalid Player slot"); + break; + case OBJT_OBJMOVER: + delete mm_reserve(sizeof(ObjMover)); + obj = new ObjMover(handle); + break; + case OBJT_BOMB: +#ifndef __SHAREWARE__ + delete mm_reserve(sizeof(Bomb)); + obj = new Bomb(handle); +#endif + break; + case OBJT_ANTIKAOS: + delete mm_reserve(sizeof(AntiKaos)); + obj = new AntiKaos(handle); + break; + default: error("loadgame","wrong Object type"); + } + objectslist.loadobj(obj,objtype); + } while (1); // attendo il + //CRC_read(handle,&Kaos_enable,sizeof(Kaos_enable)); + CRC_read(handle,&Kaos_count,sizeof(Kaos_count)); + //CRC_read(handle,&autocenter,sizeof(autocenter)); + CRC_close(handle); +#ifdef __DATAFILE__ + pre_loadtext(); +#endif + } else return 0; + return 1; +} + +char savegame(int game, char *name) { + if (game<0 || game>7) return 0; + int handle,i; + int plrids[3] = {-1,-1,-1}; + char s[16]; + sprintf(s,"KAOS%1d.GAM",game); + if ((handle = CRC_openwrite(s)) >= 0) { + drawdisk(); + + CRC_write(handle,(void *)&idGAM,8); + CRC_write(handle,name,32); + CRC_write(handle,&players,sizeof(players)); + for (i=0;igetid(); + else error("savegame","no Player"); + } + CRC_write(handle,&plrids,2+2+2); // PlayAr sync + CRC_write(handle,&gameflags,sizeof(gameflags)); + CRC_write(handle,levfile,8); + CRC_write(handle,&levnum,sizeof(levnum)); + CRC_write(handle,Map,8192); + CRC_write(handle,ObjMap,8192); + CRC_write(handle,IDMap,8192); + CRC_write(handle,LightMap,4096); + CRC_write(handle,floormap,4096); + //CRC_write(handle,ceilmap,4096); + doormanager.save(handle); + objectslist.save(handle); + //CRC_write(handle,&Kaos_enable,sizeof(Kaos_enable)); + CRC_write(handle,&Kaos_count,sizeof(Kaos_count)); + //CRC_write(handle,&autocenter,sizeof(autocenter)); + CRC_close(handle); + } else return 0; + return 1; +} + +// ---- Playback Management ---- +void end_playback() { + if (playbackhandle>=0) { + CRC_close(playbackhandle); + playbackhandle = -1; + } +} + +char play_playback(int num) { + char plrs; + + if (playbackhandle<0 && num>=0 && num=0) { + CRC_read(playbackhandle,s,8); + if (!fwcomp(s,(void *)&idDEM,8)) {end_playback(); return 0;} + CRC_read(playbackhandle,s,8); s[8]=0; + if (!strcmp(s,levfile)) { + CRC_read(playbackhandle,&plrs,sizeof(plrs)); + if (!initgame(plrs)) {end_playback(); return 0;} + CRC_read(playbackhandle,&levnum,sizeof(levnum)); + CRC_read(playbackhandle,&plrs,sizeof(plrs)); + MAKEFLAG(gameflags,GFL_COMPETITIVE,GETFLAG(plrs,GFL_COMPETITIVE)); + MAKEFLAG(gameflags,GFL_KAOSENABLE,GETFLAG(plrs,GFL_KAOSENABLE)); + MAKEFLAG(gameflags,GFL_AUTOCENTER,GETFLAG(plrs,GFL_AUTOCENTER)); + playbackwait = 0; // Start Playback + return 1; + } + } + } + end_playback(); + return 0; +} + +char record_playback(int num) { + if (playbackhandle<0 && num>=0 && num=0) { + CRC_write(playbackhandle,(void *)&idDEM,8); + CRC_write(playbackhandle,levfile,8); + CRC_write(playbackhandle,&players,sizeof(players)); + CRC_write(playbackhandle,&levnum,sizeof(levnum)); + CRC_write(playbackhandle,&gameflags,sizeof(gameflags)); + playbackwait = MAXPLAYBACKWAIT; + return 1; + } + } + return 0; +} +// ---- + +void allocfig(int fignum, int x, int y, int dx, int dy, int h) { + void far *data; + FigList[fignum].dx = dx; + FigList[fignum].dy = dy; + FigList[fignum].height = h; +#ifdef __DATAFILE__ + FigList[fignum].memidx = mm_alloc(dx*dy); +#else + if ((data = mm_recall(FigList[fignum].memidx = mm_alloc(dx*dy))) != NULL) + getrfig(x,y,dx,dy,data); + else error("allocfig",err_notenoughmemory); +#endif +} + +void init() { + //const char *str_fcorrupt = "init - file CORRUPT"; + int i,j; + long l; + char *text; + + for (i=0,j=0,text=NicFirm;i<18;i++) j+=*(text++); + if (j!=NicCheck) //error(str_fcorrupt); + error("init","file corrupt"); + for (i=0,j=0,text=MaxFirm;i<17;i++) j+=*(text++); + if (j!=MaxCheck) //error(str_fcorrupt); + error("init","file corrupt"); + for (i=0,j=0,text=AndFirm;i<17;i++) j+=*(text++); + if (j!=AndCheck) //error(str_fcorrupt); + error("init","file corrupt"); + for (j=0,text=KaosFirm;*text;) j+=*(text++); + if (j!=KaosCheck) //error(str_fcorrupt); + error("init","file corrupt"); + // {printf("%d ",j); abort();} + + initsounds(); + + randomize(); + printf("\n%s",KaosFirm); + word memo = (word)((unsigned long)coreleft()>>10); + printf("\n MemoryManager: base free = %5uKb\n", memo); + /* + memo, + memo<100 ? "Are you crazy ??!" : + memo<200 ? "Too little, stingy" : + memo<300 ? "Very well, but you can do better" : "Excellent !"); + */ + if (memo<75) { + printf("\n Not enough conventional memory, stingy man !"); + exit(EXIT_FAILURE); + } + memo = (word)(mm_memavail()>>10); + printf(" (v3.3) total free = %5uKb;\n",memo); + /* + memo, + memo<512 ? "You're really crazy." : + memo<1024 ? "It doesn't go well, but it'll work" : + memo<2048 ? "Quite well" : "Ooh !"); + */ + if (init_pause) { + //printf("\n 100%% ERRORS FREE !!! (It's impossible, am I crazy ?)\n"); + printf("\n < hit any key to start >"); + while (kbhit()) getch(); + getch(); + } + printf("\n WAIT PLEASE... "); + + int idx = 0; + for (i=0;i>2)*24,32,24,mm_recall(Sqrs[i].memidx)); +#endif + } + + LitBar.dx = 152; LitBar.dy = 20; + LitBar.memidx = mm_alloc(152*20); +#ifndef __DATAFILE__ + getlfig(166,74,152,20,mm_recall(LitBar.memidx)); +#endif + + for (i=0;i<10;i++) { + litnumf[i].dx = 3; litnumf[i].dy = 5; + litnumf[i].memidx = mm_alloc(15); +#ifndef __DATAFILE__ + getlfig(179+(i<<2),129,3,5,mm_recall(litnumf[i].memidx)); +#endif + } + for (i=2;i<10;i++) { + normnumf[i].dx = 7; normnumf[i].dy = 9; + normnumf[i].memidx = mm_alloc(63); +#ifndef __DATAFILE__ + getlfig(172+(i<<3),137,7,9,mm_recall(normnumf[i].memidx)); +#endif + } + normnumf[0].dx = 7; normnumf[0].dy = 9; + normnumf[0].memidx = mm_alloc(63); +#ifndef __DATAFILE__ + getlfig(188+(8<<3),137,7,9,mm_recall(normnumf[0].memidx)); +#endif + normnumf[1].dx = 4; normnumf[1].dy = 9; + normnumf[1].memidx = mm_alloc(36); +#ifndef __DATAFILE__ + getlfig(183,137,4,9,mm_recall(normnumf[1].memidx)); +#endif + for (i=0;i<10;i++) { + stdnumf[i].dx = 7; stdnumf[i].dy = 7; + stdnumf[i].memidx = mm_alloc(49); +#ifndef __DATAFILE__ + getlfig(176+(i<<3),149,7,7,mm_recall(stdnumf[i].memidx)); +#endif + } + for (i=0;i<17;i++) { + happyface[i].dx = 24; happyface[i].dy = 29; + happyface[i].memidx = mm_alloc(24*29); +#ifndef __DATAFILE__ + getlfig(1+(i%10)*25,97+(i/10)*30,24,29,mm_recall(happyface[i].memidx)); +#endif + } + woodblock = mm_alloc(219*20); + levelblock = mm_alloc(64*16); + matchblock = mm_alloc(64*16); +#ifndef __DATAFILE__ + getlfig(1,157,219,20,mm_recall(woodblock)); + getlfig(1,178,64,16,mm_recall(levelblock)); + getlfig(66,178,64,16,mm_recall(matchblock)); +#endif + +#ifndef __DATAFILE__ + loadLBM("lbm\\sold1.lbm",NULL); +#endif + allocfig(F_SOLDIER ,149,4,32,63,-40); + allocfig(F_SOLDIER+1 ,182,3,31,64,-40); + allocfig(F_SOLDIER+2 ,214,2,33,65,-40); + allocfig(F_SOLDIER+3 ,248,2,45,65,-40); + allocfig(F_SOLDIER+4 , 1,1,35,66,-40); + allocfig(F_SOLDIER+5 , 37,2,29,65,-40); + allocfig(F_SOLDIER+6 , 67,3,36,64,-40); + allocfig(F_SOLDIER+7 ,104,3,44,64,-40); + allocfig(F_SOLDIER+8 ,179,69,42,66,-40); + allocfig(F_SOLDIER+9 ,222,68,36,64,-40); + allocfig(F_SOLDIER+10,1,135,41,63,-40); + allocfig(F_SOLDIER+11,43,135,50,65,-40); + allocfig(F_SOLDIER+12,1,68,48,66,-40); + allocfig(F_SOLDIER+13,50,68,34,66,-40); + allocfig(F_SOLDIER+14,85,70,43,62,-40); + allocfig(F_SOLDIER+15,129,68,49,66,-40); +#ifndef __DATAFILE__ + loadLBM("lbm\\sold2.lbm",NULL); +#endif + allocfig(F_SOLDIER+16,155,1,33,66,-40); + allocfig(F_SOLDIER+17,189,1,32,66,-40); + allocfig(F_SOLDIER+18,222,1,57,65,-40); + allocfig(F_SOLDIER+19,1,67,35,64,-40); + allocfig(F_SOLDIER+20,1,1,32,65,-40); + allocfig(F_SOLDIER+21,34,1,29,65,-40); + allocfig(F_SOLDIER+22,64,1,53,65,-40); + allocfig(F_SOLDIER+23,118,1,36,65,-40); + + FigList[F_SOLDIER+24]=FigList[F_SOLDIER]; + allocfig(F_SOLDIER+25,37,67,34,66,-40); + FigList[F_SOLDIER+26]=FigList[F_SOLDIER]; + allocfig(F_SOLDIER+27,72,67,30,66,-40); + + FigList[F_SOLDIER+28]=FigList[F_SOLDIER]; + allocfig(F_SOLDIER+29,103,69,55,68,-40); + + allocfig(F_SOLDIER+30,159,69,55,68,-36); + allocfig(F_SOLDIER+31,215,69,68,56,-32); + allocfig(F_SOLDIER+32,1,138,58,28,-36); + allocfig(F_SOLDIER+33,60,142,58,24,-40); + allocfig(F_SOLDIER+34,119,145,58,21,-42); +#ifndef __DATAFILE__ + loadLBM("lbm\\balls.lbm",NULL); +#endif + //allocfig(F_FIREBALL,0,0,15,15,-7); // !!! + allocfig(F_BOOM , 0, 0,15,15,-7); + FigList[F_FIREBALL]=FigList[F_BOOM]; + allocfig(F_BOOM+ 1, 0, 64,21,18,-9); + allocfig(F_BOOM+ 2, 16, 0,37,33,-16); + allocfig(F_BOOM+ 3, 54, 0,50,42,-21); + allocfig(F_BOOM+ 4,105, 0,53,47,-23); + allocfig(F_BOOM+ 5, 22, 64,45,39,-19); + allocfig(F_BOOM+ 6,161, 2,12, 9,-4); + allocfig(F_BOOM+ 7,175, 0,37,31,-15); + allocfig(F_BOOM+ 8,213, 0,49,40,-20); + allocfig(F_BOOM+ 9, 50,120,12, 9, -4); + allocfig(F_BOOM+10, 63,120,37,31,-15); + allocfig(F_BOOM+11,101,120,49,40,-20); + FigList[F_SLIMFIRE]=FigList[F_BOOM+6]; + allocfig(F_SLIMFIRE+1,162,15,9,9,-4); + + allocfig(F_SPIDFIRE ,263,0,16,16,-8); + allocfig(F_SPIDFIRE+1,280,0,16,16,-8); + allocfig(F_SPIDFIRE+2,263,17,16,16,-8); + allocfig(F_SPIDFIRE+3,280,17,16,16,-8); + + allocfig(F_BLOOD ,132,101, 5, 4,-2); + allocfig(F_BLOOD+1,147, 99,11, 9,-5); + allocfig(F_BLOOD+2,168, 94,18,18,-9); + allocfig(F_BLOOD+3,159,129,31,27,-13); + allocfig(F_BLOOD+4,197,128,42,33,-17); + + // allocfig(FIG_BOOM+9,68,64,45,39,12); + // allocfig(FIG_BARILE+3,68,64,45,39,0); // !!! + + for (i=0;i<4;i++) corner[i] = mm_alloc(4*4); + for (i=4;i<8;i++) corner[i] = mm_alloc(24*4); +#ifndef __DATAFILE__ + getlfig(0,133,4,4,mm_recall(corner[0])); + getlfig(5,133,4,4,mm_recall(corner[1])); + getlfig(0,138,4,4,mm_recall(corner[2])); + getlfig(5,138,4,4,mm_recall(corner[3])); + getlfig(1,128,24,4,mm_recall(corner[4])); + getlfig(31,123,4,24,mm_recall(corner[5])); + getlfig(26,123,4,24,mm_recall(corner[6])); + getlfig(1,123,24,4,mm_recall(corner[7])); +#endif + + ArmFig[0].dx = 28; ArmFig[0].dy = 11; + ArmFig[1].dx = 20; ArmFig[1].dy = 12; + ArmFig[2].dx = 33; ArmFig[2].dy = 9; + ArmFig[3].dx = 29; ArmFig[3].dy = 12; + ArmFig[4].dx = 30; ArmFig[4].dy = 8; + ArmFig[5].dx = 9; ArmFig[5].dy = 12; + ArmFig[0].memidx = mm_alloc(28*11); + ArmFig[1].memidx = mm_alloc(20*12); + ArmFig[2].memidx = mm_alloc(33*9); + ArmFig[3].memidx = mm_alloc(29*12); + ArmFig[4].memidx = mm_alloc(30*8); + ArmFig[5].memidx = mm_alloc(9*12); +#ifndef __DATAFILE__ + getlfig(120,52,28,11,mm_recall(ArmFig[0].memidx)); + getlfig(120,64,20,12,mm_recall(ArmFig[1].memidx)); + getlfig(141,64,33, 9,mm_recall(ArmFig[2].memidx)); + getlfig(120,77,29,12,mm_recall(ArmFig[3].memidx)); + getlfig(150,77,30, 8,mm_recall(ArmFig[4].memidx)); + getlfig(149,51, 9,12,mm_recall(ArmFig[5].memidx)); +#endif + BigBar.dx = 320; + BigBar.dy = 32; + BigBar.memidx = mm_alloc(320*32); +#ifndef __DATAFILE__ + fcopyarea(168,0,32,mm_recall(BigBar.memidx)); +#endif + MNID_Nico = mm_alloc(68*32); + MNID_Maxy = mm_alloc(76*32); + MNID_Andy = mm_alloc(68*32); +#ifndef __DATAFILE__ + getlfig(250,54,68,32,mm_recall(MNID_Nico)); + getlfig(242,90,76,32,mm_recall(MNID_Maxy)); + getlfig(250,126,68,32,mm_recall(MNID_Andy)); +#endif + + for (i=0;i<3;i++) { + WorkID[i] = mm_alloc(16*16); +#ifndef __DATAFILE__ + getlfig(196+i*17,56,16,16,mm_recall(WorkID[i])); +#endif + } + KeyLeft = mm_alloc(14*14); + KeyRight = mm_alloc(14*14); +#ifndef __DATAFILE__ + getlfig(196,73,14,14,mm_recall(KeyLeft)); + getlfig(211,73,14,14,mm_recall(KeyRight)); +#endif + kidwarn = mm_alloc(32*28); +#ifndef __DATAFILE__ + getlfig(205,91,32,28,mm_recall(kidwarn)); +#endif + + cbacki[0][0] = mm_alloc(32000); + cbacki[0][1] = mm_alloc(32000); + PPal apppal = (PPal)mm_recall(origpal = mm_alloc(768)); +#ifndef __DATAFILE__ + loadLBM("lbm\\bck_c0.lbm",apppal); + fcopyarea(0,0,100,mm_recall(cbacki[0][1])); + fcopyarea(100,0,100,mm_recall(cbacki[0][0])); + fwfill(apppal,0,3); +#endif + fwmove(startpal,apppal,768); + fbacki[0][0] = mm_alloc(32000); + fbacki[0][1] = mm_alloc(32000); +#ifndef __DATAFILE__ + loadLBM("lbm\\bck_f0.lbm",NULL); + fcopyarea(0,0,100,mm_recall(fbacki[0][0])); + fcopyarea(100,0,100,mm_recall(fbacki[0][1])); +#endif + cbacki[1][0] = mm_alloc(32000); + cbacki[1][1] = mm_alloc(32000); +#ifndef __DATAFILE__ + loadLBM("lbm\\bck_c1.lbm",NULL); + fcopyarea(0,0,100,mm_recall(cbacki[1][1])); + fcopyarea(100,0,100,mm_recall(cbacki[1][0])); +#endif + fbacki[1][0] = mm_alloc(32000); + fbacki[1][1] = mm_alloc(32000); +#ifndef __DATAFILE__ + loadLBM("lbm\\bck_f1.lbm",NULL); + fcopyarea(0,0,100,mm_recall(fbacki[1][0])); + fcopyarea(100,0,100,mm_recall(fbacki[1][1])); +#endif + cbacki[2][0] = mm_alloc(32000); + cbacki[2][1] = mm_alloc(32000); +#ifndef __DATAFILE__ + loadLBM("lbm\\bck_c2.lbm",NULL); + fcopyarea(0,0,100,mm_recall(cbacki[2][1])); + fcopyarea(100,0,100,mm_recall(cbacki[2][0])); +#endif + fbacki[2][0] = mm_alloc(32000); + fbacki[2][1] = mm_alloc(32000); +#ifndef __DATAFILE__ + loadLBM("lbm\\bck_f2.lbm",NULL); + fcopyarea(0,0,100,mm_recall(fbacki[2][0])); + fcopyarea(100,0,100,mm_recall(fbacki[2][1])); +#endif + + + PlayerAscia[0] = mm_alloc(50*115); + PlayerAscia[1] = mm_alloc(85*150); + PlayerAscia[2] = mm_alloc(106*123); +#ifndef __DATAFILE__ + loadLBM("lbm\\Ascia.lbm",NULL); + getrfig(0,0,50,115,mm_recall(PlayerAscia[0])); + getrfig(51,0,85,150,mm_recall(PlayerAscia[1])); + getrfig(137,0,106,123,mm_recall(PlayerAscia[2])); +#endif + PlayerPist[0] = mm_alloc(55*61); + PlayerPist[1] = mm_alloc(55*67); + PlayerPist[2] = mm_alloc(42*39); + thunder = mm_alloc(80*128); +#ifndef __DATAFILE__ + loadLBM("lbm\\Mano.lbm",NULL); + getrfig(0,0,55,61,mm_recall(PlayerPist[0])); + getrfig(0,62,55,67,mm_recall(PlayerPist[1])); + getrfig(56,0,42,39,mm_recall(PlayerPist[2])); + getrfig(124,40,80,128,mm_recall(thunder)); +#endif + PlayerFuc[0] = mm_alloc(65*53); + PlayerFuc[1] = mm_alloc(99*108); + PlayerFuc[2] = mm_alloc(40*31); +#ifndef __DATAFILE__ + loadLBM("lbm\\Fucile.lbm",NULL); + getrfig(0,0,65,53,mm_recall(PlayerFuc[0])); + getrfig(0,54,99,108,mm_recall(PlayerFuc[1])); + getrfig(66,0,40,31,mm_recall(PlayerFuc[2])); +#endif + PlayerMitr[0] = mm_alloc(53*77); + PlayerMitr[1] = mm_alloc(53*31); + PlayerMitr[2] = mm_alloc(53*31); + PlayerMitr[3] = mm_alloc(53*31); + PlayerMitr[4] = mm_alloc(42*41); + PlayerBaz = mm_alloc(83*68); +#ifndef __DATAFILE__ + loadLBM("lbm\\Mitra.lbm",NULL); + getrfig(0,0,53,77,mm_recall(PlayerMitr[0])); + getrfig(169,0,53,31,mm_recall(PlayerMitr[1])); + getrfig(54,0,53,31,mm_recall(PlayerMitr[2])); + getrfig(112,0,53,31,mm_recall(PlayerMitr[3])); + getrfig(223,0,42,41,mm_recall(PlayerMitr[4])); + getrfig(0,88,83,68,mm_recall(PlayerBaz)); +#endif +#ifndef __DATAFILE__ + loadsound(SND_THUNDER1, "wav\\thunder.wav"); + loadsound(SND_THUNDER2, "wav\\tuono.wav"); + loadsound(SND_GOCCIA, "wav\\goccia.wav"); + loadsound(SND_BOOM, "wav\\esplos.wav"); + loadsound(SND_BUB, "wav\\bub3.wav"); + loadsound(SND_TOPO, "wav\\topo.wav"); + loadsound(SND_KEYS, "wav\\keys.wav"); + loadsound(SND_PISTOLA, "wav\\fucil2.wav"); + loadsound(SND_FUCILE, "wav\\fucil1.wav"); + loadsound(SND_MITRA, "wav\\pist1.wav"); + loadsound(SND_MISSILE, "wav\\missile.wav"); + loadsound(SND_SLIME1, "wav\\slime01.wav"); + loadsound(SND_SLIME2, "wav\\slime02.wav"); + loadsound(SND_PASSO, "wav\\passo.wav"); + loadsound(SND_PORTA1, "wav\\porta2.wav"); + loadsound(SND_PORTA2, "wav\\porta1.wav"); + loadsound(SND_SCODE, "wav\\beam.wav"); + loadsound(SND_PROIETTILE,"wav\\proiett.wav"); + loadsound(SND_VASO1, "wav\\vaso1.wav"); + loadsound(SND_VASO2, "wav\\vaso2.wav"); + loadsound(SND_COLPO1, "wav\\colpo1.wav"); + loadsound(SND_COLPO2, "wav\\colpo3.wav"); + loadsound(SND_TOGGLE, "wav\\fineliv.wav"); + loadsound(SND_WIND, "wav\\wind.wav"); + loadsound(SND_FIRE, "wav\\fire.wav"); + loadsound(SND_MISSILGO, "wav\\missile2.wav"); + loadsound(SND_UNLOCK, "wav\\unlock.wav"); + loadsound(SND_CLOSE, "wav\\close.wav"); + loadsound(SND_GLASS, "wav\\glass.wav"); + loadsound(SND_PASSO2, "wav\\passo2.wav"); + loadsound(SND_SOLDDEAD, "wav\\solddead.wav"); + loadsound(SND_SLIMDEAD, "wav\\slimdead.wav"); + loadsound(SND_SPIDDEAD, "wav\\spiddead.wav"); + loadsound(SND_SOLDATT, "wav\\soldatt.wav"); + loadsound(SND_SLIMATT, "wav\\slimatt.wav"); + loadsound(SND_SPIDATT, "wav\\spidatt.wav"); + loadsound(SND_CLOCK, "wav\\clock.wav"); + loadsound(SND_CLOCK2, "wav\\clock2.wav"); + loadsound(SND_SPIDNEAR, "wav\\spidnear.wav"); + loadsound(SND_CHARGE, "wav\\charge.wav"); + loadsound(SND_CHARGE2, "wav\\charge2.wav"); + loadsound(SND_SOLDDOWN, "wav\\solddown.wav"); + loadsound(SND_SLIMDOWN, "wav\\slimdown.wav"); + loadsound(SND_SPIDDOWN, "wav\\spiddown.wav"); + loadsound(SND_OSSA, "wav\\ossa.wav"); + loadsound(SND_VENOM, "wav\\venom.wav"); + loadsound(SND_RISATA, "wav\\risata.wav"); + loadsound(SND_BONUS, "wav\\bonus.wav"); + loadsound(SND_ASCIAHIT, "wav\\asciahit.wav"); + loadsound(SND_SOLDHIT, "wav\\soldhit.wav"); + loadsound(SND_SLIMHIT, "wav\\slimhit.wav"); + loadsound(SND_SPIDHIT, "wav\\spidhit.wav"); + loadsound(SND_BBOUNCE, "wav\\bbounce.wav"); +#else + loadsound(SND_THUNDER1, NULL); + loadsound(SND_THUNDER2, NULL); + loadsound(SND_GOCCIA, NULL); + loadsound(SND_BOOM, NULL); + loadsound(SND_BUB, NULL); + loadsound(SND_TOPO, NULL); + loadsound(SND_KEYS, NULL); + loadsound(SND_PISTOLA, NULL); + loadsound(SND_FUCILE, NULL); + loadsound(SND_MITRA, NULL); + loadsound(SND_MISSILE, NULL); + loadsound(SND_SLIME1, NULL); + loadsound(SND_SLIME2, NULL); + loadsound(SND_PASSO, NULL); + loadsound(SND_PORTA1, NULL); + loadsound(SND_PORTA2, NULL); + loadsound(SND_SCODE, NULL); + loadsound(SND_PROIETTILE,NULL); + loadsound(SND_VASO1, NULL); + loadsound(SND_VASO2, NULL); + loadsound(SND_COLPO1, NULL); + loadsound(SND_COLPO2, NULL); + loadsound(SND_TOGGLE, NULL); + loadsound(SND_WIND, NULL); + loadsound(SND_FIRE, NULL); + loadsound(SND_MISSILGO, NULL); + loadsound(SND_UNLOCK, NULL); + loadsound(SND_CLOSE, NULL); + loadsound(SND_GLASS, NULL); + loadsound(SND_PASSO2, NULL); + loadsound(SND_SOLDDEAD, NULL); + loadsound(SND_SLIMDEAD, NULL); + loadsound(SND_SPIDDEAD, NULL); + loadsound(SND_SOLDATT, NULL); + loadsound(SND_SLIMATT, NULL); + loadsound(SND_SPIDATT, NULL); + loadsound(SND_CLOCK, NULL); + loadsound(SND_CLOCK2, NULL); + loadsound(SND_SPIDNEAR, NULL); + loadsound(SND_CHARGE, NULL); + loadsound(SND_CHARGE2, NULL); + loadsound(SND_SOLDDOWN, NULL); + loadsound(SND_SLIMDOWN, NULL); + loadsound(SND_SPIDDOWN, NULL); + loadsound(SND_OSSA, NULL); + loadsound(SND_VENOM, NULL); + loadsound(SND_RISATA, NULL); + loadsound(SND_BONUS, NULL); + loadsound(SND_ASCIAHIT, NULL); + loadsound(SND_SOLDHIT, NULL); + loadsound(SND_SLIMHIT, NULL); + loadsound(SND_SPIDHIT, NULL); + loadsound(SND_BBOUNCE, NULL); +#endif +} + +// Timer Sync funcs +void interrupt (*oldisr)(...); +void interrupt newisr(...) { + if (Sync<8) Sync++; + if (slowmode || (SyncTrig = !SyncTrig) != 0) oldisr(); + else outportb(0x20,0x20); +} +void instSync(void) { + if (!SyncOk) { + oldisr = getvect(0x08); + disable(); + if (!slowmode) { + outp(0x43,0x34); // Ctrl 2, mode 2, LSB+MSB + outp(0x40,0x00); // LSB + outp(0x40,0x80); // MSB Clock a 36,412 Hz + } + setvect(0x08,newisr); + enable(); + SyncOk = 1; + } +} +void uninstSync(void) { + if (SyncOk) { + disable(); + outp(0x43,0x34); // Ctrl 2, mode 2, LSB+MSB + outp(0x40,0); // LSB + outp(0x40,0); // MSB Clock a 18,2... Hz + setvect(0x08,oldisr); + enable(); + SyncOk = 0; + } +} +#pragma exit uninstSync 91 + +/* + per usare una cheat, devi scriverla e poi + premere il tasto d'attivazione (F4) ! + es.: "M"+"N"+"N"+"I"+"C"+"O"+F4 + + Se sono codificate il motivo c'č ! +*/ + +char *CodeMNNico = "MOPLGT", + *CodeMNMaxy = "MOOD\\^", + *CodeMNAndy = "MOCQH^", + *CodeMNLev = "MONHZ", + *CodeMNStrg = "MOUWVL", + *CodeMNTMap = "MOVPEU", + *CodeMNBest = "MODHWY", + *CodeMNDark = "MOFDVP", + *CodeMNBoom = "MODRSR", + *CodeMNBGod = "MODJSI", + *CodeMNHard = "MOJDVI", + *CodeMNCapt = "MOEDTY", // !!! + *CodeMNInvi = "MOKQZN"; + +int Sqr_count = 0, Sqr_focus = 0, Sqr_ratio = 0; +void FocusSqr(int type, int time) { + if (Sqr_count>=18) return; + Sqr_focus = type; + Sqr_count = time; + Sqr_ratio = 1; + //TFig &Sqrf = Sqrs[Sqr_focus]; + //storelfig(8,8,Sqrf.dy,Sqrf.dy,mm_recall(Sqrf.memidx)); +} + +void checkword() { + int codenum; + // Cannot handle a CHEAT in saveplayback mode ! + if (saveplayback && playbackwait) return; + + if (fwcomp(CodeAr,CodeMNNico,6)) codenum=SC_MNNico; else + if (fwcomp(CodeAr,CodeMNMaxy,6)) codenum=SC_MNMaxy; else + if (fwcomp(CodeAr,CodeMNAndy,6)) codenum=SC_MNAndy; else + if (fwcomp(CodeAr,CodeMNLev ,5)) codenum=SC_MNLev ; else + if (fwcomp(CodeAr,CodeMNStrg,6)) codenum=SC_MNStrg; else + if (fwcomp(CodeAr,CodeMNTMap,5)) codenum=SC_MNTMap; else + if (fwcomp(CodeAr,CodeMNBest,6)) codenum=SC_MNBest; else + if (fwcomp(CodeAr,CodeMNDark,6)) codenum=SC_MNDark; else + if (fwcomp(CodeAr,CodeMNBoom,6)) codenum=SC_MNBoom; else + if (fwcomp(CodeAr,CodeMNBGod,6) && players<2) codenum=SC_MNBGod; else + if (fwcomp(CodeAr,CodeMNHard,6) && players<2) codenum=SC_MNHard; else + if (fwcomp(CodeAr,CodeMNCapt,6)) codenum=0xff; else // !!! + if (fwcomp(CodeAr,CodeMNInvi,6)) codenum=SC_MNInvi; else + return; + CodeAr[0] = 0; // Resets the cheat + eventmanager.sendcom(EV_SCODE,codenum); + switch(codenum) { + case 0xff: return; + case SC_MNBGod: codenum=SC_MNLev; break; + case SC_MNHard: codenum=SC_MNMaxy; break; + case SC_MNInvi: codenum=SC_MNLev; break; + } + FocusSqr(codenum,72); + playsound(SND_SCODE,0,0,0,SYSOWN,SFL_FIXED); + playsound(SND_RISATA,SM_NORMVOL,SM_NORMVOL,127,SYSOWN,SFL_FIXED); +} + +void animpal(byte animnum,int rep) { + if (players>1) + if (animnum!=PAA_LIGHT && animnum!=PAA_FADEIN && + animnum!=PAA_FADEOUT) return; + if (!palanimstate) fwmove(endpal,startpal,768); + palanimstate = 1; + do + switch (animnum) { + case PAA_RED: palfilter(endpal,48,0,0); break; + case PAA_GREEN: palfilter(endpal,0,48,0); break; + case PAA_GOLD: palfilter(endpal,40,40,0); break; + case PAA_ARM: palfilter(endpal,48,0,48); break; + case PAA_YKEY: palfilter(endpal,32,63,0); break; + case PAA_RKEY: palfilter(endpal,63,32,0); break; + case PAA_LIGHT: + //palfilter(endpal,63,58,56); + asm { // Intensity filter ! + LES DI, endpal + LDS SI, endpal + MOV CX, 256 + CLD + } c1: asm { + XOR DX, DX + XOR AH, AH + MOV AL, [SI] + ADD DX, AX + MOV AL, [SI+1] + ADD DX, AX + MOV AL, [SI+2] + ADD DX, AX + LODSB + MOV AH, [SI] + INC SI + MOV BL, [SI] + INC SI + CMP DX, 40 + JLE dark + ADD AL, 63 + ADD AH, 58 + ADD BL, 57 + } dark: asm { + SHR AL, 1 + SHR AH, 1 + SHR BL, 1 + STOSB + MOV ES:[DI], AH + INC DI + MOV ES:[DI], BL + INC DI + LOOP c1 + // !!! SS==DS !!! + MOV AX, SS + MOV DS, AX + } + palanimcount=16; + break; + case PAA_GOD: /*palfilter(startpal,58,50,0); + palfilter(endpal,63,63,0); + palfilter(endpal,63,63,0);*/ + //palfilter(startpal,58,50,0); + *(startpal)=58; + *(startpal+1)=50; + palanimstate=2; + break; + case PAA_UNGOD: //fwmove(endpal,startpal,768); + //fwmove(startpal,mm_recall(origpal),768); + fwmove(startpal,gammapal,2); + palanimstate=2; + break; + case PAA_HARD: *(startpal)=58; + //*(startpal)=50; + palanimstate=2; + break; + case PAA_UNHARD:fwmove(startpal,gammapal,2); + palanimstate=2; + break; + case PAA_FADEIN: fwfill(endpal,0,768); + fwmove(startpal,gammapal,768); + palanimstate=2; + break; + case PAA_FADEOUT: fwfill(startpal,0,768); + fwmove(endpal,gammapal,768); + palanimstate=2; + break; + } + while (rep--); +} + +void pal_animate(char change) { + switch (palanimstate) { + case 0: return; + case 1: + if ((palanimcount+=4) > 16) { + palanimcount=0; + palanimstate=2; + setpal(endpal,0,256); // sicurezza ? !!! + } else if (change) + palmorphpart(startpal,endpal,0,256,palanimcount,16); + break; + case 2: + if (++palanimcount > 16) { + palanimcount=0; + palanimstate=0; + setpal(startpal,0,256); + } else if (change) + palmorphpart(endpal,startpal,0,256,palanimcount,16); + break; + } +} + +void intro() { + char *p[4]; + int i,j; + /* + p[0]=(char *)VMEMPTR;//(char *)mm_reserve(27*33); + p[1]=(char *)VMEMPTR;//(char *)mm_reserve(24*37); + p[2]=(char *)VMEMPTR;//(char *)mm_reserve(25*33); + p[3]=(char *)VMEMPTR;//(char *)mm_reserve(22*33); + */ + int x[4],y[4], + snd[4] = {-1,-1,-1,-1}, + sd[4] = {-3,-1,1,3}, + dx[4] = {0,0,0,0}, + dy[4] = {0,0,0,0}, + ex[4] = {115-2,140-2,163-2,185-2}; + int rdx[4] = {27,24,25,22}, + rdy[4] = {33,37,33,33}; + int kk; + for (i=0;i<4;i++) + dragon2[i] = mm_alloc(16000); +#ifndef __DATAFILE__ + loadLBM("lbm\\dragon2.lbm",NULL); + for (i=0;i<4;i++) + fcopyarea(i*50,0,50,mm_recall(dragon2[i])); +#endif + for (i=0;i<4;i++) { + dragon1[i] = mm_alloc(16000); + p[i]=(char *)mm_reserve(rdx[i]*rdy[i]); + } +#ifndef __DATAFILE__ + loadLBM("lbm\\dragon1.lbm",NULL); + for (i=0;i<4;i++) fcopyarea(i*50,0,50,mm_recall(dragon1[i])); +#endif + drawpict(dragon1,vpage); + fadeout((PPal)mm_recall(origpal),0,256,1); + ftransfscreen(VMEMPTR); + while(kbhit()) getch(); + ftransfblock(64,24,196,28,VMEMPTR); + Big->colorwrite(50,24,32,"The Millennium Group"); + ftransfblock(50,24,240,28,VMEMPTR); + fadein((PPal)mm_recall(origpal),0,256,80); + //for(i=50;i-- && !kbhit();){waitvsync();} + //playsound(SND_BOOM,16,16,0,SFL_FIXED); + for(i=20;i-- && !kbhit();){waitvsync();/*soundmanager(0,0,0);*/} + if (!kbhit()) animpal(PAA_LIGHT,2); + Big->colorwrite(50,24,50,"The Millennium Group"); + ftransfblock(50,24,240,28,VMEMPTR); + //playsound(SND_THUNDER1,20,20,0,SFL_FIXED); + play3Dsound(48l<colorwrite(116,50,96,"presents"); + ftransfblock(108,50,128,28,VMEMPTR); + //playsound(SND_BOOM,8,8,0,SFL_FIXED); + for(i=100;i-- && !kbhit();) { + waitvsync(); + soundmanager(0,0,ang=angleadd(ang,ANGLVL)); + } + //setvbuff(VMEMPTR); + setvrect(0,0,320,200); + for(i=0;i<=64+16*3;i++) { + waitvsync(); + soundmanager(0,0,ang=angleadd(ang,ANGLVL)); + for(j=0;j<4;j++) { + if (dx[j]>0 && dy[j]>0) + storelfig(x[j],y[j],dx[j],dy[j],p[j]); + kk=i-(j<<4); + if (!kk) { + snd[j] = playsound(SND_MISSILGO,SM_NORMVOL-(j<<1),SM_NORMVOL-6+(j<<1), + sd[j],SYSOWN,SFL_FIXED|SFL_CONTINUE); + if (j==3) ftransfblock(4,170,32,28,VMEMPTR); // delete kidwarn + } else + if (kk==58) { + if (snd[j]>=0) { + stopsound(snd[j]); + snd[j]=-1; + } + playsound(SND_BOOM,SM_NORMVOL-(j<<1),SM_NORMVOL-6+(j<<1),sd[j],SYSOWN,SFL_FIXED); + } + if (kk<=0) { + //dx[j]=0;dy[j]=0; + continue; + } else if (kk>64) kk=64; + x[j] = 160+(int)(((long)ex[j]-160l)*kk>>6); + y[j] = 10+(int)((86l-10l)*kk>>6); + dx[j] = rdx[j]*kk>>6; + dy[j] = rdy[j]*kk>>6; + + if (dx[j]>0 && dy[j]>0) + getlfig(x[j],y[j],dx[j],dy[j],p[j]); + + } + for (j=4;j--;) + if (dx[j]>0 && dy[j]>0) + scalerscfig(x[j],y[j],rdx[j],rdy[j],dx[j],dy[j],0,mm_recall(KAOSMark[j])); + Big->colorwrite(50,24,50,"The Millennium Group"); + for (j=4;j--;) + if (dx[j]>0 && dy[j]>0) + ftransfblock(x[j]-8,y[j]-8,dx[j]+16,dy[j]+16,VMEMPTR); + //ftransfblock(72,24,196,22,VMEMPTR); + } + //setvbuff(vpage); + for (i=0;i<4;i++) { + delete p[i]; + if (snd[i]>=0) stopsound(snd[i]); + } + setvbuff(VMEMPTR); + Std->write(74,124,229,233,KaosFirm); + Std->write(80,140,128,132,NicMark); + char *s = (char *)mm_reserve(80); + sprintf(s,"Graphic Art and Sounds by %s",MaxFirm); + //strcpy(s,"Graphic Art and Sounds by "); + //strcat(s,MaxFirm); + Std->write(80,148,128,132,s); + sprintf(s,"Manual Design by %s",AndFirm); + //strcpy(s,"Additional Art by "); + //strcat(s,AndFirm); + Std->write(80,156,128,132,s); + /* + word memo1 = (word)((unsigned long)coreleft()>>10), + memo2 = (word)(mm_memavail()>>10); + sprintf(s,"Allocated Memory: %5uKb Conventional: %5uKb",memo2,memo1); + Std->write(40,8,1,4,s); + */ + if (sb_type>=SBT_SBPRO) + Std->write(32,180,3,1,"Enhanced 3D Sound System"); + else + Std->write(32,180,116,114,"Enhanced 3D Sound System"); + Std->write(32,190,3,1,"Light & shade managing"); + Std->write(160,180,3,1,"Several enemies with own AI"); +#ifndef __SHAREWARE__ + Std->write(160,190,3,1,"Multiplayer game capabilities"); + sprintf(s,"Serial #%08lX",SerialNo); + Std->write(120,2,230,234,s); +#else + Std->write(160,190,116,114,"Multiplayer game capabilities"); +#endif + delete s; + setvbuff(vpage); + while(kbhit()) getch(); + while (sm_soundnum) {waitvsync();soundmanager(0,0,0);} + /* + Flashes the KAOS + + kk = 0; // no wait + while(!kbhit()) { + if (!kk--) { + kk = 100; + x[0] = 115 + random(70); + y[0] = + } + waitvsync(); + } + */ + for(i=800;i-- && !kbhit();) waitvsync(); + //if (kbhit()) getch(); + fadeout((PPal)mm_recall(origpal),0,256,20); + castlepal = mm_alloc(768); + for (i=0;i<4;i++) castle[i] = mm_alloc(16000); +#ifndef __DATAFILE__ + loadLBM("lbm\\pres.lbm",mm_recall(castlepal)); + for (i=0;i<4;i++) fcopyarea(i*50,0,50,mm_recall(castle[i])); +#endif + drawpict(castle,vpage); + ftransfscreen(VMEMPTR); + fadein((PPal)mm_recall(castlepal),0,256,40); + if (kbhit()) getch(); + for (i=500;i-- && !kbhit();) waitvsync(); + while(kbhit()) getch(); + fadeout((PPal)mm_recall(castlepal),0,256,20); + mm_unload(castlepal); + for(i=0;i<4;i++) mm_unload(castle[i]); +} + +const char *(menutext[15]) = { + "New game","Load game","Save game","Options","Info!","Demo","Quit", + "Single Player","Two Players","Three Players", + "Ordering!","Help!","Millennium Group","Greetings","Quotes" +}; + +// Funzione aggiunta... +void darkscreen(char shade) { +asm { + LES DI, vpage + LDS SI, vpage + MOV CX, 64000 +} c1: asm { + LODSB + + // My shader + MOV AH, AL + ADD AL, shade + XOR AH, AL + AND AH, 0xf0 //HISHMASK + JZ store + XOR AH, AL + OR AL, 0x0f //LOSHMASK + +} store: asm { + STOSB + LOOP c1 + // SS==DS !!! + MOV AX, SS + MOV DS, AX +} } + +char *menufnm[6]; + +char input(int x, int y, char *str) { + char app[34]; + char nome[33] = ""; + byte c, len; + int anim = 20; + + kb_enablestd(); + len = strlen(strcpy(nome,str)); + while (1) { + if (++anim>40) anim=0; + storelfig(x,y,219,20,mm_recall(woodblock)); + strcpy(app,nome); + if (anim>20) strcat(app,"_"); + Std->write(x+8,y+8,112,116,app); + waitvsync(); + ftransfblock(x,y,219,20,VMEMPTR); + if (kbhit()) + switch (c = getch()) { + case 27: + kb_disablestd(); + return 0; + case 13: + kb_disablestd(); + fwmove(str,nome,len+1); + return 1; + case 8: if (len) nome[--len]=0; break; + default: + if (c>=' ' && c<=(byte)'—') { + if (len<32) { + nome[len++]=c; + nome[len]=0; + } + } + break; + } + } +} + +void handlemenu() { + int i, j, col; + char *s; + switch (menustate) { + case 0: // Pre-Main_Menu + if (kb_onepressed(KB_ESC) && (!ValidGame || !playbackwait || !saveplayback)) { + menustate=1; + menuitem=0; + //viewstate = random(3); + viewstate = playbackwait ? 1 : 0; + kb_onepressed(KB_UP); + kb_onepressed(KB_DOWN); + kb_onepressed(KB_LEFT); + kb_onepressed(KB_RIGHT); + kb_onepressed(KB_ENTER); + /* + if (windsound != -1) { + stopsound(windsound); + windsound=-1; + } + */ + stopallsounds(); + windsound=-1; + playsound(SND_MITRA,SM_NORMVOL,SM_NORMVOL,0,SYSOWN,SFL_FIXED); + } + break; + case 1: // Main_Menu + kb_onepressed(KB_LEFT); + kb_onepressed(KB_RIGHT); + Big->colorwrite(99,3,48,"Main Menu"); + Big->colorwrite(100,4,50,"Main Menu"); + for (i=0;i<7;i++) { + if (i==2) + if (ValidGame && players && playbackwait) + if (i==menuitem) col=50; else col=2; //96; + else + if (i==menuitem) col=54; else col=6; //96; + else + if (i==5) + if (ValidGame && playbackwait) + if (i==menuitem) col=50; else col=2; + else + if (i==menuitem) col=54; else col=6; + else + if (i==menuitem) col=50; else col=2; //96; + Big->colorwrite(100,32+i*22,col,menutext[i]); + } + if (kb_onepressed(KB_UP)) { + if (menuitem) menuitem--; else menuitem=6; + playsound(SND_UNLOCK,SM_NORMVOL,SM_NORMVOL,-127,SYSOWN,SFL_FIXED); + } else + if (kb_onepressed(KB_DOWN)) { + if (menuitem<6) menuitem++; else menuitem=0; + playsound(SND_UNLOCK,SM_NORMVOL,SM_NORMVOL,+127,SYSOWN,SFL_FIXED); + } else + if (kb_onepressed(KB_ENTER)) { + if (menuitem==2 && + (!ValidGame || !players || !playbackwait)) { + playsound(SND_ASCIAHIT,SM_NORMVOL,SM_NORMVOL,0,SYSOWN,SFL_FIXED); + } else + if (menuitem==5) { + if (ValidGame && playbackwait) { + action=199; // End of Cur Game + menustate=100; + //menuitem=0; + } + } else + if (menuitem==6) action=200; // EXIT GAME (OkExit++;) !!! + else { + playsound(SND_MITRA,SM_NORMVOL,SM_NORMVOL,0,SYSOWN,SFL_FIXED); + menustate=menuitem+2; + menuitem=0; + } + } else + if (kb_onepressed(KB_ESC) /*&& ValidGame*/) { + playsound(SND_MITRA,SM_NORMVOL,SM_NORMVOL,127,SYSOWN,SFL_FIXED); + menustate=100; + } + break; + case 2: // New Game + Big->colorwrite(59,3,48,"Start a new game"); + Big->colorwrite(60,4,50,"Start a new game"); + for (i=0;i<3;i++) { +#ifdef __SHAREWARE__ + if (i>0) if (i==menuitem) col=54; else col=6; //96; + else if (i==menuitem) col=50; else col=2; //96; +#else + if (i==menuitem) col=50; else col=2; //96; +#endif + Big->colorwrite(80,32+i*22,col,menutext[i+7]); + } +#ifndef __SHAREWARE__ + if (menuitem==3) col=50; else col=2; +#else + if (menuitem==3) col=54; else col=6; +#endif + Big->colorwrite(80,32+74,col,"From:"); + if (menuitem>0) { + if (initlev<0) { + storelfig(150,32+78,64,16,mm_recall(matchblock)); + col = -initlev; + } else { + storelfig(150,32+78,64,16,mm_recall(levelblock)); + col = initlev+1; + } + drawnum(150+60,32+78+4,0,0,stdnumf,col); + } else { + storelfig(150,32+78,64,16,mm_recall(levelblock)); + if (initlev>=0) col = initlev+1; + else col = -initlev; + drawnum(150+60,32+78+4,0,0,stdnumf,col); + } + if (kb_onepressed(KB_UP)) { + if (menuitem) menuitem--; else menuitem=3; + playsound(SND_UNLOCK,SM_NORMVOL,SM_NORMVOL,-127,SYSOWN,SFL_FIXED); + } else + if (kb_onepressed(KB_DOWN)) { + if (menuitem<3) menuitem++; else menuitem=0; + playsound(SND_UNLOCK,SM_NORMVOL,SM_NORMVOL,127,SYSOWN,SFL_FIXED); + } else +#ifndef __SHAREWARE__ + if (kb_onepressed(KB_LEFT) && (menuitem==3)) { + if (--initlev<-16) initlev=12; + playsound(SND_ASCIAHIT,SM_NORMVOL,SM_LOWVOL,0,SYSOWN,SFL_FIXED); + } else + if (kb_onepressed(KB_RIGHT) && (menuitem==3)) { + if (++initlev>12) initlev=-16; + playsound(SND_ASCIAHIT,SM_LOWVOL,SM_NORMVOL,0,SYSOWN,SFL_FIXED); + } else +#endif + if (kb_onepressed(KB_ENTER)) { + //playsound(SND_KEYS,SM_NORMVOL,SM_NORMVOL,-127,SFL_FIXED); + switch(menuitem) { + case 0: // New Single-Player Game + menustate=100; + end_playback(); + delgame(); + if (initlev >= 0) levnum = initlev; + else levnum = -initlev-1; + CLRFLAG(gameflags,GFL_COMPETITIVE); + initgame(1); + if (saveplayback) + if (!record_playback(saveplayback-1)) { + menustate=2; + break; + } + playbackwait=MAXPLAYBACKWAIT; + viewstate=2; + action=101; + break; +#ifndef __SHAREWARE__ + case 1: // New Multi-Players Game + case 2: + menustate=100; + end_playback(); + delgame(); + if (initlev >= 0) { + levnum = initlev; + CLRFLAG(gameflags,GFL_COMPETITIVE); + } else { + levnum = -initlev-1; + SETFLAG(gameflags,GFL_COMPETITIVE); + } + initgame(menuitem+1); + if (saveplayback) + if (!record_playback(saveplayback-1)) { + menustate=2; + break; + } + playbackwait=MAXPLAYBACKWAIT; + viewstate=2; + action=101; + break; + case 3: + if (++initlev>12) initlev=-16; + playsound(SND_ASCIAHIT,SM_NORMVOL,SM_NORMVOL,0,SYSOWN,SFL_FIXED); + break; +#endif + } + if (action==101) { + CLRFLAG(gameflags,GFL_TOTALMAP); + MAKEFLAG(gameflags,GFL_AUTOCENTER,s_autocenter); + MAKEFLAG(gameflags,GFL_KAOSENABLE,s_Kaos_enable); + } + } else + if (kb_onepressed(KB_ESC)) { + playsound(SND_MITRA,SM_NORMVOL,SM_NORMVOL,127,SYSOWN,SFL_FIXED); + menustate=1; + menuitem=0; + } + break; + case 3: // Load Game + case 4: // Save Game + // load .GAM file names + int handle; + char name[16]; + for (i=0;i<6;i++) { + sprintf(name,"KAOS%1d.GAM",i); + if ((handle = CRC_openread(name))>=0) { + /* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + _read(handle,&s[i],8); + _read(handle,&s[i],32); + */ + menufnm[i] = (char *)mm_reserve(33); + //sprintf(menufnm[i],"Savegame #%1d",i+1); + //_read(handle,&menufnm[i],8); + CRC_lseek(handle,8,SEEK_CUR); + CRC_read(handle,menufnm[i],32); *(menufnm[i]+32)=0; + CRC_close(handle); + } else menufnm[i]=NULL; + } + if (menustate==3) Big->colorwrite(110,4,54,menutext[1]/*"Load Game"*/); + else Big->colorwrite(110,4,54,menutext[2]/*"Save Game"*/); + // proceed + menustate+=7; // -> 10 load, 11 save + menuitem=0; + break; + case 5: // Options + Big->colorwrite(109,3,48,menutext[3]/*"Options"*/); + Big->colorwrite(110,4,50,menutext[3]/*"Options"*/); + if (sm_soundok) + if (menuitem==0) col=50; else col=2; + else + if (menuitem==0) col=54; else col=6; + Big->colorwrite(40,32,col,"FX Volume"); + putlfig(190,32+6,67,12,mm_recall(volume_bar)); + putlfig(190+((sm_soundvol<<6)/SM_MAXVOL),32+7, + 7,10,mm_recall(volume_sel)); + /* + putlfig(190+((SBdefault[MIXER_VOICE] & 0xf0)>>2),32+7, + 7,10,mm_recall(volume_sel)); + */ + if (sm_soundok) + if (menuitem==1) col=50; else col=2; + else + if (menuitem==1) col=54; else col=6; + Big->colorwrite(40,32+22,col,"Music Volume"); + putlfig(190,32+22+6,67,12,mm_recall(volume_bar)); + putlfig(190+((SBdefault[MIXER_MIDI] & 0xf0)>>2),32+22+7, + 7,10,mm_recall(volume_sel)); + if (menuitem==2) col=50; else col=2; + Big->colorwrite(40,32+44,col,"Screen Size"); + putlfig(190,32+44+6,67,12,mm_recall(volume_bar)); + putlfig(190+(60*(viewdim[players-1]-96)/224),32+44+7, + 7,10,mm_recall(volume_sel)); + if (menuitem==3) col=50; else col=2; + Big->colorwrite(40,32+66,col,"Brightness"); + putlfig(190,32+66+6,67,12,mm_recall(volume_bar)); + putlfig(190+60*(gamma-MINGAMMA)/(MAXGAMMA-MINGAMMA),32+66+7, + 7,10,mm_recall(volume_sel)); + if (sm_soundok) + if (menuitem==4) col=130; else col=82; + else + if (menuitem==4) col=134; else col=86; + Std->write(56,32+90,col,col+4,"Reverse L/R"); + if (sm_lrinverted) i=toggle_on; else i=toggle_off; + storelfig(40,32+88,12,12,mm_recall(i)); + /* + if (menuitem==4) col=130; else col=82; + Std->write(56,32+82,col,col+4,"Messages"); + if (messages) i=toggle_on; else i=toggle_off; + storelfig(40,32+80,12,12,mm_recall(i)); + */ + if (menuitem==5) col=130; else col=82; + Std->write(56,32+104,col,col+4,"Video sync."); + if (GETFLAG(gameflags,GFL_USESYNC)) i=toggle_on; else i=toggle_off; + storelfig(40,32+102,12,12,mm_recall(i)); + if (menuitem==6) col=130; else col=82; + Std->write(56,32+118,col,col+4,"Blood"); + if (GETFLAG(gameflags,GFL_SHOWBLOOD)) i=toggle_on; else i=toggle_off; + storelfig(40,32+116,12,12,mm_recall(i)); + if (menuitem==7) col=130; else col=82; + Std->write(96+56,32+90,col,col+4,"Messages"); + if (GETFLAG(gameflags,GFL_MESSAGES)) i=toggle_on; else i=toggle_off; + storelfig(96+40,32+88,12,12,mm_recall(i)); + if (menuitem==8) col=130; else col=82; + Std->write(96+56,32+104,col,col+4,"Kaos-mode"); + if (s_Kaos_enable) i=toggle_on; else i=toggle_off; + storelfig(96+40,32+102,12,12,mm_recall(i)); + if (menuitem==9) col=130; else col=82; + Std->write(96+56,32+118,col,col+4,"Auto-center view"); + if (s_autocenter) i=toggle_on; else i=toggle_off; + storelfig(96+40,32+116,12,12,mm_recall(i)); + + if (kb_onepressed(KB_UP)) { + if (menuitem) menuitem--; else menuitem=9; + playsound(SND_UNLOCK,SM_NORMVOL,SM_NORMVOL,-127,SYSOWN,SFL_FIXED); + } else + if (kb_onepressed(KB_DOWN)) { + if (menuitem<9) menuitem++; else menuitem=0; + playsound(SND_UNLOCK,SM_NORMVOL,SM_NORMVOL,127,SYSOWN,SFL_FIXED); + } else + if (kb_onepressed(KB_ESC)) { + playsound(SND_MITRA,SM_NORMVOL,SM_NORMVOL,127,SYSOWN,SFL_FIXED); + menustate=1; + menuitem=3; + } else { + if (kb_onepressed(KB_ENTER) || kb_onepressed(KB_SPACE)) {i=1;col=0;} else + if (kb_onepressed(KB_LEFT)) {i=2;col=-5;} else + if (kb_onepressed(KB_RIGHT)) {i=3;col=5;} else i=0; + + if (i) { + oldmenustate=-1; + int k = 0; + if (i>1 && menuitem>=4 && menuitem<=9) { + if (i==2 && menuitem>=7) menuitem-=3; else + if (i==3 && menuitem<=6) menuitem+=3; else + k = -1; + } else + switch (menuitem) { + case 0: + if (sm_soundok) { + k = sm_soundvol; + //(SBdefault[MIXER_VOICE] & 0xf0)>>4; + if (i==3 && k0) k--; else k=-1; + if (k>=0) { + //k = (k<<4)|(k<<12); + //sbmix_setvol(MIXER_VOICE,k); + sm_soundvol = k; + } else break; + } + k=0; + break; + case 1: + if (!sm_soundok) { k=0; break; } + k = (SBdefault[MIXER_MIDI] & 0xf0)>>4; + if (i==3 && k<15) k++; else + if (i==2 && k>0) k--; else k=-1; + if (k>=0) { + k = (k<<4)|(k<<12); + sbmix_setvol(MIXER_MIDI,k); + } + k=0; + break; + case 2: + if (i==3) k = changeviewsize(1)-1; else + if (i==2) k = changeviewsize(-1)-1; + break; + case 3: + if (i==3) k = changegamma(gamma+1)-1; else + if (i==2) k = changegamma(gamma-1)-1; + break; + case 4: if (sm_soundok) {k=1;sm_lrinverted=!sm_lrinverted;} break; + case 5: k=1; CHGFLAG(gameflags,GFL_USESYNC); break; + case 6: k=1; CHGFLAG(gameflags,GFL_SHOWBLOOD); break; + case 7: k=1; CHGFLAG(gameflags,GFL_MESSAGES); break; + case 8: k=1; s_Kaos_enable=!s_Kaos_enable; + //if (Kaos_count>0) Kaos_enable = s_Kaos_enable; + break; + case 9: k=1; s_autocenter=!s_autocenter; + if (playbackwait) + MAKEFLAG(gameflags,GFL_AUTOCENTER,s_autocenter); + break; + } + if (k>=0) + //if (menuitem<=3) + if (!k) + playsound(SND_UNLOCK,0,0,col,SYSOWN,SFL_FIXED); + else + playsound(SND_ASCIAHIT,SM_NORMVOL,SM_NORMVOL,col,SYSOWN,SFL_FIXED); + } + } + break; + case 6: // Info! + kb_onepressed(KB_LEFT); + kb_onepressed(KB_RIGHT); + Big->colorwrite(119,3,48,"Info!"); + Big->colorwrite(120,4,50,"Info!"); + for (i=0;i<5;i++) { + if (i==menuitem) col=50; else col=2; //96; + Big->colorwrite(100,32+i*22,col,menutext[i+10]); + } + if (kb_onepressed(KB_UP)) { + if (menuitem) menuitem--; else menuitem=4; + playsound(SND_UNLOCK,SM_NORMVOL,SM_NORMVOL,-127,SYSOWN,SFL_FIXED); + } else + if (kb_onepressed(KB_DOWN)) { + if (menuitem<4) menuitem++; else menuitem=0; + playsound(SND_UNLOCK,SM_NORMVOL,SM_NORMVOL,127,SYSOWN,SFL_FIXED); + } else + if (kb_onepressed(KB_ENTER)) { + playsound(SND_MITRA,SM_NORMVOL,SM_NORMVOL,0,SYSOWN,SFL_FIXED); + menustate=50+menuitem; + menuitem=0; + } else + if (kb_onepressed(KB_ESC)) { + playsound(SND_MITRA,SM_NORMVOL,SM_NORMVOL,127,SYSOWN,SFL_FIXED); + menustate=1; + menuitem=4; + } + break; + case 10: // Load selection + case 11: // Save selection + kb_onepressed(KB_LEFT); + kb_onepressed(KB_RIGHT); + if (menustate==10) Big->colorwrite(110,4,50,menutext[1]/*"Load Game"*/); + else Big->colorwrite(110,4,50,menutext[2]/*"Save Game"*/); + for (i=0;i<6;i++) { + storelfig(50,32+(i*20),219,20,mm_recall(woodblock)); + if (menufnm[i]==NULL) + if (menuitem==i) + Std->write(58,40+(i*20),131,135,"- unused -"); + else + Std->write(58,40+(i*20),4,7,"- unused -"); + else { + //*(s[i]+31)=0; // Security system (???) !!!! + if (menuitem==i) + Std->write(58,40+(i*20),128,132,menufnm[i]); + else + Std->write(58,40+(i*20),112,117,menufnm[i]); + } + } + if (kb_onepressed(KB_UP)) { + if (menuitem) menuitem--; else menuitem=5; + playsound(SND_UNLOCK,SM_NORMVOL,SM_NORMVOL,-127,SYSOWN,SFL_FIXED); + } else + if (kb_onepressed(KB_DOWN)) { + if (menuitem<5) menuitem++; else menuitem=0; + playsound(SND_UNLOCK,SM_NORMVOL,SM_NORMVOL,127,SYSOWN,SFL_FIXED); + } else + if (kb_onepressed(KB_ENTER)) { + if (menustate==11 || menufnm[menuitem]!=NULL) { + if (menustate==10) { + action=102+menuitem; + playsound(SND_KEYS,SM_NORMVOL,SM_NORMVOL,-127,SYSOWN,SFL_FIXED); + menustate=100; + } else { + if (menufnm[menuitem]==NULL) { + menufnm[menuitem]=(char *)mm_reserve(33); + *menufnm[menuitem]=0; + } + if (input(50,32+(menuitem*20),menufnm[menuitem])) + if (savegame(menuitem,menufnm[menuitem])) { + action=110; + playsound(SND_KEYS,SM_NORMVOL,SM_NORMVOL,-127,SYSOWN,SFL_FIXED); + menustate=100; + } + } + } + } else + if (kb_onepressed(KB_ESC)) { + playsound(SND_MITRA,SM_NORMVOL,SM_NORMVOL,127,SYSOWN,SFL_FIXED); + menuitem=menustate-9; + menustate=1; + } + if (menustate==100 || menustate==1) + for (i=0;i<6;i++) if (menufnm[i]!=NULL) delete menufnm[i]; + break; + case 50: // Ordering + darkscreen(5); // vedi sopra + oldmenustate=-1; + Big->colorwrite(60,14,148,"Ordering"); + putrfig(160 ,4,27,33,mm_recall(KAOSMark[0])); + putrfig(160+25,4,24,37,mm_recall(KAOSMark[1])); + putrfig(160+71,4,22,33,mm_recall(KAOSMark[3])); + putrfig(160+48,4,25,33,mm_recall(KAOSMark[2])); + for (i=0; i<10; i++) { + if ((s=(char *)sl_find(mm_recall(sl_ordering),menuitem+i)) != NULL) + Std->write(60,50+i*10,112,116,s); + } + j=0; + if (menuitem>0) { + putlfig(132,170,14,14,mm_recall(KeyLeft)); + j |= 1; + } + if (sl_find(mm_recall(sl_ordering),menuitem+i) != NULL) { + putlfig(148,170,14,14,mm_recall(KeyRight)); + j |= 2; + } + switch(menuitem) { + case 10: + putrfig(80,100,FigList[F_BUB+4].dx,FigList[F_BUB+4].dy, + mm_recall(FigList[F_BUB+4].memidx)); + putrfig(170,110,FigList[F_FACE+3].dx,FigList[F_FACE+3].dy, + mm_recall(FigList[F_FACE+3].memidx)); + break; + /* + case 0: + putlfig(90,90,136,77,mm_recall(Sample3P)); + break; + */ + } + if ((kb_onepressed(KB_LEFT) || kb_onepressed(KB_UP)) && (j & 1)) { + playsound(SND_ASCIAHIT,SM_NORMVOL,SM_NORMVOL,0,SYSOWN,SFL_FIXED); + menuitem -= 10; + } else + if ((kb_onepressed(KB_ENTER) || kb_onepressed(KB_RIGHT) || + kb_onepressed(KB_DOWN)) && (j & 2)) { + playsound(SND_ASCIAHIT,SM_NORMVOL,SM_NORMVOL,0,SYSOWN,SFL_FIXED); + menuitem += 10; + } else + if (kb_onepressed(KB_ESC)) { + playsound(SND_MITRA,SM_NORMVOL,SM_NORMVOL,0,SYSOWN,SFL_FIXED); + menustate = 6; + menuitem = 0; + } + break; + case 51: + darkscreen(5); // vedi sopra + oldmenustate=-1; + Big->colorwrite(129,13,48,"Help!"); + Big->colorwrite(130,14,50,"Help!"); + + for (i=0; i<11; i++) { + if ((s=(char *)sl_find(mm_recall(sl_help),menuitem+i)) != NULL) + Std->write(40,50+i*10,112,117,s); + } + j=0; + if (menuitem>0) { + putlfig(132,170,14,14,mm_recall(KeyLeft)); + j |= 1; + } + if (sl_find(mm_recall(sl_ordering),menuitem+i) != NULL) { + putlfig(148,170,14,14,mm_recall(KeyRight)); + j |= 2; + } + if ((kb_onepressed(KB_LEFT) || kb_onepressed(KB_UP)) && (j & 1)) { + playsound(SND_ASCIAHIT,SM_NORMVOL,SM_NORMVOL,0,SYSOWN,SFL_FIXED); + menuitem -= 11; + } else + if ((kb_onepressed(KB_ENTER) || kb_onepressed(KB_RIGHT) || + kb_onepressed(KB_DOWN)) && (j & 2)) { + playsound(SND_ASCIAHIT,SM_NORMVOL,SM_NORMVOL,0,SYSOWN,SFL_FIXED); + menuitem += 11; + } else + if (kb_onepressed(KB_ESC)) { + playsound(SND_MITRA,SM_NORMVOL,SM_NORMVOL,0,SYSOWN,SFL_FIXED); + menustate = 6; + menuitem = 1; + } + break; + case 52: + darkscreen(5); // vedi sopra + oldmenustate=-1; + Big->colorwrite(49,23,48,"The Millennium group"); + Big->colorwrite(50,24,50,"The Millennium group"); + switch (menuitem) { + case 0: + Std->write(74,80,112,115,NicFirm); + Std->write(174,80,226,230,"(Master of the C++)"); + putlfig(48,76,16,16,mm_recall(WorkID[0])); + Std->write(74,100,112,115,MaxFirm); + Std->write(174,100,226,230,"(Master of the Pixel)"); + putlfig(48,96,16,16,mm_recall(WorkID[1])); + Std->write(74,120,112,115,AndFirm); + Std->write(174,120,226,230,"(Master of the Pencil)"); + putlfig(48,116,16,16,mm_recall(WorkID[2])); + //Std->write(70,160,114,117,"Ehi, KAOS Š la nostra prima creazione !"); + break; + case 1: + Std->write(60,60,130,134,"The Analyst and Programmer"); + Std->write(80,80,128,132,NicFirm); + putlfig(180,67,68,32,mm_recall(MNID_Nico)); + /* + Std->write(60,100,82,86,"\"Se perdi la fiducia in te stesso e non"); + Std->write(60,110,82,86," hai pi— la forza di proseguire, invoca"); + Std->write(60,120,82,86," i Miei poteri di guarigione\""); + Std->write(60,130,113,117,"\"I hold the powers of Air\""); + */ + break; + case 2: + Std->write(60,60,130,134,"The Artist and Sound Creator"); + Std->write(80,80,128,132,MaxFirm); + putlfig(180,67,76,32,mm_recall(MNID_Maxy)); + /* + Std->write(60,100,82,86,"\"Per sopraffarre il nemico ti serve"); + Std->write(60,110,82,86," il potere della destruzione. Solo Io"); + Std->write(60,120,82,86," posso offrirti la potenza del fuoco\""); + Std->write(60,130,113,117,"\"I hold the powers of Fire\""); + */ + break; + case 3: + Std->write(60,60,130,134,"The Manual Designer"); + Std->write(80,80,128,132,AndFirm); + putlfig(180,67,68,32,mm_recall(MNID_Andy)); + /* + Std->write(60,100,82,86,"\"Se vuoi vincere, devi conoscere i"); + Std->write(60,110,82,86," luoghi dove combatterai; Io ti"); + Std->write(60,120,82,86," sveler• i segreti del labirinto\""); + Std->write(60,130,113,117,"\"I hold the powers of Earth\""); + */ + break; + } + if (menuitem>0) putlfig(132,142,14,14,mm_recall(KeyLeft)); + if (menuitem<3) putlfig(148,142,14,14,mm_recall(KeyRight)); + if (menuitem>=1 && menuitem<=3) { + for (i=0;i<4;i++) + if ((s=(char *)sl_find(mm_recall(sl_info),(menuitem-1)*4+i)) != NULL) { + if (i<3) col=82; else col=113; + Std->write(60,100+i*10,col,col+4,s); + } + } + if ((kb_onepressed(KB_LEFT) || kb_onepressed(KB_UP)) && menuitem>0) { + playsound(SND_ASCIAHIT,SM_NORMVOL,SM_NORMVOL-2,0,SYSOWN,SFL_FIXED); + menuitem--; + } else + if ((kb_onepressed(KB_ENTER) || kb_onepressed(KB_RIGHT) || + kb_onepressed(KB_DOWN)) && menuitem<3) { + playsound(SND_ASCIAHIT,SM_NORMVOL-2,SM_NORMVOL,0,SYSOWN,SFL_FIXED); + menuitem++; + } else + if (kb_onepressed(KB_ESC)) { + playsound(SND_MITRA,SM_NORMVOL,SM_NORMVOL,127,SYSOWN,SFL_FIXED); + menustate=6; + menuitem=2; + } + break; + /* + case 53: + kb_onepressed(KB_LEFT); kb_onepressed(KB_RIGHT); + kb_onepressed(KB_UP); kb_onepressed(KB_DOWN); + darkscreen(5); // vedi sopra + Big->colorwrite(80,14,50,"Greetings to"); + if (kb_onepressed(KB_ENTER) || kb_onepressed(KB_ESC)) { + playsound(SND_MITRA,16,16,0,SFL_FIXED); + menustate=6; + menuitem=3; + } + break; + */ + case 53: + kb_onepressed(KB_LEFT); kb_onepressed(KB_RIGHT); + kb_onepressed(KB_UP); kb_onepressed(KB_DOWN); + darkscreen(3); // vedi sopra + oldmenustate=-1; + setvrect(0,50,320,130); + Big->colorwrite( 99,13,49,"Greetings to"); + Big->colorwrite(100,14,50,"Greetings to"); + if ((s=(char *)sl_find(mm_recall(sl_greetings),menuitem/10/*20*/)) != NULL) { + for (i=0;i<14;i++) { + if (s) { + switch(s[0]) { + case '<': col=128; s++; break; + case '>': col=226; s++; break; + default: col=112; + } + j = (320-Std->writelen(s))>>1; + Std->writeclip(j,50+i*10-(menuitem%10/*20>>1*/),col,col+4,s); + s = (char *)sl_find(s,1); + } else menuitem = 0; + } + menuitem++; + } + if (kb_onepressed(KB_ENTER) || kb_onepressed(KB_ESC)) { + playsound(SND_MITRA,SM_NORMVOL,SM_NORMVOL,0,SYSOWN,SFL_FIXED); + menustate=6; + menuitem=3; + //viewstate = playbackwait ? 1 : 0; + //viewstate=!playbackwait; + } + break; + case 54: + if (viewstate!=2) { + viewstate=2; + stopallsounds(); + windsound=-1; + } + kb_onepressed(KB_LEFT); kb_onepressed(KB_RIGHT); + kb_onepressed(KB_UP); kb_onepressed(KB_DOWN); + darkscreen(5); // vedi sopra + oldmenustate=-1; + setvrect(0,50,320,130); + Big->colorwrite(109,13,48,"Quotes"); + Big->colorwrite(110,14,50,"Quotes"); + if ((s=(char *)sl_find(mm_recall(sl_quotes),menuitem/20)) != NULL) { + for (i=0;i<14;i++/*,j++*/) { + if (s) { + if (s[0]!=' ') col=128; else col=112; + Std->writeclip(40,50+i*10-(menuitem%20>>1),col,col+4,s); + s = (char *)sl_find(s,1); + } else menuitem = 0; + } + menuitem++; + } + if (kb_onepressed(KB_ENTER) || kb_onepressed(KB_ESC)) { + playsound(SND_MITRA,SM_NORMVOL,SM_NORMVOL,0,SYSOWN,SFL_FIXED); + menustate=6; + menuitem=4; + viewstate = playbackwait ? 1 : 0; + //viewstate=!playbackwait; + } + break; + case 100: + case 101: + /* + if (!ValidGame) { + menustate=1; + menuitem=0; + break; + } + */ + if (menustate==101) menustate=0; + else menustate++; + Sync=0; + viewstate=0; + break; + } +} + +void showlevelstats() { + int i, app; + long fires, hits, blood, tecno; + int kills; + + stopallsounds(); + windsound=-1; + sursound=-1; + fadeout(startpal,0,256,48); + drawpict(dragon1,vpage); + char s[80]; + sprintf(s,"Level %2d: %s",levnum+1,levname); + Big->colorwrite(16,8,0,s); + //Std->write(16,8,82,86,s); + ftransfscreen(VMEMPTR); + fadein((PPal)mm_recall(origpal),0,256,32); + ((Player *)PlayAr[0])->getstats(fires,hits,blood,tecno,kills); + Big->colorwrite(32,32,2/*32*/,"Mira:"); + //Std->write(32,32,96,100,"Violenza:"); + if (fires>0) app=(int)(hits*100/fires); + else app=0; + sprintf(s,"%3d",app); + Big->colorwrite(240,32,52,s); + Big->colorwrite(280,32,52,"%"); + //Std->write(260,32,130,134,s); + playsound(SND_MITRA,SM_NORMVOL,SM_NORMVOL,0,SYSOWN,SFL_FIXED); + ftransfscreen(VMEMPTR); + for (i=10;i--;) {waitvsync();soundmanager(0,0,0);} + Big->colorwrite(32,54,2/*32*/,"Violenza:"); + //Std->write(32,54,96,100,"Violenza:"); + if (hits>0) app=(int)(blood*100/hits); + else app=0; + sprintf(s,"%3d",app); + Big->colorwrite(240,54,52,s); + Big->colorwrite(280,54,52,"%"); + //Std->write(260,54,130,134,s); + playsound(SND_MITRA,SM_NORMVOL,SM_NORMVOL,0,SYSOWN,SFL_FIXED); + ftransfscreen(VMEMPTR); + for (i=10;i--;) {waitvsync();soundmanager(0,0,0);} + Big->colorwrite(32,76,2/*32*/,"Vittime:"); + //Std->write(32,76,96,100,"Vittime:"); + if (numenemies>0) app=(int)(kills*100/numenemies); + else app=0; + sprintf(s,"%3d",app); + Big->colorwrite(240,76,52,s); + Big->colorwrite(280,76,52,"%"); + //Std->write(260,76,130,134,s); + playsound(SND_MITRA,SM_NORMVOL,SM_NORMVOL,0,SYSOWN,SFL_FIXED); + ftransfscreen(VMEMPTR); + for (i=10;i--;) {waitvsync();soundmanager(0,0,0);} + Big->colorwrite(32,98,2/*32*/,"Tecno hits:"); + //Std->write(32,98,96,100,"Tecno hits:"); + if (hits>0) app=(int)(tecno*100/hits); + else app=0; + sprintf(s,"%3d",app); + Big->colorwrite(240,98,52,s); + Big->colorwrite(280,98,52,"%"); + //Std->write(260,98,130,134,s); + playsound(SND_MITRA,SM_NORMVOL,SM_NORMVOL,0,SYSOWN,SFL_FIXED); + ftransfscreen(VMEMPTR); + for (i=10;i--;) {waitvsync();soundmanager(0,0,0);} + kb_onepressed(KB_ESC); kb_onepressed(KB_ENTER); + do { + soundmanager(0,0,0); + } while (!kb_onepressed(KB_ESC) && !kb_onepressed(KB_ENTER)); +} + +void handle_comline() { + int i, j; + char *s, *app; + char num[11]; + for (i=1; i<_argc; i++) { + // interpreta opzione + s = strupr(_argv[i]); + if (*s == '/' || *s == '-') s++; + if (*s == 'F') { + levfile = s+1; + continue; + } + // interpreta eventuale parametro numerico + for (j=0,app=s; j<10 && *app; app++) + if (*app>='0' && *app<='9') { + num[j++] = *app; + *app=0; + } else + if (*app<'A' || *app>'Z') *app=0; + num[j]=0; + j = atoi(num); + if (!strcmp(s,"MKRS")) { + printf("\n%s\n%s",KaosFirm,NicMark); + printf("\nGraphic Art & Sounds by %s",MaxFirm); + printf("\nManual Design by %s\n",AndFirm); + exit(0); + } else + if (!strcmp(s,"PAUSE")) init_pause=1; else +#ifndef __SHAREWARE__ + if (!strcmp(s,"SLOW")) slowmode=1; else + if (!strcmp(s,"USESLIM")) useslim=1; else + if (fwcomp(s,"SAVEDEM",7)) { + saveplayback=1; + if (j>=0 && j - saves KAOSn.DEM playback file (=0,1,2)"); +#endif + puts(" /F - uses .DLF levels file"); + puts(" /H - this help screen."); + exit(0); + } + } +} + +int clockstate = -1, + clockcount = 0x0000; +void clockcheck() { + struct time timep; + if (clockcount--) return; + switch(clockstate) { + case 0: // Wait next + gettime(&timep); + clockcount=35; + if (timep.ti_min % 15) clockstate--; + break; + case -1: // Wait for 15 min multiples + gettime(&timep); + if (timep.ti_min % 15) { + clockcount=35; + break; + } + clockstate=(timep.ti_hour<<8)+(timep.ti_min/15); + if (timep.ti_hour>12) clockstate-=0xc00; else + if (clockstate<0x100) clockstate+=0xc00; + default: // Don Din + clockcount=91; + int vol; + if (windsound==-1) vol=SM_LOWVOL; else vol=SM_NORMVOL; + if (clockstate>0xff) { + playsound(SND_CLOCK,vol,vol,0,SYSOWN,SFL_FIXED); + clockstate-=0x100; + } else + if (clockstate) { + playsound(SND_CLOCK2,vol,vol,0,SYSOWN,SFL_FIXED); + clockstate--; + } + } +} + +void show_message(int n) { + char str[80]; + char *app; + void far *strlist = mm_recall(sl_messages); + int i,j; + + if (sl_find(strlist,n)) { + fwfill(str,0,80); + // costruisce il messaggio + for (i=0;i<40;i++) + for (j=n;j>=0;j--) + if ((app = (char *)sl_find(strlist,j))[i] != ' ') { + if (i) app += i-1; + strcat(str,app); + if (j==n) i=40; + break; + } + if (!message_num) message_count = MESSAGE_TIME; + // inserisce nella lista + if ((i = message_num) == 3) { + strcpy(message[0],message[1]); + strcpy(message[1],message[2]); + i--; + } else message_num++; + strcpy(message[i],str); + } else error("show_message","invalid number"); +} + +void main() { + int i, j; + TEvent evnt; + char Kaos_tic = 36; + + maxdim = 320; + handle_comline(); + + mm_init(); + +/* +#ifdef __SHAREWARE__ + if (players>1) { // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + printf("\n\n MultiPlayer game NOT active in Shareware version"); + exit(EXIT_FAILURE); + } +#endif +*/ + init3DEngine(); + /* + i = (maxdim*10/19); + if (i>168) i=168; + setviewsize(maxdim,i); + */ + init(); + +#ifndef __DATAFILE__ + Std = new Font("std"); Std->setdispl(-1,0); + Big = new Font("big"); Big->setdispl(-1,0); + Std->packdata(); + Big->packdata(); +#else + Std = new Font(); Std->setdispl(-1,0); + Big = new Font(); Big->setdispl(-1,0); + Std->unpackdata(); + Big->unpackdata(); +#endif + +#ifndef __DATAFILE__ + sl_greetings = sl_convert("GREETING.SLF"); + sl_quotes = sl_convert("QUOTES.SLF"); + sl_ordering = sl_convert("ORDERING.SLF"); + sl_help = sl_convert("HELP.SLF"); + sl_info = sl_convert("INFO.SLF"); + sl_messages = sl_convert("MESSAGES.SLF"); +#else + sl_greetings = mm_alloc(0); // Automatic size selection + sl_quotes = mm_alloc(0); + sl_ordering = mm_alloc(0); + sl_help = mm_alloc(0); + sl_info = mm_alloc(0); + sl_messages = mm_alloc(0); +#endif + loadconfig(); + initgame(1); // imposta il monoplayer + initL(); + intro(); + kb_initkey(); +#ifndef __DATAFILE__ +#ifdef __MAKEDATA__ + mm_resetall(); + mm_makedatafile(); +#endif +#endif + mm_resetall(); + int resetcnt = 0; + instSync(); + + //ftransfarea(168,32,VMEMPTR); + /* + for (i=0;i<3;i++) + if (InfoBarAr[i]) InfoBarAr[i]->repaint(0xff); + */ + + menustate=1; + menuitem=0; + viewstate=1; + animpal(PAA_FADEIN,0); + playbackwait=72; // Solo due secondi per la prima + + do { + if (ValidGame) { + Kaos_count = 60; // !!!K + if (!menustate || menustate>=100) animpal(PAA_FADEIN,0); + action=1;actioncount=54; // write level name + Sync=0; + viewstate = 0; // !!! + repaint = 1; // !!! + quake = 0; + oldmenustate = -1; + key_pause = 0; + message_num=0; + message_count=0; + do { + clockcheck(); + if (viewstate<2) { + actorslist.animate(); + if (!viewstate) doormanager.animate(); + } + + if (players<=1) { + Mover &first = *(PlayAr[0]->mover); + soundmanager(first.x,first.y,first.angle); + } else soundmanager(-1l,0,0); + + //if (Sqr_count>1) Sqr_count--; + if (Sqr_count) Sqr_count--; + ++resetcnt; + if (!Sync) { + if (resetcnt >= MAXRESETCNT) { // 40 + mm_reset(); + resetcnt = 0; + if (viewstate<1 && sursound==-1) + switch (random(10)) { // !!! + case 2: + if (action) break; + if (windsound>=0) i=SM_NORMVOL; else i=SM_LOWVOL; + if (random(2)) + sursound=playsound(SND_THUNDER1,i-random(4),i-random(4),127-random(254),SYSOWN,SFL_FIXED); + else { + if (i==SM_NORMVOL) { + animpal(PAA_LIGHT,2+random(2)); + action=2;actioncount=16+40; // Thunder after light + thunderdraw=thunder; + thunderang=angleadd(anglesub(PlayAr[0]->mover->angle,ANG60),random(ANG60<<1)); + thunderz=halfheight+random(halfheight); + } else + sursound=playsound(SND_THUNDER2,SM_LOWVOL-random(4)-2,SM_LOWVOL-random(4)-2,127-random(254),SYSOWN,SFL_FIXED); + } + break; + case 3: + if (windsound<0) // non stiamo fuori + sursound=playsound(SND_GOCCIA,SM_LOWVOL-random(4),SM_LOWVOL-random(4),127-random(254),SYSOWN,SFL_FIXED); + break; + } + } + if (repaint || menustate) { + if (repaint || menustate!=oldmenustate) { + drawpict(dragon2,vpage); + oldmenustate = menustate; + } + // draw corners + if (viewstate<2 && viewwidth!=320) + for (i=0;irepaint(IBR_REPNOTRANSF); + } else { + for (i=0;i<3;i++) + if (InfoBarAr[i]) InfoBarAr[i]->repaint(IBR_REPAINT); + } + } else + if (viewstate<2 && ((Sqr_count && Sqr_count<=10) || message_num)) { + setvbuff(mm_recall(dragon2[0])); + if (message_num) ftransfblock(0,0,200,30,vpage); + else ftransfblock(8,8,32,24,vpage); + setvbuff(vpage); + if (viewwidth!=320) + for (i=0;idraw(PlayVid[i].vidx,PlayVid[i].vidy, + PlayVid[i].cd,PlayVid[i].fd); + if (action==1) { + i = (320-Big->writelen(levname)) >> 1; + Big->colorwrite(i-1,49,48,levname); + Big->colorwrite(i,50,50,levname); + } + + if (message_num) { + if (message_count<10) j=10-message_count; else j=0; + setvrect(0,0,200,30); + for (i=0;iwriteclip(0,(i*10)-j,112,117,message[i]); + ftransfblock(0,0,200,message_num*10,VMEMPTR); + } + + if (Sqr_count) { + TFig &Sqrf = Sqrs[Sqr_focus]; + if (Sqr_count>1) { + if (Sqr_focus == SqrLumaca) { + storerfig(8,8,32,24,mm_recall(Sqrf.memidx)); + } else { + if (Sqr_count<=10) Sqr_ratio--; + else if (Sqr_ratio<10) Sqr_ratio++; + int dx = (int)Sqrf.dx*Sqr_ratio/10, + dy = (int)Sqrf.dy*Sqr_ratio/10; + setvrect(0,0,320,200); + scalerscfig(24-(dx>>1),20-(dy>>1), + Sqrf.dx,Sqrf.dy,dx,dy,10-Sqr_ratio, + mm_recall(Sqrf.memidx)); + } + } else Sqr_count=0; + ftransfblock(8,8,32,24,VMEMPTR); + } + } + + handlemenu(); + + if (viewstate<1) + if (GETFLAG(gameflags,GFL_USESYNC) && !palanimstate) + waitvsync(); + else pal_animate(1); + if (viewstate<2) { + for (i=0;itransf(PlayVid[i].vidx,PlayVid[i].vidy); + if (action==1) + ftransfblock((320-(i = Big->writelen(levname)))>>1,50, + i,10,VMEMPTR); + } + if (repaint || menustate) { + if (menustate || players>1) ftransfscreen(VMEMPTR); + else ftransfarea(0,168,VMEMPTR); + repaint = 0; + } + + while (!Sync); // idle + /* + if (players<2) { + Mover &first = *(PlayAr[0]->mover); + while (!Sync) soundmanager(first.x,first.y,first.angle); + } else + while (!Sync) soundmanager(-1l,0l,0); + */ + Sync--; + } else { + // actorslist.reset(); !!!! + for (i=0;ivirtualdraw(); + pal_animate(0); + if (Sync>=8) { + FocusSqr(SqrLumaca,54); + Sync=0; + } else Sync--; + } + + /* + // plays after + if (players<=1) { + Mover &first = *(PlayAr[0]->mover); + soundmanager(first.x,first.y,first.angle); + } else soundmanager(-1l,0l,0); + */ + + if (raindraw) anim_rain(); // in ogni caso... + + if (key_pause) { + setvbuff(VMEMPTR); + Big->colorwrite(110,80,0,"Paused"); + setvbuff(vpage); + key_pause = 0; // quasi anti-rimbalzo + while(!key_pause); + key_pause = 0; + kb_reset(); + Sync=0; + repaint=1; + } + + if (message_count) { + if (!(--message_count)) { + for (i=0;i0) { + message_num--; + message_count = MESSAGE_TIME; + } + } + } + + //mm_visualize(); + if (viewstate<1) { + if (quake) quake--; + // Action Manager + if (actioncount--) { + switch (action) { + case 1: // Display level name + if (!actioncount) repaint=1; + break; + case 2: // Thunder after light + if (actioncount==40) { + thunderdraw=-1; + if ((i = (PlayAr[0]->mover->angle-thunderang)) > ANG180) + i = ANG180-i; + i/=(ANGLVL<<1); + j = SM_NORMVOL-random(4); + sursound=playsound(SND_THUNDER2,j,j, + i>=0 ? -127+i : 127-i,SYSOWN,SFL_FIXED); + } else + if (!actioncount) { // Rimbombo + playsound(SND_THUNDER1,SM_NORMVOL,SM_NORMVOL,-127,SYSOWN,SFL_FIXED); + } + break; + case 3: // End of Level + if (actioncount==1) { + if (playbackwait && !saveplayback) + showlevelstats(); + levnum++; + action=101; + } + break; + } + if (!actioncount) action=0; + } + + for (i=0;i<3;i++) + if (InfoBarAr[i]) InfoBarAr[i]->animate(); + + if (GETFLAG(gameflags,GFL_KAOSENABLE)) { + if (!(--Kaos_tic)) { // !!!K + if (Kaos_count>=0) { + Kaos_count--; + if (Kaos_count>=0 && Kaos_count <= 15) + playsound(SND_MITRA,SM_LOWVOL,SM_NORMVOL,0,SYSOWN,SFL_FIXED); + } + Kaos_tic = 36; + } + if (Kaos_count>=0 && Kaos_count <= 15) { + ftransfblock(292,4,24,16,VMEMPTR); + if (Kaos_count || Kaos_tic>1) { + setvbuff(VMEMPTR); + drawnum(316,4,1,2,bignumf,Kaos_count); + setvbuff(vpage); + } + } + } + +#ifdef __MAINCHECK__ + ftransfblock(128,240,80,8,VMEMPTR); + setvbuff(VMEMPTR); + char s[20]; + sprintf(s,"MAIN: %7ld",mm_mainmem); + Std->write(128,240,130,134,s); + setvbuff(vpage); +#endif + +#ifdef __VISUALIZE__ + mm_visualize(); + + void far *p; + char far *vp = (char _seg *)0xa000 + (char near *)0; + + for (i=0;isize>>5;j--;) *(vp++) = col; + } +#endif + + /* + ftransfblock(128,188,80,8,VMEMPTR); + setvbuff(VMEMPTR); + char s[20]; + sprintf(s,"XMS: %d",mm_xmsblocks); + Std->write(128,188,130,134,s); + setvbuff(vpage); + */ + /* non serve, ora + ftransfblock(128,188,80,8,VMEMPTR); + setvbuff(VMEMPTR); + char s[20]; + sprintf(s,"dist=%d",intdist((lshr16(PlayAr[0]->mover->x)-320)>>4, + (lshr16(PlayAr[0]->mover->y)-320)>>4)); + Std->write(128,188,130,134,s); + setvbuff(vpage); + */ + if (kb_onepressed(KB_F10)) { + if (kb_pressed(KB_F9)) { + changegamma(STDGAMMA); + kb_onepressed(KB_F9); + } else changegamma(gamma+1); + } else + if (kb_onepressed(KB_F9)) { + changegamma(gamma-1); + } else + if (kb_onepressed(KB_F11)) { + if (changeviewsize(-1)) + playsound(SND_UNLOCK,SM_NORMVOL,SM_NORMVOL,-127,SYSOWN,SFL_FIXED); + } else + if (kb_onepressed(KB_F12)) { + if (changeviewsize(1)) + playsound(SND_UNLOCK,SM_NORMVOL,SM_NORMVOL,127,SYSOWN,SFL_FIXED); + } else + if (kb_onepressed(KB_F4)) checkword(); + } + while (eventmanager.get(evnt)) { + for (i=0;i<3;i++) + if (InfoBarAr[i]) InfoBarAr[i]->handle_event(evnt); + if (evnt.what & 0x80) { + if (evnt.what & 0x40) actorslist.handle_event(evnt); + else objectslist.handle_event(evnt); + doormanager.handle_event(evnt); + } + + switch (evnt.what) { + case EV_ENDSOUND: + if (evnt.source==sursound) sursound=-1; + break; + case EV_PLACTIVATE: + i = evnt.data.msg.x; + if (Map[i].data == T_SWITCHU && + Map[i].type != MTP_DOOR1 && + Map[i].type != MTP_DOOR2) { + Map[i].data = T_SWITCHD; + playsound(SND_TOGGLE,0,0,0,SYSOWN,SFL_FIXED); + if (!GETFLAG(gameflags,GFL_COMPETITIVE)) { + action=3; + actioncount=36; // End of Level + } + } + break; + case EV_BOOM: + play3Dsound(evnt.data.pos.x,evnt.data.pos.y,SND_BOOM, + SM_MAXVOL+SM_LOWVOL,SYSOWN,SFL_NORMAL); // !!! + break; + case EV_KILL: + case EV_DEAD: + ownerdead(evnt.source); + /* + for (i=0;igetid() == evnt.source) { + setvbuff(VMEMPTR); + ffillblock(PlayVid[i].vidx-halfwidth,PlayVid[i].vidy-halfheight, + viewwidth,viewheight,0l); + setvbuff(vpage); + switch (i) { + case 0: PlayAr[0] = PlayAr[1]; + PlayVid[0] = PlayVid[1]; + case 1: PlayAr[1] = PlayAr[2]; + PlayVid[1] = PlayVid[2]; + } + players--; + break; + } + } + */ + if (evnt.what==EV_KILL) objectslist.erase(evnt.source); + break; + case EV_ERASEACT : actorslist.erase(evnt.source); break; + case EV_RESURRECT: + animpal(PAA_LIGHT,4); + playsound(SND_THUNDER1,48,48,127,SYSOWN,SFL_FIXED); + playsound(SND_THUNDER1,48,48,-127,SYSOWN,SFL_FIXED); + Sqr_focus=4; // !!! + break; + case EV_ENDPLAYBACK: + eventmanager.flush(); + action=199; // End of PlayBack + break; + case EV_CHGTEXTURE: + byte *chptr; + switch(evnt.source) { + case 0: // Muro + chptr = (byte *)mm_recall(changewtext); + TMapInfo &mapinf = Map[evnt.data.msg.x]; + if (mapinf.type==MTP_DOOR1 || + mapinf.type==MTP_DOOR2) { + if (chptr) { + doormanager.doortype[mapinf.data] = + chptr[doormanager.doortype[mapinf.data]]; + } + } else + if (chptr) { + mapinf.data = chptr[mapinf.data]; + } + break; + /* + case 1: // Ceiling ??? + ceilmap[evnt.data.msg.x] = + ((byte *)mm_recall(changeftext))[ceilmap[evnt.data.msg.x]]; + break; + */ + case 2: // Floor + if ((chptr = (byte *)mm_recall(changeftext)) != NULL) { + floormap[evnt.data.msg.x] = + chptr[floormap[evnt.data.msg.x]]; + } + break; + } + break; + case EV_MESSAGE: + if (GETFLAG(gameflags,GFL_MESSAGES)) + show_message(evnt.source); + break; + case EV_ANTIKAOS: + if (Kaos_count>=0) { + Kaos_count = -2; + ftransfblock(292,4,24,16,VMEMPTR); // !!!K patch + playsound(SND_RISATA,SM_NORMVOL,SM_NORMVOL,0,SYSOWN,SFL_FIXED); + } //else playsound(SND_COLPO1,SM_MAXVOL,SM_MAXVOL,127,SFL_FIXED); + break; + case EV_SCODE: // !!! + if (evnt.source==SC_MNTMap) + CHGFLAG(gameflags,GFL_TOTALMAP); +#ifdef __CANCAPT__ + else + if (evnt.source==0xff) { + kb_enablestd(); + getch(); + ftransfarea(168,32,VMEMPTR); + repaint=1; + Sync=0; + kb_disablestd(); + } +#endif + break; + } + } + } while (action<100); + } else { //Invalid Game... only menu + clockcheck(); + while(!Sync); Sync=0; + if (++resetcnt>MAXRESETCNT) { + mm_reset(); + resetcnt=0; + } + pal_animate(1); + soundmanager(0,0,0); + drawpict(dragon2,vpage); + handlemenu(); + ftransfscreen(VMEMPTR); + if (viewstate<2) + if (!playbackwait) { + if (saveplayback) i=saveplayback-1; + else i=random(MAXPLAYBACKS); + if (play_playback(i)) { + if (viewstate==1) viewstate=0; + action=101; + } else playbackwait = 72; // 2 secondi + } else playbackwait--; + } + + switch (action) { + //case 200: break; // Exit Game + case 199: //End of Playback (Current Game) + end_playback(); + playbackwait=MAXPLAYBACKWAIT; + delgame(); + /* + if (!menustate || menustate==100) { + menustate=1; + menuitem=0; + } + viewstate=1; + */ + action=0; + break; + case 101: // New Game (also playback) + kb_reset(); + action=0; + //if (!loadmap(levnum=initlev)) error("Map not found"); + //ValidGame = 1; + MAKEFLAG(gameflags,GFL_NORANDOM,!playbackwait || saveplayback); + loadmap(levnum); + if (!GETFLAG(gameflags,GFL_NORANDOM|GFL_COMPETITIVE) && !ValidGame && levnum>0) + congratulations(); + break; + case 102: // Load game N (N=action-102 102-109) + case 103: + case 104: + case 105: + case 106: + case 107: + case 108: + case 109: + if ((ValidGame = loadgame(action-102)) != 0) { + fadeout(startpal,0,256,20); + } + action=0; + break; + case 110: // Saved game + fadeout(startpal,0,256,20); + action=0; + break; + } + } while (action<200); + + saveconfig(); // !!! + uninstSync(); + + doneL(); + donesounds(); + kb_donekey(); + + ShutDown = 1; + + mm_done(); + + delete Std; +} diff --git a/KaosSrc/kaos.hpp b/KaosSrc/kaos.hpp new file mode 100644 index 0000000..c05c70c --- /dev/null +++ b/KaosSrc/kaos.hpp @@ -0,0 +1,439 @@ +/************************************************************************ + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + ************************************************************************/ + +#define T_WALL1 0 +#define T_WALL1M 1 +#define T_WALL1S 2 +#define T_WALL1MS 3 +#define T_WALL1SS 4 +#define T_WALL1MSS 5 +#define T_TAP 6 +#define T_TAPM 7 +#define T_TAPS 8 +#define T_TAPMS 9 +#define T_TAPSS 10 +#define T_TAPMSS 11 +#define T_SCUDO 12 +#define T_SCUDOM 13 +#define T_SCUDOS 14 +#define T_SCUDOMS 15 +#define T_SCUDOSS 16 +#define T_SCUDOMSS 17 +#define T_ARC 18 +#define T_ARCM 19 +#define T_PIETR1 20 +#define T_PIETR1M 21 +#define T_PIETR1S 22 +#define T_PIETR1MS 23 +#define T_PIETR1SS 24 +#define T_PIETR1MSS 25 +#define T_ASCE 26 +#define T_ASCEM 27 +#define T_ASCES 28 +#define T_ASCEMS 29 +#define T_ASCESS 30 +#define T_ASCEMSS 31 +#define T_ROCK 32 +#define T_ROCKS 33 +#define T_ROCKSS 34 +#define T_WOOD1 35 +#define T_WOOD1S 36 +#define T_WOOD1SS 37 +#define T_WBOX 38 +#define T_WBOXS 39 +#define T_WBOXSS 40 +#define T_DOOR1 41 +#define T_DOOR1S 42 +#define T_DOOR2 43 +#define T_DOOR2S 44 +#define T_DOORY 45 +#define T_DOORYS 46 +#define T_DOORR 47 +#define T_DOORRS 48 +#define T_WOOD2 49 +#define T_WOOD2S 50 +#define T_WOOD2SS 51 +#define T_SBARRE 52 +#define T_SBARRES 53 +#define T_SWITCHU 54 + +#define T_WALL1Z 55 +#define T_WALL1MZ 56 +#define T_PIETR1Z 57 +#define T_PIETR1MZ 58 +#define T_ROCKZ 59 +#define T_WOOD1Z 60 +#define T_WBOXZ 61 +#define T_WOOD2Z 62 +#define T_WALL2 63 +#define T_WALL2M 64 +#define T_WALL2Z 65 +#define T_WALL2MZ 66 +#define T_PIETR2 67 +#define T_PIETR2M 68 +#define T_PIETR2Z 69 +#define T_PIETR2MZ 70 +#define T_EARTH 71 +#define T_EARTHZ 72 +#define T_SOFT 73 +#define T_SOFTM 74 +#define T_SOFTZ 75 +#define T_SOFTMZ 76 + +#define T_DRAGON 77 // 9 + +//#define T_NONE1-2-3 +#define T_GRATAW 86 +#define T_GRATAWZ 87 +#define T_GRATAB 88 +#define T_GRATABZ 89 +#define T_FLROCK 90 +#define T_FLROCKZ 91 +#define T_OVERDOOR 92 +#define T_DOORSLOT 93 +#define T_SWITCHD 94 +#define T_NULL T_DOORSLOT + +#define T_TRANSP T_GRATAW +#define TEXTNUM (T_SWITCHD+1) + +#define T_TEXTURES (TEXTNUM) +#define T_OBJECTS (T_TEXTURES+36+18) // i 18 sono quelli dei vasi +#define T_ENEMIES (T_OBJECTS+12) +#define T_PLAYERS (T_ENEMIES+12) + +#define F_PLAYER 0 // 8+8+8+8+2+5 = 39 +#define F_SOLDIER (F_PLAYER+39) // 8+8+8+4+2+5 = 35 +#define F_SLIMER (F_SOLDIER+35) // 5+5+4+2+6 = 22 +#define F_BUB (F_SLIMER+22) // 5+5+2+2+6 = 20 +#define F_FACE (F_BUB+20) // 5+5+2+5 = 17 +#define F_SPIDER (F_FACE+17) // 5+5+2+2+5 = 19 +#define F_MOUSE (F_SPIDER+19) // 5+5 = 10 +#define F_MISSILE (F_MOUSE+10) // 5 +#define F_FIREBALL (F_MISSILE+5) +#define F_SLIMFIRE (F_FIREBALL+1) // 2 +#define F_SPIDFIRE (F_SLIMFIRE+2) // 4 +#define F_TORCIA (F_SPIDFIRE+4) // 4 +#define F_TORCIAM (F_TORCIA+4) // 4 +#define F_COLUMN (F_TORCIAM+4) +#define F_COLUMNM (F_COLUMN+1) +#define F_BARILE (F_COLUMNM+1) // 5 +#define F_BARILX (F_BARILE+5) +#define F_FIREBOOM (F_BARILX+1) // 4 +#define F_KEYRED (F_FIREBOOM+4) +#define F_KEYELLOW (F_KEYRED+1) +#define F_OSSALIT (F_KEYELLOW+1) +#define F_OSSABIG (F_OSSALIT+1) +#define F_VASO (F_OSSABIG+1) // 6 +#define F_PIANTA (F_VASO+6) // 5 +#define F_ALBERO (F_PIANTA+5) // 2 +#define F_LAMP (F_ALBERO+2) // 2+2 = 4 +#define F_LAMPX (F_LAMP+4) +#define F_LAMPOFF (F_LAMPX+1) +#define F_TRESPOLO (F_LAMPOFF+1) // 2 ??? +3 = 5 +#define F_TRESPOLOX (F_TRESPOLO+2) // 1 +#define F_TRESPOLOFF (F_TRESPOLOX+1) +#define F_BRAZIER (F_TRESPOLOFF+1) // 4 +#define F_FUCILE (F_BRAZIER+4) +#define F_MITRA (F_FUCILE+1) +#define F_BAZOOKA (F_MITRA+1) +#define F_FARMALIT (F_BAZOOKA+1) +#define F_FARMABIG (F_FARMALIT+1) +#define F_BONUS (F_FARMABIG+1) // 2 +#define F_SOLDOLIT (F_BONUS+2) +#define F_SOLDOBIG (F_SOLDOLIT+1) +#define F_CARTUCCIA1 (F_SOLDOBIG+1) +#define F_CARTUCCIA2 (F_CARTUCCIA1+1) +#define F_CARTUCCIA3 (F_CARTUCCIA2+1) +#define F_CARTUCCIA4 (F_CARTUCCIA3+1) +#define F_BOOM (F_CARTUCCIA4+1) // 12 +#define F_BLOOD (F_BOOM+12) // 5 +#define F_SMOG (F_BLOOD+5) // 3 +#define F_TESCHIO (F_SMOG+3) // 2 +#define F_BOMB (F_TESCHIO+2) // 15 +#define F_CIRCLIGHT (F_BOMB+15) +#define F_SPIKELIGHT (F_CIRCLIGHT+1) +#define F_TORCLIGHT (F_SPIKELIGHT+1) +#define F_LAMPLIGHT (F_TORCLIGHT+1) +#define F_ANTIKAOS (F_LAMPLIGHT+1) // 9 +#define FIGNUM (F_ANTIKAOS+9) // ! + +// Non servono a niente... +#define GRID_DX 64 +#define GRID_DY 64 +#define MAP_DX 64 +#define MAP_DY 64 +#define MAPDIM (MAP_DX*MAP_DY) +// #define xytoidx(_x,_y) ((_x & 0x7fc0) + (_y >> 6)) +#define bxytoidx(_bx,_by) ((_bx << 6) + _by) + +#define MAX_X (MAP_DX << 6) +#define MAX_Y (MAP_DY << 6) +#define LMAX_X ((long)MAX_X << FIXSHIFT) +#define LMAX_Y ((long)MAX_Y << FIXSHIFT) + +#define MAXOBJECTS 640 // 512 +#define MAXACTORS 400 // 384 +#define MAXDRAWING 128 +#define MAXTEXTURES TEXTNUM +#define MAXFIGURES FIGNUM + +// Shade Management +/* +#define MAXSHADE 16 // 31 +#define HISHMASK 0xf0 +#define LOSHMASK 0x0f +#define SHC_FRONT 8 // (8) ! 2^ ! +#define SHO_FRONT 2 // (3) +#define SHC_LAT 14 // (14) ! 2^ ! +#define SHO_LAT 2 // (3) +#define SHC_BACK 8 // (8) ! 2^ ! +#define SHO_BACK 6 // (2) +*/ + +// Secret Codes +#define SC_MNNico 1 +#define SC_MNMaxy 2 +#define SC_MNAndy 3 +#define SC_MNLev 4 +#define SC_MNStrg 5 +#define SC_MNTMap 6 +#define SC_MNBest 7 +#define SC_MNDark 8 +#define SC_MNBoom 9 +#define SC_MNBGod 10 +#define SC_MNHard 11 +#define SC_MNInvi 12 + +// flags operations +#define GETFLAG(data,flag) ((data & flag) != 0) +#define GETEFLAG(data,flag) ((data & flag) == flag) +#define SETFLAG(data,flag) (data |= flag) +#define CLRFLAG(data,flag) (data &= ~flag) +#define CHGFLAG(data,flag) (data ^= flag) +#define MAKEFLAG(data,flag,bit) data = bit ? (data | flag) : (data & ~flag) + +// *** Map Struct *** +// Map shapes +#define MSH_SQUARE 0 +#define MSH_VERT 1 +#define MSH_HORIZ 2 +#define MSH_DIAG1 3 +#define MSH_DIAG2 4 +#define MSH_DOOR 5 +#define MAPSHAPE(X) (X<<8) +// Map types +#define MTP_WALL 0 +#define MTP_DOOR1 1 // apertura da sinistra +#define MTP_DOOR2 2 // apertura centrale +#define MTP_GRID1 3 // grata passo 4-8 +#define MTP_SLOT 4 +#define MAPTYPE(X) (X<<11) +// Map flags +#define MFL_NONE 0x4000 +#define MFL_STOP 0x8000 +typedef struct { // 16 bits structure + byte data : 8; + byte shape : 3; + byte type : 3; + byte none : 1; // ??? + byte stop : 1; // present something + } TMapInfo; +// Object Map Flags - for WORD compatibility +#define OMF_UNWALKABLE 0x1000 +#define OMF_VISIBLE 0x0100 +#define OMF_HITABLE 0x0010 +#define OMF_SOUNDABLE 0x0001 +#define OMF_STANDARD 0x1111 +// Object Map Mask - for extended ray-caster +#define OMM_UNWALKABLE 0xF000 +#define OMM_VISIBLE 0x0F00 +#define OMM_HITABLE 0x00F0 +#define OMM_SOUNDABLE 0x000F +typedef struct { // 16 bits structure đ 1 word + byte soundable : 4; + byte hitable : 4; + byte visible : 4; + byte unwalkable : 4; + } TObjInfo; + +#define SND_THUNDER1 0 +#define SND_THUNDER2 1 +#define SND_GOCCIA 2 +#define SND_BOOM 3 +#define SND_BUB 4 +#define SND_TOPO 5 +#define SND_KEYS 6 +#define SND_PISTOLA 7 +#define SND_FUCILE 8 +#define SND_MITRA 9 +#define SND_MISSILE 10 +#define SND_SLIME1 11 +#define SND_SLIME2 12 +#define SND_PASSO 13 +#define SND_PORTA1 14 +#define SND_PORTA2 15 +#define SND_SCODE 16 +#define SND_PROIETTILE 17 +#define SND_VASO1 18 +#define SND_VASO2 19 +#define SND_COLPO1 20 +#define SND_COLPO2 21 +#define SND_TOGGLE 22 +#define SND_WIND 23 +#define SND_FIRE 24 +#define SND_MISSILGO 25 +#define SND_UNLOCK 26 +#define SND_CLOSE 27 +#define SND_GLASS 28 +#define SND_PASSO2 29 +#define SND_SOLDDEAD 30 +#define SND_SLIMDEAD 31 +#define SND_SPIDDEAD 32 +#define SND_SOLDATT 33 +#define SND_SLIMATT 34 +#define SND_SPIDATT 35 +#define SND_CLOCK 36 +#define SND_CLOCK2 37 +#define SND_SPIDNEAR 38 +#define SND_CHARGE 39 +#define SND_CHARGE2 40 +#define SND_SOLDDOWN 41 +#define SND_SLIMDOWN 42 +#define SND_SPIDDOWN 43 +#define SND_OSSA 44 +#define SND_VENOM 45 +#define SND_RISATA 46 +#define SND_BONUS 47 +#define SND_ASCIAHIT 48 +#define SND_SOLDHIT 49 +#define SND_SLIMHIT 50 +#define SND_SPIDHIT 51 +#define SND_BBOUNCE 52 +// occhio a MAXSNDDATA in 3dsound.hpp !!! + +// Lock types +#define LCKT_NONE 0x00 +#define LCKT_L1 0x01 // yellow key +#define LCKT_L2 0x02 // red key +// #define LCKT_L3 0x04 +// #define LCKT_L4 0x08 + +// Palette animations +#define PAA_RED 1 +#define PAA_GREEN 2 +#define PAA_GOLD 3 +#define PAA_YKEY 4 +#define PAA_RKEY 5 +#define PAA_ARM 6 +#define PAA_GOD 7 +#define PAA_UNGOD 8 +#define PAA_FADEIN 9 +#define PAA_FADEOUT 10 +#define PAA_LIGHT 11 +#define PAA_HARD 12 +#define PAA_UNHARD 13 + +// The entire world of Object Types (for load/save routines) +#define OBJT_OBJECT 0 +#define OBJT_ACTOR 1 +#define OBJT_LIGHTACTOR 2 +#define OBJT_CANFIREACTOR 3 +#define OBJT_OSSA 4 +#define OBJT_FLOSSA 5 +#define OBJT_BONUS 6 +#define OBJT_SLIMER 7 +#define OBJT_SPIDER 8 +#define OBJT_SOLDIER 9 +#define OBJT_MOUSE 10 +#define OBJT_FIREBOOM 11 +#define OBJT_FIREBALL 12 +#define OBJT_TORCIA 13 +#define OBJT_LAMPADARIO 14 +#define OBJT_BARILE 15 +#define OBJT_VASO 16 +#define OBJT_PLAYER 17 +#define OBJT_OBJMOVER 18 +#define OBJT_BOMB 19 +#define OBJT_ANTIKAOS 20 +#define OBJT_END 32 + +// Arms +#define ARM_ASCIA 0 +#define ARM_PISTOLA 1 +#define ARM_FUCILE 2 +#define ARM_MITRA 3 +#define ARM_BAZOOKA 4 +#define ARM_BOMB 5 +//#define ARM_FIREBALL 6 + +// Statistics Types +#define STT_KILL 0 +#define STT_HIT 1 +#define STT_FIRE 2 +#define STT_BLOOD 3 +#define STT_TECNO 4 + +// game flags +#define GFL_USESYNC 0x01 +#define GFL_AUTOCENTER 0x02 +#define GFL_SHOWBLOOD 0x04 +#define GFL_KAOSENABLE 0x08 +#define GFL_MESSAGES 0x10 +#define GFL_TOTALMAP 0x20 +#define GFL_NORANDOM 0x40 +#define GFL_COMPETITIVE 0x80 + +typedef struct { + byte dx, dy; + int height; + int memidx, xxx; + } TFigure; +typedef struct { + int dx, dy, memidx; + } TFig; +typedef struct { + char up, down, left, right, + open, fire, fast, strafe, chgarm, + lookup, lookmid, lookdown, map; + } TControl; + +extern TMapInfo *Map; +extern TObjInfo *ObjMap; +extern int *IDMap; +extern char *LightMap; +extern TFigure FigList[MAXFIGURES]; + +extern char players; +extern byte gameflags; +/* +extern char usesync, autocenter, totalmap, + norandom, showblood, competitive; +*/ +extern char quake; // C'Š anche Quake !? No, Š il terremoto ! +extern int windsound; +extern int cbackg0,fbackg0,cbackg1,fbackg1; +extern TFig *litnumf, *normnumf, *bignumf; +extern TFig *happyface; +extern word maxdim; +extern int menustate; +extern char viewstate; +extern int PlayerAscia[3],PlayerPist[3],PlayerFuc[3],PlayerMitr[5], + PlayerBaz; +extern int playbackhandle; +extern int numenemies; +// extern char Kaos_enable; // !!!K +extern int Kaos_count; // !!!K +extern int minibox_I, minibox_F; + +extern TControl PControl[4]; + +extern int xytoidx(long x, long y); +extern int is_nearPlayer(long x, long y, long maxdist); +extern void drawnum(int x, int y, byte col1, byte col2, + TFig *numfont, int num); +extern void animpal(byte animnum, int rep); \ No newline at end of file diff --git a/KaosSrc/kaosc.hpp b/KaosSrc/kaosc.hpp new file mode 100644 index 0000000..9fd7421 --- /dev/null +++ b/KaosSrc/kaosc.hpp @@ -0,0 +1,206 @@ +/************************************************************************ + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + ************************************************************************/ + +#define T_WALL1 0 +#define T_WALL1M 1 +#define T_WALL1S 2 +#define T_WALL1MS 3 +#define T_WALL1SS 4 +#define T_WALL1MSS 5 +#define T_TAP 6 +#define T_TAPM 7 +#define T_TAPS 8 +#define T_TAPMS 9 +#define T_TAPSS 10 +#define T_TAPMSS 11 +#define T_SCUDO 12 +#define T_SCUDOM 13 +#define T_SCUDOS 14 +#define T_SCUDOMS 15 +#define T_SCUDOSS 16 +#define T_SCUDOMSS 17 +#define T_ARC 18 +#define T_ARCM 19 +#define T_PIETR1 20 +#define T_PIETR1M 21 +#define T_PIETR1S 22 +#define T_PIETR1MS 23 +#define T_PIETR1SS 24 +#define T_PIETR1MSS 25 +#define T_ASCE 26 +#define T_ASCEM 27 +#define T_ASCES 28 +#define T_ASCEMS 29 +#define T_ASCESS 30 +#define T_ASCEMSS 31 +#define T_ROCK 32 +#define T_ROCKS 33 +#define T_ROCKSS 34 +#define T_WOOD1 35 +#define T_WOOD1S 36 +#define T_WOOD1SS 37 +#define T_WBOX 38 +#define T_WBOXS 39 +#define T_WBOXSS 40 +#define T_DOOR1 41 +#define T_DOOR1S 42 +#define T_DOOR2 43 +#define T_DOOR2S 44 +#define T_DOORY 45 +#define T_DOORYS 46 +#define T_DOORR 47 +#define T_DOORRS 48 +#define T_WOOD2 49 +#define T_WOOD2S 50 +#define T_WOOD2SS 51 +#define T_SBARRE 52 +#define T_SBARRES 53 +#define T_SWITCHU 54 + +#define T_WALL1Z 55 +#define T_WALL1MZ 56 +#define T_PIETR1Z 57 +#define T_PIETR1MZ 58 +#define T_ROCKZ 59 +#define T_WOOD1Z 60 +#define T_WBOXZ 61 +#define T_WOOD2Z 62 +#define T_WALL2 63 +#define T_WALL2M 64 +#define T_WALL2Z 65 +#define T_WALL2MZ 66 +#define T_PIETR2 67 +#define T_PIETR2M 68 +#define T_PIETR2Z 69 +#define T_PIETR2MZ 70 +#define T_EARTH 71 +#define T_EARTHZ 72 +#define T_SOFT 73 +#define T_SOFTM 74 +#define T_SOFTZ 75 +#define T_SOFTMZ 76 + +#define T_DRAGON 77 // 9 + +//#define T_NONE1-2-3 +#define T_GRATAW 86 +#define T_GRATAWZ 87 +#define T_GRATAB 88 +#define T_GRATABZ 89 +#define T_FLROCK 90 +#define T_FLROCKZ 91 +//#define T_GRIGLIA 83 +#define T_OVERDOOR 92 +#define T_DOORSLOT 93 +#define T_SWITCHD 94 + +#define T_TRANSP T_GRATAW +#define TEXTNUM (T_SWITCHD+1) + +#define T_TEXTURES (TEXTNUM) +#define T_OBJECTS (T_TEXTURES+36+18) // i 18 sono quelli dei vasi +#define T_ENEMIES (T_OBJECTS+12) +#define T_PLAYERS (T_ENEMIES+12) + +#define F_PLAYER 0 // 8+8+8+8+2+5 = 39 +#define F_SOLDIER (F_PLAYER+39) // 8+8+8+4+2+5 = 35 +#define F_SLIMER (F_SOLDIER+35) // 5+5+4+2+6 = 22 +#define F_BUB (F_SLIMER+22) // 5+5+2+2+6 = 20 +#define F_FACE (F_BUB+20) // 5+5+2+5 = 17 +#define F_SPIDER (F_FACE+17) // 5+5+2+2+5 = 19 +#define F_MOUSE (F_SPIDER+19) // 5+5 = 10 +#define F_MISSILE (F_MOUSE+10) // 5 +#define F_FIREBALL (F_MISSILE+5) +#define F_SLIMFIRE (F_FIREBALL+1) // 2 +#define F_SPIDFIRE (F_SLIMFIRE+2) // 4 +#define F_TORCIA (F_SPIDFIRE+4) // 4 +#define F_TORCIAM (F_TORCIA+4) // 4 +#define F_COLUMN (F_TORCIAM+4) +#define F_COLUMNM (F_COLUMN+1) +#define F_BARILE (F_COLUMNM+1) // 5 +#define F_BARILX (F_BARILE+5) +#define F_FIREBOOM (F_BARILX+1) // 4 +#define F_KEYRED (F_FIREBOOM+4) +#define F_KEYELLOW (F_KEYRED+1) +#define F_OSSALIT (F_KEYELLOW+1) +#define F_OSSABIG (F_OSSALIT+1) +#define F_VASO (F_OSSABIG+1) // 6 +#define F_PIANTA (F_VASO+6) // 5 +#define F_ALBERO (F_PIANTA+5) // 2 +#define F_LAMP (F_ALBERO+2) // 2+2 = 4 +#define F_LAMPX (F_LAMP+4) +#define F_LAMPOFF (F_LAMPX+1) +#define F_TRESPOLO (F_LAMPOFF+1) // 2 ??? +3 = 5 +#define F_TRESPOLOX (F_TRESPOLO+2) // 1 +#define F_TRESPOLOFF (F_TRESPOLOX+1) +#define F_BRAZIER (F_TRESPOLOFF+1) // 4 +#define F_FUCILE (F_BRAZIER+4) +#define F_MITRA (F_FUCILE+1) +#define F_BAZOOKA (F_MITRA+1) +#define F_FARMALIT (F_BAZOOKA+1) +#define F_FARMABIG (F_FARMALIT+1) +#define F_BONUS (F_FARMABIG+1) // 2 +#define F_SOLDOLIT (F_BONUS+2) +#define F_SOLDOBIG (F_SOLDOLIT+1) +#define F_CARTUCCIA1 (F_SOLDOBIG+1) +#define F_CARTUCCIA2 (F_CARTUCCIA1+1) +#define F_CARTUCCIA3 (F_CARTUCCIA2+1) +#define F_CARTUCCIA4 (F_CARTUCCIA3+1) +#define F_BOOM (F_CARTUCCIA4+1) // 12 +#define F_BLOOD (F_BOOM+12) // 5 +#define F_SMOG (F_BLOOD+5) // 3 +#define F_TESCHIO (F_SMOG+3) // 2 +#define F_BOMB (F_TESCHIO+2) // 15 +#define F_CIRCLIGHT (F_BOMB+15) +#define F_SPIKELIGHT (F_CIRCLIGHT+1) +#define F_TORCLIGHT (F_SPIKELIGHT+1) +#define F_LAMPLIGHT (F_TORCLIGHT+1) +#define F_ANTIKAOS (F_LAMPLIGHT+1) // 9 +#define FIGNUM (F_ANTIKAOS+9) // ! +// *** Map Struct *** +// Map shapes +#define MSH_SQUARE 0 +#define MSH_VERT 1 +#define MSH_HORIZ 2 +#define MSH_DIAG1 3 +#define MSH_DIAG2 4 +#define MSH_DOOR 5 +#define MAPSHAPE(X) (X<<8) +// Map types +#define MTP_WALL 0 +#define MTP_DOOR1 1 // apertura da sinistra +#define MTP_DOOR2 2 // apertura centrale +#define MTP_GRID1 3 // grata passo 4-8 +#define MTP_SLOT 4 +#define MAPTYPE(X) (X<<11) +// Map flags +#define MFL_NONE 0x4000 +#define MFL_STOP 0x8000 +typedef struct { // 16 bits structure + byte data : 8; + byte shape : 3; + byte type : 3; + byte none : 1; // ??? + byte stop : 1; // present something + } TMapInfo; +// Object Map Flags - for WORD compatibility +#define OMF_UNWALKABLE 0x1000 +#define OMF_VISIBLE 0x0100 +#define OMF_HITABLE 0x0010 +#define OMF_SOUNDABLE 0x0001 +#define OMF_STANDARD 0x1111 +// Object Map Mask - for extended ray-caster +#define OMM_UNWALKABLE 0xF000 +#define OMM_VISIBLE 0x0F00 +#define OMM_HITABLE 0x00F0 +#define OMM_SOUNDABLE 0x000F +typedef struct { // 16 bits structure đ 1 word + byte soundable : 4; + byte hitable : 4; + byte visible : 4; + byte unwalkable : 4; + } TObjInfo; diff --git a/KaosSrc/key.cpp b/KaosSrc/key.cpp new file mode 100644 index 0000000..15b9cee --- /dev/null +++ b/KaosSrc/key.cpp @@ -0,0 +1,129 @@ +/************************************************************************ + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + ************************************************************************/ + +// KEY - (C)1997 Nicosoźt (Valentini Domenico) + +#include +#include +#include "std.hpp" +#include "fastmem.hpp" +#include "key.hpp" + +char Key[129], CodeAr[6]; +static char KeyP[129]; +const char TMat[50] = "1234567890 QWERTYUIOP ASDFGHJKL ZXCVBNM"; +static void interrupt (*oldhandler)(...); +char key_installed = 0, + key_pause = 0, + key_extended = 0, + oldcall = 0; + +static void interrupt newkeyISR(...) { + register word data, scan, x; + scan = (data = inportb(0x60)) & 0x7F; + outportb(0x61,(x=inportb(0x61))|0x80); + outportb(0x61,x); + if (data==0xe1) key_pause=1; else + if (data==0xe0) key_extended=1; else { + KeyP[scan] |= Key[scan] = (data<128); + /* + if (scan==KB_LSHIFT || scan==KB_RSHIFT) + Key[KB_SHIFT] = Key[KB_LSHIFT]|Key[KB_RSHIFT]; + */ + if (data!=KB_F4 && data<51 && data>=2) { + for (x=0; x<5; x++) CodeAr[x] = CodeAr[x+1]-1; + CodeAr[5] = TMat[data-2]+5; + } + key_extended=0; + } + if (oldcall) + oldhandler(); + else + outportb(0x20,0x20); +} + +char kb_pressed(byte c) { + if (c) { + char press = KeyP[c] | Key[c]; + KeyP[c] = 0; + return press; + } + return 0; +} + +char kb_onepressed(byte c) { + char press = KeyP[c]; + KeyP[c] = 0; + return press; +} + +void kb_presskey(byte c) { + if (c<128) { + KeyP[c]=Key[c]=1; + } +} + +void kb_releasekey(byte c) { + if (c<128) { + Key[c]=0; + } +} + +void kb_reset() { + fwfill(Key,0,sizeof(Key)); + fwfill(KeyP,0,sizeof(KeyP)); + if (oldcall) + while(kbhit()) getch(); +} + +void kb_initkey() { + if (key_installed) return; + key_installed++; + oldcall=0; + disable(); + oldhandler = getvect(0x09); + setvect(0x09, newkeyISR); + enable(); + kb_reset(); + // Rallenta la tastiera (cosŤ diminuiscono le interruzioni) + asm { + MOV AX, 0x0305 + MOV BX, 0x031f + INT 0x16 + } +} + +void kb_enablestd() { + if (key_installed && !oldcall) { + oldcall=1; + kb_reset(); + } +} + +void kb_disablestd() { + if (key_installed && oldcall) { + oldcall=0; + kb_reset(); + } +} + +void kb_donekey(void) { + if (!key_installed) return; + key_installed--; + disable(); + setvect(0x09, oldhandler); + enable(); + //oldcall=1; + // Respeed-up ... + asm { + MOV AX, 0x0305 + MOV BX, 0x0000 + INT 0x16 + } +} + +#pragma exit kb_donekey 100 \ No newline at end of file diff --git a/KaosSrc/key.hpp b/KaosSrc/key.hpp new file mode 100644 index 0000000..2a9eb93 --- /dev/null +++ b/KaosSrc/key.hpp @@ -0,0 +1,92 @@ +/************************************************************************ + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + ************************************************************************/ + +// Codici tastiera +#define KB_NONE 0 +#define KB_UP 72 +#define KB_DOWN 80 +#define KB_LEFT 75 +#define KB_RIGHT 77 +#define KB_ALT 56 +#define KB_SHIFT 128 // unificati L & R (Š uno scancode virtuale !) +#define KB_LSHIFT 42 +#define KB_RSHIFT 54 // inaffidabile (!?) +#define KB_CTRL 29 +#define KB_SPACE 57 +#define KB_ESC 1 +#define KB_ENTER 28 +#define KB_t1 79 +#define KB_t3 81 +#define KB_t5 76 +#define KB_t7 71 +#define KB_t0 82 +#define KB_CANC 83 +#define KB_tENTER 28 +#define KB_tPLUS 78 +#define KB_Z 44 +#define KB_X 45 + +#define KB_Q 16 +#define KB_E 18 +#define KB_A 30 +#define KB_S 31 +#define KB_D 32 +#define KB_F 33 +#define KB_TAB 15 +#define KB_BSLASH 41 + +#define KB_P 25 +#define KB_O_ 39 +#define KB_L 38 +#define KB_A_ 40 +#define KB_M 50 +#define KB_H 35 +#define KB_J 36 +#define KB_K 37 +#define KB_U 22 +#define KB_COMMA 51 + +#define KB_F1 59 +#define KB_F2 60 +#define KB_F3 61 +#define KB_F4 62 +#define KB_F5 63 +#define KB_F6 64 +#define KB_F7 65 +#define KB_F8 66 +#define KB_F9 67 +#define KB_F10 68 +#define KB_F11 87 +#define KB_F12 88 + +#define KB_1 2 +#define KB_2 3 +#define KB_3 4 +#define KB_4 5 +#define KB_5 6 +#define KB_6 7 +#define KB_7 8 +#define KB_8 9 +#define KB_9 10 +#define KB_0 11 +#define KB_12 12 +#define KB_13 13 +#define KB_SLASH 53 +#define KB_PER 55 +#define KB_MINUS 74 + +extern char Key[129], CodeAr[6], key_pause; +// extern char KeyP[129]; +extern char kb_pressed(byte c); +extern char kb_onepressed(byte c); +extern void kb_presskey(byte c); +extern void kb_releasekey(byte c); +extern void kb_reset(); +extern void kb_initkey(); +extern void kb_enablestd(); +extern void kb_disablestd(); +extern void kb_donekey(); \ No newline at end of file diff --git a/KaosSrc/lfont2.cpp b/KaosSrc/lfont2.cpp new file mode 100644 index 0000000..a3b04fc --- /dev/null +++ b/KaosSrc/lfont2.cpp @@ -0,0 +1,234 @@ +/************************************************************************ + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + ************************************************************************/ + +// LFont - font in LMode - (C)1997 NicoSoźt (Valentini Domenico) + +#include "std.hpp" +#include "errorstr.hpp" +#include "fastmem.hpp" +#include "mm4.hpp" +#include +#include +#include +#include "std.hpp" +#include "lfont2.hpp" +#include "lgraph.hpp" +#include "crcio.hpp" + +const char idLFN[9] = "NIClfn\x7\x1a"; + +int Font::charidx(unsigned char c) { + if (c >= FIRSTCHAR && c <= LASTCHAR) return c-FIRSTCHAR; + else return -1; +} + +Font::Font(const char *filename) + :displx(0), disply(0) { + char nome[13]; + char id[9] = "........"; + int i,handle,size; + + fdfill(font,0l,sizeof font); + strcpy(nome,filename); + strcat(nome,".LFN"); + if ((handle = CRC_openread(nome)) >= 0) { + CRC_read(handle,id,8); + if (fwcomp(&id,(void *)&idLFN,8)) { + CRC_read(handle,&height,sizeof height); + CRC_read(handle,&spacelen,sizeof spacelen); + for (i=0;i= 0) { + freechar(idx); + + int ix,iy,maxx=1,maxy=1; + for (ix=0;ix=maxy) maxy=iy+1; + maxx=ix+1; + } + + TCharFig &fig = font[idx]; + fig.dx = maxx; + fig.dy = maxy; + fig.data = (char *)mm_reserve(maxx*maxy); + getlfig(x,y,maxx,maxy,fig.data); + } +} + +void Font::freechar(char idx) { + if (idx >= 0) { + TCharFig &fig = font[idx]; + if (fig.data != NULL) { + delete fig.data; // free(fig.data); + fig.data = NULL; + } + } +} + +void Font::write(int x, int y, char col1, char col2, const char *str) { + int idx; + while (*str) { + if ((idx = charidx(*str)) >= 0) { + TCharFig &fig = font[idx]; + if (fig.dx) putlchar(x,y,fig.dx,fig.dy,col1,col2,fig.data); + x+=fig.dx+displx; + } else + if (*str == ' ') x+=spacelen+displx; + str++; + } +} + +void Font::writeclip(int x, int y, char col1, char col2, const char *str) { + int idx; + while (*str) { + if ((idx = charidx(*str)) >= 0) { + TCharFig &fig = font[idx]; + if (fig.dx) putlcchar(x,y,fig.dx,fig.dy,col1,col2,fig.data); + x+=fig.dx+displx; + } else + if (*str == ' ') x+=spacelen+displx; + str++; + } +} + +void Font::colorwrite(int x, int y, byte shade, const char *str) { + int idx; + while (*str) { + if ((idx = charidx(*str)) >= 0) { + TCharFig &fig = font[idx]; + if (fig.dx) putlschar(x,y,fig.dx,fig.dy,shade,fig.data); + x+=fig.dx+displx; + } else + if (*str == ' ') x+=spacelen+displx; + str++; + } +} + +int Font::writelen(const char *str) { + int idx, len = 0; + while (*str) { + if ((idx = charidx(*str)) >= 0) len+=font[idx].dx+displx; + else if (*str == ' ') len+=spacelen+displx; + str++; + } + return len; +} + +/* +void writeclip(unsigned dest, int x, int y, + char col1, char col2, + unsigned maxlen, char center, const char *str); +*/ + +void Font::save(const char *filename) { + char nome[13]; + int i,handle; + + strcpy(nome,filename); + strcat(nome,".LFN"); + if ((handle = CRC_openwrite(nome)) >= 0) { + CRC_write(handle,(void *)&idLFN,8); + CRC_write(handle,&height,sizeof height); + CRC_write(handle,&spacelen,sizeof spacelen); + for (i=0;ilg_maxx) vdx = lg_maxx-x+1; + else vdx = dex; + if (vdx<=0) return; + minx = lg_minx; + miny = lg_miny; maxy = lg_maxy; +asm { + LES DI, vbuff + LDS SI, data + MOV AX, y + SAL AX, 6 + MOV BX, AX + SAL BX, 2 + ADD AX, BX + ADD AX, x + ADD DI, AX + //CLD no MOVS o LODS + MOV savesi, SI + MOV DX, DI + MOV BX, dey +} cic: asm { + MOV AX, y + CMP AX, miny + JL passy + CMP AX, maxy + JG end + MOV SI, savesi + MOV DI, DX + MOV CX, vdx +} cic1: asm { + MOV AX, x + CMP AX, minx + JL nopix + MOV AL, [SI] + MOV ES:[DI], AL +} nopix: asm { + INC SI + INC DI + INC x + LOOP cic1 + MOV AX, vdx + SUB x, AX +} passy: asm { + MOV AX, dex + ADD savesi, AX + ADD DX, 320 + INC y + DEC BX + JNZ cic +} end: asm { + // !!! SS==DS !!! + MOV BX, SS + MOV DS, BX + //POP DS +}} + +void putlcfig(int x, int y, word dex, word dey, void far *data) { + int vdx, minx, miny, maxy; + word savesi; + if (x+dex<=lg_minx || y+dey<=lg_miny) return; + if (x+dex>lg_maxx) vdx = lg_maxx-x+1; + else vdx = dex; + if (vdx<=0) return; + minx = lg_minx; + miny = lg_miny; maxy = lg_maxy; +asm { + LES DI, vbuff + LDS SI, data + MOV AX, y + SAL AX, 6 + MOV BX, AX + SHL BX, 2 + ADD AX, BX + ADD AX, x + ADD DI, AX + /* + XCHG AH, AL + ADD DI, AX + SAR AX, 2 + ADD DI, AX + ADD DI, x + */ + // CLD no MOVS o LODS + MOV savesi, SI + MOV DX, DI + MOV BX, dey +} cic: asm { + MOV AX, y + CMP AX, miny + JL passy + CMP AX, maxy + JG end + MOV SI, savesi + MOV DI, DX + MOV CX, vdx +} cic1: asm { + MOV AX, x + CMP AX, minx + JL nopix + MOV AL, [SI] + OR AL, AL + JZ nopix + MOV ES:[DI], AL +} nopix: asm { + INC SI + INC DI + INC x + LOOP cic1 + MOV AX, vdx + SUB x, AX +} passy: asm { + MOV AX, dex + ADD savesi, AX + ADD DX, 320 + INC y + DEC BX + JNZ cic +} end: asm { + // !!! SS==DS !!! + MOV BX, SS + MOV DS, BX + //POP DS +}} + +void putlcchar(int x, int y, word dex, word dey, + byte col1, byte col2, void far *data) { + int vdx, minx, miny, maxy; + word savesi; + if (x+dex<=lg_minx || y+dey<=lg_miny) return; + if (x+dex>lg_maxx) vdx = lg_maxx-x+1; + else vdx = dex; + if (vdx<=0) return; + minx = lg_minx; + miny = lg_miny; maxy = lg_maxy; +asm { + LES DI, vbuff + LDS SI, data + MOV AX, y + SAL AX, 6 + MOV BX, AX + SHL BX, 2 + ADD AX, BX + ADD AX, x + ADD DI, AX + /* + XCHG AH, AL + ADD DI, AX + SAR AX, 2 + ADD DI, AX + ADD DI, x + */ + // CLD no MOVS o LODS + MOV savesi, SI + MOV DX, DI + MOV BX, dey +} cic: asm { + MOV AX, y + CMP AX, miny + JL passy + CMP AX, maxy + JG end + MOV SI, savesi + MOV DI, DX + MOV CX, vdx +} cic1: asm { + MOV AX, x + CMP AX, minx + JL nopix + MOV AL, [SI] + OR AL, AL + JZ nopix + CMP AL, 1 + JNE test2 + MOV AL, col1 + JMP store +} test2: asm { + CMP AL, 2 + JNE store + MOV AL, col2 +} store: asm { + MOV ES:[DI], AL +} nopix: asm { + INC SI + INC DI + INC x + LOOP cic1 + MOV AX, vdx + SUB x, AX +} passy: asm { + MOV AX, dex + ADD savesi, AX + ADD DX, 320 + INC y + DEC BX + JNZ cic +} end: asm { + // !!! SS==DS !!! + MOV BX, SS + MOV DS, BX + //POP DS +}} + +void storelmfig(word x, word y, word dex, word dey, + void far *mask, void far *data) { +int displ, cnt; +asm { + //PUSH DS + LES DI, vbuff + LDS SI, mask + MOV AX, y + XCHG AH, AL + ADD DI, AX + SHR AX, 2 + ADD DI, AX + ADD DI, x + + MOV AX, 320 + SUB AX, dex + MOV displ, AX + // CLD no MOVS o LODS + XOR BX, BX + MOV DX, dey +} cic: asm { + MOV CX, dex +} cici: asm { + CMP BYTE PTR [SI+BX], 0 + JE nopix + LDS SI, data + MOV AL, [SI+BX] + MOV ES:[DI], AL + LDS SI, mask +} nopix: asm { + INC DI + INC BX + LOOP cici + ADD DI, displ + DEC DX + JNZ cic + // !!! SS==DS !!! + MOV AX, SS + MOV DS, AX + //POP DS +}} + +void scalerscfig(int x, int y, word dex, word dey, int vdx, int vdy, + char shade, void far *rfig) { + word savedi, totresx, left = lg_minx, right = lg_maxx; + fixed adjy, adjx, adjo; + + if (!rfig) return; + +asm { + XOR AX, AX + MOV WORD PTR adjx, AX + MOV WORD PTR adjy, AX + MOV AX, dex + MOV WORD PTR adjx[2], AX + MOV AX, dey + MOV WORD PTR adjy[2], AX +} + adjx = fixdiv(adjx,vdx); + adjy = fixdiv(adjy,vdy); + if (y < lg_miny) { + adjo = adjy * (lg_miny-y); + vdy += y; + y = lg_miny; + } else adjo = 0l; + if (y+vdy-1>lg_maxy) vdy = lg_maxy+1-y; + if (vdy<=0) return; // !!! serve ? +asm { + //PUSH DS + MOV totresx, 0 + MOV AX, WORD PTR adjx[2] + OR AX, AX + JZ nomul + MOV BX, dey + MUL BX + MOV WORD PTR adjx[2], AX +} nomul: asm { + LES DI, vbuff + /* + MOV AX, 0xA000 + MOV ES, AX + XOR DI, DI + */ + MOV AX, y + XCHG AH, AL + ADD DI, AX + SHR AX, 2 + ADD DI, AX + MOV BX, x + ADD DI, BX + + LDS SI, rfig // !!! + // CLD no MOVS o LODS + MOV CX, vdx + JCXZ end // !!! serve ? + MOV savedi, DI +} ini: asm { + PUSH CX + + MOV BX, x + CMP BX, left + // JL clipx + JGE gomax + JMP clipx +} gomax: asm { + CMP BX, right + // JG hardend + JLE gomask + JMP hardend +} gomask: asm { + MOV DI, savedi + MOV SI, WORD PTR rfig + + MOV CX, vdy + ADD SI, WORD PTR adjo[2] + MOV DX, WORD PTR adjo + MOV BX, WORD PTR adjy[2] +} draw: asm { + MOV AL, [SI] + OR AL, AL + JZ noplot + + // Shader + MOV AH, AL + ADD AL, shade + XOR AH, AL + AND AH, 0xf0/*HISHMASK*/ + JZ store + XOR AL, AH + OR AL, 0x0f/*LOSHMASK*/ + +} store: asm { + MOV ES:[DI], AL +} noplot: asm { + ADD DI, 320 + ADD DX, WORD PTR adjy + ADC SI, BX + LOOP draw + +} clipx: asm { + MOV AX, WORD PTR adjx[2] + ADD WORD PTR rfig, AX + MOV AX, WORD PTR adjx + ADD totresx, AX + JNC nocar + MOV AX, dey + ADD WORD PTR rfig, AX +} nocar: asm { + INC x + INC savedi + POP CX + DEC CX + JZ end + JMP ini +} hardend: asm { + POP CX +} end: asm { + // !!! SS==DS !!! + MOV BX, SS + MOV DS, BX + //POP DS +}} + +#pragma warn -rvl +int near swapb(int n) { +asm { + MOV AX, n + XCHG AL, AH +}} +#pragma warn +rvl + +char loadLBM(const char *filename, void far *pal) { + int handle; + form_chunk fchunk; + chunk_header chunkhead; + bitmap_header bmhead; + int rest, len, height; + char data; + char far *pbuf = (char *)vbuff; + + if ((handle = _open(filename,O_RDONLY|O_BINARY)) != -1) { + _read(handle,&fchunk,sizeof(form_chunk)); + if (fchunk.ID_type != CK_FORM) { + _close(handle); + // error("loadLBM - Invalid format"); + return 0; + } + if (fchunk.ID_subtype != ID_PBM) { + _close(handle); + // error("loadLBM - Not a PBM IFF file"); + return 0; + } + while (!eof(handle)) { + _read(handle,&chunkhead,sizeof(chunk_header)); + asm { + MOV DX, WORD PTR chunkhead.cksize + MOV AX, WORD PTR chunkhead.cksize[2] + XCHG AL, AH + XCHG DL, DH + INC AX + ADC DX, 0 + AND AL, 0xfe + MOV WORD PTR chunkhead.cksize, AX + MOV WORD PTR chunkhead.cksize[2], DX + } + if (chunkhead.ID_chunk == ID_BMHD) { + _read(handle,&bmhead,sizeof(bitmap_header)); + bmhead.width = swapb(bmhead.width); + bmhead.height = swapb(bmhead.height); + } else + if (chunkhead.ID_chunk == ID_CMAP) { + if (pal) { + _read(handle,pal,768); // DEVE essere 768 ! + asm { + //PUSH DS + LDS SI, pal + LES DI, pal + MOV CX, 384 + CLD + } cic: asm { + LODSW + SHR AL, 2 + SHR AH, 2 + STOSW + LOOP cic + // !!! SS==DS !!! + MOV BX, SS + MOV DS, BX + //POP DS + } + } else lseek(handle,768,SEEK_CUR); + } else + if (chunkhead.ID_chunk == ID_BODY) { + for (height = bmhead.height; height; height--) { + rest = (bmhead.width+1) & 0x7ffe; + if (bmhead.compression) { + while (rest) { + _read(handle,&data,1); + if (data>0) { + rest -= (len = data+1); + if (_read(handle,pbuf,len) == -1) { + _close(handle); + // error("loadLBM - invalid file"); + return 0; + } + pbuf+=len; + } else { + rest -= (len = (-data)+1); + _read(handle,&data,1); + asm { + LES DI, pbuf + CLD + MOV AL, data + MOV AH, AL + MOV CX, len + SHR CX, 1 + JNC pari + STOSB + } pari: asm { + REP STOSW + MOV WORD PTR pbuf, DI + MOV WORD PTR pbuf[2], ES + } + } + } + } else _read(handle,pbuf,rest); + } + } else lseek(handle,chunkhead.cksize,SEEK_CUR); + } + _close(handle); + return 1; + } + return 0; +} \ No newline at end of file diff --git a/KaosSrc/lgraph.hpp b/KaosSrc/lgraph.hpp new file mode 100644 index 0000000..05758af --- /dev/null +++ b/KaosSrc/lgraph.hpp @@ -0,0 +1,76 @@ +/************************************************************************ + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + ************************************************************************/ + +#define VMEMPTR ((void _seg *)0xA000+(void near *)0x0000) + +#define MakeID(d,c,b,a) ((unsigned long)(a)<<24 | (unsigned long)(b)<<16 | (unsigned long)(c)<<8 | (unsigned long)(d)) +#define CK_FORM MakeID('F','O','R','M') +#define ID_PBM MakeID('P','B','M',' ') +#define ID_ILBM MakeID('I','L','B','M') +#define ID_BMHD MakeID('B','M','H','D') +#define ID_CMAP MakeID('C','M','A','P') +#define ID_BODY MakeID('B','O','D','Y') + +typedef struct { + long ID_type; + long cksize; + long ID_subtype; + } form_chunk; +typedef struct { + long ID_chunk; + long cksize; + } chunk_header; +typedef struct { + unsigned width, height; // raster width & height in pixels + unsigned x, y; // position for this image + unsigned char nPlanes; // # source bitplanes + unsigned char masking; // masking technique + unsigned char compression; // compression algorithm + unsigned char no; // (0) + unsigned transparent; // transparent "color number" + unsigned char x_aspect, y_aspect; // aspect ratio, x/y + unsigned p_width, p_height; // source "page" size in pixels +} bitmap_header; + +extern void far *vbuff; + +extern word xytodisp(word x, word y); +extern void setvrect(int x, int y, int dx, int dy); +extern void initL(); +extern void doneL(); +extern void setvbuff(void far *buff); +extern void putpix(word x, word y, byte col); +extern byte getpix(word x, word y); +extern void ffillscreen(long col); +extern void ffillarea(word y, word dey, long col); +extern void ftransfscreen(void far *dest); +extern void ftransfarea(word y, word dey, void far *dest); +extern void fcopyarea(word y, word y1, word dey, void far *dest); +extern void ffillblock(word x, word y, word dex, word dey, long col); +extern void ftransfblock(word x, word y, word dex, word dey, void far *dest); +extern void fcopyblock(word x, word y, word x1, word y1, + word dex, word dey, void far *dest); +extern void getlfig(word x, word y, word dex, word dey, void far *data); +extern void getrfig(word x, word y, word dex, word dey, void far *data); +extern void storelfig(word x, word y, word dex, word dey, void far *data); +extern void storerfig(word x, word y, word dex, word dey, void far *data); +extern void putlfig(word x, word y, word dex, word dey, void far *data); +extern void putrfig(word x, word y, word dex, word dey, void far *data); +extern void putlchar(word x, word y, word dex, word dey, + byte col1, byte col2, void far *data); +extern void putlschar(word x, word y, word dex, word dey, + byte addcol, void far *data); +extern void getlvfig(int x, int y, word dex, word dey, void far *data); +extern void storelcfig(int x, int y, word dex, word dey, void far *data); +extern void putlcfig(int x, int y, word dex, word dey, void far *data); +extern void putlcchar(int x, int y, word dex, word dey, + byte col1, byte col2, void far *data); +extern void scalerscfig(int x, int y, word dex, word dey, + int vdx, int vdy, char shade, void far *rfig); +extern void storelmfig(word x, word y, word dex, word dey, + void far *mask, void far *data); +extern char loadLBM(const char *filename, void far *pal); \ No newline at end of file diff --git a/KaosSrc/lmouse.cpp b/KaosSrc/lmouse.cpp new file mode 100644 index 0000000..11053b4 --- /dev/null +++ b/KaosSrc/lmouse.cpp @@ -0,0 +1,256 @@ +/************************************************************************ + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + ************************************************************************/ + +// LMOUSE.CPP (LMode Mouse Engine) - (C)1997 NicoSoźt (Valentini Domenico) + +#include "std.hpp" +#include "lgraph.hpp" +#include "lmouse.hpp" + +Mouse mouse; + +byte mousedata[9] = { 0, 255, 0, + 255, 255, 255, + 0, 255, 0}; +byte underdata[9]; + +void far _saveregs _loadds mousehandler() { + byte action = _AL; + int newx = _CX >> 1, + newy = _DX; + byte buts = _BL; + + if (action & MA_MOVES) { + mouse.undraw(); + mouse.refresh(newx,newy,buts); + mouse.draw(); + } else mouse.buttons = buts; +} + +void Mouse::getmouserect(int &x1, int &y1, int &x2, int &y2) { + x1 = curx-cursor.hotx; + y1 = cury-cursor.hoty; + x2 = x1+cursor.dx-1; + y2 = y1+cursor.dy-1; +} + +void Mouse::refresh(int x, int y, byte butt) { + curx = x; + cury = y; + buttons = butt; +} + +void Mouse::draw() { + if (!invisible) { + void far *app = vbuff; + vbuff = VMEMPTR; + asm PUSH DS; + getlvfig(curx-cursor.hotx,cury-cursor.hoty, + under.dx,under.dy,under.data); + asm POP DS; + asm PUSH DS; + putlcfig(curx-cursor.hotx,cury-cursor.hoty, + cursor.dx,cursor.dy,cursor.data); + asm POP DS; + vbuff = app; + } +} + +void Mouse::undraw() { + if (!invisible) { + void far *app = vbuff; + vbuff = VMEMPTR; + asm PUSH DS; + storelcfig(curx-cursor.hotx,cury-cursor.hoty, + under.dx,under.dy,under.data); + asm POP DS; + vbuff = app; + } +} + +Mouse::Mouse() { + invisible = 1; + installed = 0; +} + +char Mouse::install() { + if (installed) return 0; + if (!reset()) return 0; + // Really Hides the mouse + asm { + MOV AX, 2 + INT 0x33 + } + // Install handler + void (far *handler)() = mousehandler; // NECESSARIO !!!??? + asm { + PUSH ES + MOV AX, 0x0c + MOV CX, MA_ALWAYS + LES DX, DWORD PTR handler + INT 0x33 + POP ES + } + setvrect(0,0,320,200); + setrange(0,0,319,199); + go(160,100); + under.data = NULL; + setcursor(NULL); + installed++; + return 1; +} + +char Mouse::reset() { + asm { + XOR AX, AX + INT 0x33 + } + if (_BX == 0xffff) butnum = 2; + else butnum = 3; + return _AH; +} + +void Mouse::show() { + if (invisible) { + asm cli; + invisible--; + draw(); + asm sti; + } +} + +void Mouse::hide() { + if (invisible<0xff) { + asm cli; + undraw(); + invisible++; + asm sti; + } +} + +void Mouse::get(int &x, int &y, byte &butt) { + x = curx; + y = cury; + butt = buttons; +} + +void Mouse::getpos(int &x, int &y) { + x = curx; + y = cury; +} + +byte Mouse::getbuttons() { + return buttons; +} + +void Mouse::go(int x, int y) { + curx = x; + cury = y; +asm { + MOV AX, 4 + MOV CX, x + SHL CX, 1 + MOV DX, y + INT 0x33 +} } + +void Mouse::setxrange(int x1, int x2) { + if (curxx2) go((x1+x2)>>1,cury); + asm { + MOV AX, 7 + MOV CX, x1 + SHL CX, 1 + MOV DX, x2 + SHL DX, 1 + INT 0x33 + } +} + +void Mouse::setyrange(int y1, int y2) { + if (curyy2) go(curx,(y1+y2)>>1); + asm { + MOV AX, 8 + MOV CX, y1 + MOV DX, y2 + INT 0x33 + } +} + +void Mouse::setrange(int x1, int y1, int x2, int y2) { + setxrange(x1,x2); + setyrange(y1,y2); +} + +void Mouse::setcursor(MouseCursor *newcurs) { + hide(); + if (under.data != NULL && under.data != underdata) delete under.data; + if (newcurs == NULL) { + cursor.hotx = 1; + cursor.hoty = 1; + under.dx = cursor.dx = 3; + under.dy = cursor.dy = 3; + cursor.data = /*(char far *)&*/mousedata; + under.data = (char far *)&underdata; + } else { + cursor = *newcurs; + under.dx = cursor.dx; + under.dy = cursor.dy; + under.data = new char[under.dx*under.dy]; + } + show(); +} + +void Mouse::setcursormem(MouseCursor *newcurs, void far *undr) { + hide(); + if (newcurs == NULL) { + cursor.hotx = 1; + cursor.hoty = 1; + under.dx = cursor.dx = 3; + under.dy = cursor.dy = 3; + cursor.data = (char far *)&mousedata; + under.data = (char far *)&underdata; + } else { + cursor = *newcurs; + under.dx = cursor.dx; + under.dy = cursor.dy; + under.data = undr; + } + show(); +} + +void Mouse::update(int x1, int y1, int dx, int dy) { + int _x1, _y1, _x2, _y2, + x2 = x1+dx-1, + y2 = y1+dy-1; + getmouserect(_x1,_y1,_x2,_y2); + // Questa routine di collisione funziona solo se il rettangolo + // del mouse Š pi— piccolo di quello da aggiornare + if ((_x1>=x1 && _x1<=x2 || _x2>=x1 && _x2<=x2) && + (_y1>=y1 && _y1<=y2 || _y2>=y1 && _y2<=y2)) hide(); +} + +void Mouse::uninstall() { + if (!installed) return; + asm { + CLI + PUSH ES + MOV AX, 0x0c + MOV CX, 0 + XOR DX, DX + MOV ES, DX + INT 0x33 + POP ES + STI + } + hide(); + reset(); + installed--; +} + +Mouse::~Mouse() { + uninstall(); +} \ No newline at end of file diff --git a/KaosSrc/lmouse.hpp b/KaosSrc/lmouse.hpp new file mode 100644 index 0000000..d5da6b8 --- /dev/null +++ b/KaosSrc/lmouse.hpp @@ -0,0 +1,62 @@ +/************************************************************************ + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + ************************************************************************/ + +#define MB_LEFT 0x01 +#define MB_RIGHT 0x02 +#define MB_MIDDLE 0x04 + +#define MA_MOVES 0x01 +#define MA_PLEFT 0x02 +#define MA_RLEFT 0x04 +#define MA_PRIGHT 0x08 +#define MA_RRIGHT 0x10 +#define MA_PMIDDLE 0x20 +#define MA_RMIDDLE 0x40 +#define MA_ALWAYS 0x7f + +typedef struct { + int hotx, hoty; + int dx, dy; + void far *data; + } MouseCursor; + +extern void far _saveregs _loadds mousehandler(); + +class Mouse +{ + private: + friend void far mousehandler(); + MouseCursor cursor, under; + char installed; + int curx, cury; + byte butnum, buttons, invisible; + void getmouserect(int &x1, int &y1, int &x2, int &y2); + void refresh(int x, int y, byte butt); + void draw(); + void undraw(); + public: + Mouse(); + char install(); + char reset(); + void show(); + void hide(); + void get(int &x, int &y, byte &butt); + void getpos(int &x, int &y); + byte getbuttons(); + void go(int x, int y); + void setxrange(int x1, int x2); + void setyrange(int y1, int y2); + void setrange(int x1, int y1, int x2, int y2); + void setcursor(MouseCursor *newcurs); + void setcursormem(MouseCursor *newcurs, void far *undr); + void update(int x1, int y1, int dx, int dy); + char visible() { return !invisible; } + void uninstall(); + ~Mouse(); +}; + +extern Mouse mouse; diff --git a/KaosSrc/makebdf.cpp b/KaosSrc/makebdf.cpp new file mode 100644 index 0000000..c61d8b9 --- /dev/null +++ b/KaosSrc/makebdf.cpp @@ -0,0 +1,864 @@ +/************************************************************************ + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + ************************************************************************/ + +// MakeBDF + +#include "std.hpp" +#include "errorstr.hpp" +#include "xms.hpp" +#include "mm4.hpp" +#include "fastmem.hpp" +#include "fixed.h" +#include "lgraph.hpp" +#include "lfont2.hpp" +#include "kaos.hpp" +#include "strlist.hpp" +#include "crcio.hpp" +#include +#include +#include + +#define FIRMdata ((unsigned long)'d'+((unsigned long)'a'<<8)+((unsigned long)'t'<<16)+((unsigned long)'a'<<24)) + +typedef char *PPal; +int none[20]; +/* +TFigure FigList[MAXFIGURES]; + +char players, jmpmode, usesync, autocenter, + totalmap, norandom, showblood; +char quake; // C'Š anche Quake !? No, Š il terremoto ! +int windsound; +int cbackg0,fbackg0,cbackg1,fbackg1; +TFig *litnumf, *normnumf, *bignumf; +TFig *happyface; +word maxdim; +int menustate; +char viewstate; +int PlayerAscia[3],PlayerPist[3],PlayerFuc[3],PlayerMitr[5]; +int playbackhandle; +int numenemies; +char Kaos_enable; // !!!K +int Kaos_count; // !!!K + +TControl PControl[4]; +*/ +void far *vpage = new char[64000]; + +byte ChangeWallText[MAXTEXTURES] = { +T_WALL1S/*T_WALL1*/ ,T_WALL1MS/*T_WALL1M*/, +T_WALL1SS/*T_WALL1S*/ ,T_WALL1MSS/*T_WALL1MS*/, +T_WALL1SS/*T_WALL1SS*/ ,T_WALL1MSS/*T_WALL1MSS*/, +T_TAPS/*T_TAP*/ ,T_TAPMS/*T_TAPM*/, +T_TAPSS/*T_TAPS*/ ,T_TAPMSS/*T_TAPMS*/, +T_TAPSS/*T_TAPSS*/ ,T_TAPMSS/*T_TAPMSS*/, +T_SCUDOS/*T_SCUDO*/ ,T_SCUDOMS/*T_SCUDOM*/, +T_SCUDOSS/*T_SCUDOS*/ ,T_SCUDOMSS/*T_SCUDOMS*/, +T_SCUDOSS/*T_SCUDOSS*/ ,T_SCUDOMSS/*T_SCUDOMSS*/, +T_ARC/*T_ARC*/ ,T_ARCM/*T_ARCM*/, +T_PIETR1S/*T_PIETR1*/ ,T_PIETR1MS/*T_PIETR1M*/, +T_PIETR1SS/*T_PIETR1S*/ ,T_PIETR1MSS/*T_PIETR1MS*/, +T_PIETR1SS/*T_PIETR1SS*/,T_PIETR1MSS/*T_PIETR1MSS*/, +T_ASCES/*T_ASCE*/ ,T_ASCEMS/*T_ASCEM*/, +T_ASCESS/*T_ASCES*/ ,T_ASCEMSS/*T_ASCEMS*/, +T_ASCESS/*T_ASCESS*/ ,T_ASCEMSS/*T_ASCEMSS*/, +T_ROCKS/*T_ROCK*/ ,T_ROCKSS/*T_ROCKS*/, +T_ROCKSS/*T_ROCKSS*/ , +T_WOOD1S/*T_WOOD1*/ ,T_WOOD1SS/*T_WOOD1S*/, +T_WOOD1SS/*T_WOOD1SS*/ , +T_WBOXS/*T_WBOX*/ ,T_WBOXSS/*T_WBOXS*/, +T_WBOXSS/*T_WBOXSS*/ , +T_DOOR1S/*T_DOOR1*/ ,T_DOOR1S/*T_DOOR1S*/, +T_DOOR2S/*T_DOOR2*/ ,T_DOOR2S/*T_DOOR2S*/, +T_DOORYS/*T_DOORY*/ ,T_DOORYS/*T_DOORYS*/, +T_DOORRS/*T_DOORR*/ ,T_DOORRS/*T_DOORRS*/, +T_WOOD2S/*T_WOOD2*/ ,T_WOOD2SS/*T_WOOD2S*/, +T_WOOD2SS/*T_WOOD2SS*/ , +T_SBARRES/*T_SBARRE*/ ,T_SBARRES/*T_SBARRES*/, +T_SWITCHU/*T_SWITCHU*/ , + +T_WALL1Z,T_WALL1MZ,T_PIETR1Z,T_PIETR1MZ,T_ROCKZ,T_WOOD1Z,T_WBOXZ,T_WOOD2Z, +T_WALL2Z/*T_WALL2*/ ,T_WALL2MZ/*T_WALL2M*/, +T_WALL2Z/*T_WALL2Z*/ ,T_WALL2MZ/*T_WALL2MZ*/, +T_PIETR2Z/*T_PIETR2*/ ,T_PIETR2MZ/*T_PIETR2M*/, +T_PIETR2Z/*T_PIETR2Z*/ ,T_PIETR2MZ/*T_PIETR2MZ*/, +T_EARTHZ/*T_EARTH*/ ,T_EARTHZ/*T_EARTHZ*/, +T_SOFTZ/*T_SOFT*/ ,T_SOFTMZ/*T_SOFTM*/, +T_SOFTZ/*T_SOFTZ*/ ,T_SOFTMZ/*T_SOFTMZ*/, + +T_DRAGON ,T_DRAGON+1,T_DRAGON+2,T_DRAGON+3,T_DRAGON+4, +T_DRAGON+5,T_DRAGON+6,T_DRAGON+7,T_DRAGON+8, + +T_GRATAWZ/*T_GRATAW*/ ,T_GRATAWZ/*T_GRATAWZ*/, +T_GRATABZ/*T_GRATAB*/ ,T_GRATABZ/*T_GRATABZ*/, +T_FLROCKZ/*T_FLROCK*/ ,T_FLROCKZ/*T_FLROCKZ*/, +//T_GRIGLIA +T_OVERDOOR,T_DOORSLOT,T_SWITCHD + }; + +byte ChangeFloorText[MAXTEXTURES] = { +T_WALL1Z/*T_WALL1*/ ,T_WALL1MZ/*T_WALL1M*/, +T_WALL1SS/*T_WALL1S*/ ,T_WALL1MSS/*T_WALL1MS*/, +T_WALL1SS/*T_WALL1SS*/ ,T_WALL1MSS/*T_WALL1MSS*/, +T_TAPS/*T_TAP*/ ,T_TAPMS/*T_TAPM*/, +T_TAPSS/*T_TAPS*/ ,T_TAPMSS/*T_TAPMS*/, +T_TAPSS/*T_TAPSS*/ ,T_TAPMSS/*T_TAPMSS*/, +T_SCUDOS/*T_SCUDO*/ ,T_SCUDOMS/*T_SCUDOM*/, +T_SCUDOSS/*T_SCUDOS*/ ,T_SCUDOMSS/*T_SCUDOMS*/, +T_SCUDOSS/*T_SCUDOSS*/ ,T_SCUDOMSS/*T_SCUDOMSS*/, +T_ARC/*T_ARC*/ ,T_ARCM/*T_ARCM*/, +T_PIETR1Z/*T_PIETR1*/ ,T_PIETR1MZ/*T_PIETR1M*/, +T_PIETR1SS/*T_PIETR1S*/ ,T_PIETR1MSS/*T_PIETR1MS*/, +T_PIETR1SS/*T_PIETR1SS*/,T_PIETR1MSS/*T_PIETR1MSS*/, +T_ASCES/*T_ASCE*/ ,T_ASCEMS/*T_ASCEM*/, +T_ASCESS/*T_ASCES*/ ,T_ASCEMSS/*T_ASCEMS*/, +T_ASCESS/*T_ASCESS*/ ,T_ASCEMSS/*T_ASCEMSS*/, +T_ROCKS/*T_ROCK*/ ,T_ROCKSS/*T_ROCKS*/, +T_ROCKSS/*T_ROCKSS*/ , +T_WOOD1Z/*T_WOOD1*/ ,T_WOOD1SS/*T_WOOD1S*/, +T_WOOD1SS/*T_WOOD1SS*/ , +T_WBOXZ/*T_WBOX*/ ,T_WBOXSS/*T_WBOXS*/, +T_WBOXSS/*T_WBOXSS*/ , +T_DOOR1S/*T_DOOR1*/ ,T_DOOR1S/*T_DOOR1S*/, +T_DOOR2S/*T_DOOR2*/ ,T_DOOR2S/*T_DOOR2S*/, +T_DOORYS/*T_DOORY*/ ,T_DOORYS/*T_DOORYS*/, +T_DOORRS/*T_DOORR*/ ,T_DOORRS/*T_DOORRS*/, +T_WOOD2Z/*T_WOOD2*/ ,T_WOOD2SS/*T_WOOD2S*/, +T_WOOD2SS/*T_WOOD2SS*/ , +T_SBARRES/*T_SBARRE*/ ,T_SBARRES/*T_SBARRES*/, +T_SWITCHU/*T_SWITCHU*/ , + +T_WALL1Z,T_WALL1MZ,T_PIETR1Z,T_PIETR1MZ,T_ROCKZ,T_WOOD1Z,T_WBOXZ,T_WOOD2Z, +T_WALL2Z/*T_WALL2*/ ,T_WALL2MZ/*T_WALL2M*/, +T_WALL2Z/*T_WALL2Z*/ ,T_WALL2MZ/*T_WALL2MZ*/, +T_PIETR2Z/*T_PIETR2*/ ,T_PIETR2MZ/*T_PIETR2M*/, +T_PIETR2Z/*T_PIETR2Z*/ ,T_PIETR2MZ/*T_PIETR2MZ*/, +T_EARTHZ/*T_EARTH*/ ,T_EARTHZ/*T_EARTHZ*/, +T_SOFTZ/*T_SOFT*/ ,T_SOFTMZ/*T_SOFTM*/, +T_SOFTZ/*T_SOFTZ*/ ,T_SOFTMZ/*T_SOFTMZ*/, + +T_DRAGON ,T_DRAGON+1,T_DRAGON+2,T_DRAGON+3,T_DRAGON+4, +T_DRAGON+5,T_DRAGON+6,T_DRAGON+7,T_DRAGON+8, + +T_GRATAWZ/*T_GRATAW*/ ,T_GRATAWZ/*T_GRATAWZ*/, +T_GRATABZ/*T_GRATAB*/ ,T_GRATABZ/*T_GRATABZ*/, +T_FLROCKZ/*T_FLROCK*/ ,T_FLROCKZ/*T_FLROCKZ*/, +//T_GRIGLIA +T_OVERDOOR,T_DOORSLOT,T_SWITCHD + }; + + +#pragma warn -par +void allocfig(int fignum, int x, int y, int dx, int dy, int h) { + void far *data; + + if ((data = mm_recall(mm_alloc(dx*dy))) != NULL) + getrfig(x,y,dx,dy,data); + else error("allocfig",err_notenoughmemory); +} + +void adjsample(char far *sample, unsigned len) { +asm { + MOV CX, len + LES DI, sample + LDS SI, sample + MOV BL, -128 + CLD +} c1: asm { + LODSB + ADD AL, BL + STOSB + LOOP c1 + // !!! SS==DS !!! + MOV AX, SS + MOV DS, AX +}} + +void loadsound(int sndnum, const char *wavname) { + word size; + int handle, memidx; + unsigned long i; + char far *ptr; + + if ((handle = _open(wavname,O_RDONLY|O_BINARY)) != -1) { + lseek(handle,0x10,SEEK_SET); // cut cut + do { + _read(handle,&i,4); + lseek(handle,i,SEEK_CUR); + _read(handle,&i,4); + } while (i != FIRMdata); + _read(handle,&i,4); + size = (unsigned)i-2; + ptr = (char far *)mm_recall(memidx = mm_alloc(size)); + _read(handle,ptr,size); + _close(handle); + adjsample(ptr,size); + } else error("loadsound",err_filenotfound); + mm_unload(memidx); // il suono Š inutile... +} + +#pragma warn +par + +void main() { + int i,j, idx=0; + long l; + char *text; + void far *data; + + mm_init(); + setvbuff(vpage); + + for (i=0;i>2)*24,32,24,mm_recall(none[0])); + } + + none[0] = mm_alloc(152*20); + getlfig(166,74,152,20,mm_recall(none[0])); + + for (i=0;i<10;i++) { + none[0] = mm_alloc(15); + getlfig(179+(i<<2),129,3,5,mm_recall(none[0])); + } + for (i=2;i<10;i++) { + none[0] = mm_alloc(63); + getlfig(172+(i<<3),137,7,9,mm_recall(none[0])); + } + none[0] = mm_alloc(63); + getlfig(188+(8<<3),137,7,9,mm_recall(none[0])); + none[0] = mm_alloc(36); + getlfig(183,137,4,9,mm_recall(none[0])); + for (i=0;i<10;i++) { + none[0] = mm_alloc(49); + getlfig(176+(i<<3),149,7,7,mm_recall(none[0])); + } + for (i=0;i<17;i++) { + none[0] = mm_alloc(24*29); + getlfig(1+(i%10)*25,97+(i/10)*30,24,29,mm_recall(none[0])); + } + none[0] = mm_alloc(219*20); + none[1] = mm_alloc(64*16); + none[2] = mm_alloc(64*16); + getlfig(1,157,219,20,mm_recall(none[0])); + getlfig(1,178,64,16,mm_recall(none[1])); + getlfig(66,178,64,16,mm_recall(none[2])); + + loadLBM("lbm\\sold1.lbm",NULL); + allocfig(F_SOLDIER ,149,4,32,63,-40); + allocfig(F_SOLDIER+1 ,182,3,31,64,-40); + allocfig(F_SOLDIER+2 ,214,2,33,65,-40); + allocfig(F_SOLDIER+3 ,248,2,45,65,-40); + allocfig(F_SOLDIER+4 , 1,1,35,66,-40); + allocfig(F_SOLDIER+5 , 37,2,29,65,-40); + allocfig(F_SOLDIER+6 , 67,3,36,64,-40); + allocfig(F_SOLDIER+7 ,104,3,44,64,-40); + allocfig(F_SOLDIER+8 ,179,69,42,66,-40); + allocfig(F_SOLDIER+9 ,222,68,36,64,-40); + allocfig(F_SOLDIER+10,1,135,41,63,-40); + allocfig(F_SOLDIER+11,43,135,50,65,-40); + allocfig(F_SOLDIER+12,1,68,48,66,-40); + allocfig(F_SOLDIER+13,50,68,34,66,-40); + allocfig(F_SOLDIER+14,85,70,43,62,-40); + allocfig(F_SOLDIER+15,129,68,49,66,-40); + loadLBM("lbm\\sold2.lbm",NULL); + allocfig(F_SOLDIER+16,155,1,33,66,-40); + allocfig(F_SOLDIER+17,189,1,32,66,-40); + allocfig(F_SOLDIER+18,222,1,57,65,-40); + allocfig(F_SOLDIER+19,1,67,35,64,-40); + allocfig(F_SOLDIER+20,1,1,32,65,-40); + allocfig(F_SOLDIER+21,34,1,29,65,-40); + allocfig(F_SOLDIER+22,64,1,53,65,-40); + allocfig(F_SOLDIER+23,118,1,36,65,-40); + + // FigList[F_SOLDIER+24]=FigList[F_SOLDIER]; + allocfig(F_SOLDIER+25,37,67,34,66,-40); + // FigList[F_SOLDIER+26]=FigList[F_SOLDIER]; + allocfig(F_SOLDIER+27,72,67,30,66,-40); + + // FigList[F_SOLDIER+28]=FigList[F_SOLDIER]; + allocfig(F_SOLDIER+29,103,69,55,68,-40); + + allocfig(F_SOLDIER+30,159,69,55,68,-36); + allocfig(F_SOLDIER+31,215,69,68,56,-32); + allocfig(F_SOLDIER+32,1,138,58,28,-36); + allocfig(F_SOLDIER+33,60,142,58,24,-40); + allocfig(F_SOLDIER+34,119,145,58,21,-42); + loadLBM("lbm\\balls.lbm",NULL); + //allocfig(F_FIREBALL,0,0,15,15,-7); // !!! + allocfig(F_BOOM , 0, 0,15,15,-7); + // FigList[F_FIREBALL]=FigList[F_BOOM]; + allocfig(F_BOOM+ 1, 0, 64,21,18,-9); + allocfig(F_BOOM+ 2, 16, 0,37,33,-16); + allocfig(F_BOOM+ 3, 54, 0,50,42,-21); + allocfig(F_BOOM+ 4,105, 0,53,47,-23); + allocfig(F_BOOM+ 5, 22, 64,45,39,-19); + allocfig(F_BOOM+ 6,161, 2,12, 9,-4); + allocfig(F_BOOM+ 7,175, 0,37,31,-15); + allocfig(F_BOOM+ 8,213, 0,49,40,-20); + allocfig(F_BOOM+ 9, 50,120,12, 9, -4); + allocfig(F_BOOM+10, 63,120,37,31,-15); + allocfig(F_BOOM+11,101,120,49,40,-20); + // FigList[F_SLIMFIRE]=FigList[F_BOOM+6]; + allocfig(F_SLIMFIRE+1,162,15,9,9,-4); + + allocfig(F_SPIDFIRE ,263,0,16,16,-8); + allocfig(F_SPIDFIRE+1,280,0,16,16,-8); + allocfig(F_SPIDFIRE+2,263,17,16,16,-8); + allocfig(F_SPIDFIRE+3,280,17,16,16,-8); + + allocfig(F_BLOOD ,132,101, 5, 4,-2); + allocfig(F_BLOOD+1,147, 99,11, 9,-5); + allocfig(F_BLOOD+2,168, 94,18,18,-9); + allocfig(F_BLOOD+3,159,129,31,27,-13); + allocfig(F_BLOOD+4,197,128,42,33,-17); + + // allocfig(FIG_BOOM+9,68,64,45,39,12); + // allocfig(FIG_BARILE+3,68,64,45,39,0); // !!! + + for (i=0;i<4;i++) none[i] = mm_alloc(4*4); + for (i=4;i<8;i++) none[i] = mm_alloc(24*4); + getlfig(0,133,4,4,mm_recall(none[0])); + getlfig(5,133,4,4,mm_recall(none[1])); + getlfig(0,138,4,4,mm_recall(none[2])); + getlfig(5,138,4,4,mm_recall(none[3])); + getlfig(1,128,24,4,mm_recall(none[4])); + getlfig(31,123,4,24,mm_recall(none[5])); + getlfig(26,123,4,24,mm_recall(none[6])); + getlfig(1,123,24,4,mm_recall(none[7])); + + none[0] = mm_alloc(28*11); + none[1] = mm_alloc(20*12); + none[2] = mm_alloc(33*9); + none[3] = mm_alloc(29*12); + none[4] = mm_alloc(30*8); + none[5] = mm_alloc(9*12); + getlfig(120,52,28,11,mm_recall(none[0])); + getlfig(120,64,20,12,mm_recall(none[1])); + getlfig(141,64,33, 9,mm_recall(none[2])); + getlfig(120,77,29,12,mm_recall(none[3])); + getlfig(150,77,30, 8,mm_recall(none[4])); + getlfig(149,51, 9,12,mm_recall(none[5])); + none[0] = mm_alloc(320*32); + fcopyarea(168,0,32,mm_recall(none[0])); + none[0] = mm_alloc(68*32); + none[1] = mm_alloc(76*32); + none[2] = mm_alloc(68*32); + getlfig(250,54,68,32,mm_recall(none[0])); + getlfig(242,90,76,32,mm_recall(none[1])); + getlfig(250,126,68,32,mm_recall(none[2])); + + for (i=0;i<3;i++) { + none[0] = mm_alloc(16*16); + getlfig(196+i*17,56,16,16,mm_recall(none[0])); + } + none[0] = mm_alloc(14*14); + none[1] = mm_alloc(14*14); + getlfig(196,73,14,14,mm_recall(none[0])); + getlfig(211,73,14,14,mm_recall(none[1])); + none[0] = mm_alloc(32*28); + getlfig(205,91,32,28,mm_recall(none[0])); + + none[0] = mm_alloc(32000); + none[1] = mm_alloc(32000); + PPal apppal = (PPal)mm_recall(mm_alloc(768)); + loadLBM("lbm\\bck_c0.lbm",apppal); + fcopyarea(0,0,100,mm_recall(none[1])); + fcopyarea(100,0,100,mm_recall(none[0])); + fwfill(apppal,0,3); + none[0] = mm_alloc(32000); + none[1] = mm_alloc(32000); + loadLBM("lbm\\bck_f0.lbm",NULL); + fcopyarea(0,0,100,mm_recall(none[0])); + fcopyarea(100,0,100,mm_recall(none[1])); + + none[0] = mm_alloc(32000); + none[1] = mm_alloc(32000); + loadLBM("lbm\\bck_c1.lbm",NULL); + fcopyarea(0,0,100,mm_recall(none[1])); + fcopyarea(100,0,100,mm_recall(none[0])); + none[0] = mm_alloc(32000); + none[1] = mm_alloc(32000); + loadLBM("lbm\\bck_f1.lbm",NULL); + fcopyarea(0,0,100,mm_recall(none[0])); + fcopyarea(100,0,100,mm_recall(none[1])); + + none[0] = mm_alloc(32000); + none[1] = mm_alloc(32000); + loadLBM("lbm\\bck_c2.lbm",NULL); + fcopyarea(0,0,100,mm_recall(none[1])); + fcopyarea(100,0,100,mm_recall(none[0])); + none[0] = mm_alloc(32000); + none[1] = mm_alloc(32000); + loadLBM("lbm\\bck_f2.lbm",NULL); + fcopyarea(0,0,100,mm_recall(none[0])); + fcopyarea(100,0,100,mm_recall(none[1])); + + none[0] = mm_alloc(50*115); + none[1] = mm_alloc(85*150); + none[2] = mm_alloc(106*123); + loadLBM("lbm\\Ascia.lbm",NULL); + getrfig(0,0,50,115,mm_recall(none[0])); + getrfig(51,0,85,150,mm_recall(none[1])); + getrfig(137,0,106,123,mm_recall(none[2])); + none[0] = mm_alloc(55*61); + none[1] = mm_alloc(55*67); + none[2] = mm_alloc(42*39); + none[3] = mm_alloc(80*128); + loadLBM("lbm\\Mano.lbm",NULL); + getrfig(0,0,55,61,mm_recall(none[0])); + getrfig(0,62,55,67,mm_recall(none[1])); + getrfig(56,0,42,39,mm_recall(none[2])); + getrfig(124,40,80,128,mm_recall(none[3])); + none[0] = mm_alloc(65*53); + none[1] = mm_alloc(99*108); + none[2] = mm_alloc(40*31); + loadLBM("lbm\\Fucile.lbm",NULL); + getrfig(0,0,65,53,mm_recall(none[0])); + getrfig(0,54,99,108,mm_recall(none[1])); + getrfig(66,0,40,31,mm_recall(none[2])); + none[0] = mm_alloc(53*77); + none[1] = mm_alloc(53*31); + none[2] = mm_alloc(53*31); + none[3] = mm_alloc(53*31); + none[4] = mm_alloc(42*41); + none[5] = mm_alloc(83*68); + loadLBM("lbm\\Mitra.lbm",NULL); + getrfig(0,0,53,77,mm_recall(none[0])); + getrfig(169,0,53,31,mm_recall(none[1])); + getrfig(54,0,53,31,mm_recall(none[2])); + getrfig(112,0,53,31,mm_recall(none[3])); + getrfig(223,0,42,41,mm_recall(none[4])); + getrfig(0,88,83,68,mm_recall(none[5])); + loadsound(SND_THUNDER1, "wav\\thunder.wav"); + loadsound(SND_THUNDER2, "wav\\tuono.wav"); + loadsound(SND_GOCCIA, "wav\\goccia.wav"); + loadsound(SND_BOOM, "wav\\esplos.wav"); + loadsound(SND_BUB, "wav\\bub3.wav"); + loadsound(SND_TOPO, "wav\\topo.wav"); + loadsound(SND_KEYS, "wav\\keys.wav"); + loadsound(SND_PISTOLA, "wav\\fucil2.wav"); + loadsound(SND_FUCILE, "wav\\fucil1.wav"); + loadsound(SND_MITRA, "wav\\pist1.wav"); + loadsound(SND_MISSILE, "wav\\missile.wav"); + loadsound(SND_SLIME1, "wav\\slime01.wav"); + loadsound(SND_SLIME2, "wav\\slime02.wav"); + loadsound(SND_PASSO, "wav\\passo.wav"); + loadsound(SND_PORTA1, "wav\\porta2.wav"); + loadsound(SND_PORTA2, "wav\\porta1.wav"); + loadsound(SND_SCODE, "wav\\beam.wav"); + loadsound(SND_PROIETTILE,"wav\\proiett.wav"); + loadsound(SND_VASO1, "wav\\vaso1.wav"); + loadsound(SND_VASO2, "wav\\vaso2.wav"); + loadsound(SND_COLPO1, "wav\\colpo1.wav"); + loadsound(SND_COLPO2, "wav\\colpo3.wav"); + loadsound(SND_TOGGLE, "wav\\fineliv.wav"); + loadsound(SND_WIND, "wav\\wind.wav"); + loadsound(SND_FIRE, "wav\\fire.wav"); + loadsound(SND_MISSILGO, "wav\\missile2.wav"); + loadsound(SND_UNLOCK, "wav\\unlock.wav"); + loadsound(SND_CLOSE, "wav\\close.wav"); + loadsound(SND_GLASS, "wav\\glass.wav"); + loadsound(SND_PASSO2, "wav\\passo2.wav"); + loadsound(SND_SOLDDEAD, "wav\\solddead.wav"); + loadsound(SND_SLIMDEAD, "wav\\slimdead.wav"); + loadsound(SND_SPIDDEAD, "wav\\spiddead.wav"); + loadsound(SND_SOLDATT, "wav\\soldatt.wav"); + loadsound(SND_SLIMATT, "wav\\slimatt.wav"); + loadsound(SND_SPIDATT, "wav\\spidatt.wav"); + loadsound(SND_CLOCK, "wav\\clock.wav"); + loadsound(SND_CLOCK2, "wav\\clock2.wav"); + loadsound(SND_SPIDNEAR, "wav\\spidnear.wav"); + loadsound(SND_CHARGE, "wav\\charge.wav"); + loadsound(SND_CHARGE2, "wav\\charge2.wav"); + loadsound(SND_SOLDDOWN, "wav\\solddown.wav"); + loadsound(SND_SLIMDOWN, "wav\\slimdown.wav"); + loadsound(SND_SPIDDOWN, "wav\\spiddown.wav"); + loadsound(SND_OSSA, "wav\\ossa.wav"); + loadsound(SND_VENOM, "wav\\venom.wav"); + loadsound(SND_RISATA, "wav\\risata.wav"); + loadsound(SND_BONUS, "wav\\bonus.wav"); + loadsound(SND_ASCIAHIT, "wav\\asciahit.wav"); + loadsound(SND_SOLDHIT, "wav\\soldhit.wav"); + loadsound(SND_SLIMHIT, "wav\\slimhit.wav"); + loadsound(SND_SPIDHIT, "wav\\spidhit.wav"); + loadsound(SND_BBOUNCE, "wav\\bbounce.wav"); + + Font *Std = new Font("std"); Std->setdispl(-1,0); + Font *Big = new Font("big"); Big->setdispl(-1,0); + Std->packdata(); + Big->packdata(); + + sl_convert("GREETING.SLF"); + sl_convert("QUOTES.SLF"); + sl_convert("ORDERING.SLF"); + sl_convert("HELP.SLF"); + sl_convert("INFO.SLF"); + sl_convert("MESSAGES.SLF"); + + for (i=0;i<4;i++) + none[i] = mm_alloc(16000); + loadLBM("lbm\\dragon2.lbm",NULL); + for (i=0;i<4;i++) fcopyarea(i*50,0,50,mm_recall(none[i])); + for (i=0;i<4;i++) + none[i] = mm_alloc(16000); + loadLBM("lbm\\dragon1.lbm",NULL); + for (i=0;i<4;i++) fcopyarea(i*50,0,50,mm_recall(none[i])); + + none[4] = mm_alloc(768); + for (i=0;i<4;i++) none[i] = mm_alloc(16000); + loadLBM("lbm\\pres.lbm",mm_recall(none[4])); + for (i=0;i<4;i++) fcopyarea(i*50,0,50,mm_recall(none[i])); + + mm_makedatafile(); + + mm_done(); +} \ No newline at end of file diff --git a/KaosSrc/makefont.cpp b/KaosSrc/makefont.cpp new file mode 100644 index 0000000..f7a2df4 --- /dev/null +++ b/KaosSrc/makefont.cpp @@ -0,0 +1,102 @@ +/************************************************************************ + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + ************************************************************************/ + +// MakeFont - (C) 1997 NicoSoft + +#include "std.hpp" +#include "errorstr.hpp" +#include "fastmem.hpp" +#include "mm4.hpp" +#include "vgatool3.hpp" +#include "lgraph.hpp" +#include "lfont2.hpp" +#include + +void main() { + byte c; + PPal pal = new char[768]; + Font *myfont; + + mm_init(); + setvbuff(VMEMPTR); + initL(); + + if (!loadLBM("lfonts.lbm",pal)) error("main",err_filenotfound); + setpal((PPal)pal,0,256); + myfont = new Font(6,3,1,0); + for (c=FIRSTCHAR; c<=LASTCHAR; c++) + myfont->getcharfig(c,((c-FIRSTCHAR) & 31)*9,((c-FIRSTCHAR) >> 5)*7,8,6); + ffillblock(16,140,280,32,0x07070707); + myfont->write(24,144,1,2,"ab cdefghijklmn AB CDEFGHIJKLM"); + if (getch()==13) myfont->save("little"); + delete myfont; + + myfont = new Font(8,5,0,0); + for (c=FIRSTCHAR; c<=LASTCHAR; c++) + myfont->getcharfig(c,((c-FIRSTCHAR) & 31)*9,40+((c-FIRSTCHAR) >> 5)*9,8,8); + ffillblock(16,140,280,32,0x07070707l); + myfont->write(24,144,1,2,"ab cdefghijklmn AB CDEFGHIJKLM"); + if (getch()==13) myfont->save("std"); + delete myfont; + + /* + if (!loadLBM("font2.lbm",pal)) error("LBM NOT found !"); + setpal((TPal *)pal,256); + myfont = new Font(22,10,0,0); + for (c=(byte)'A'; c<=(byte)'Z'; c++) + myfont->getcharfig(c,(((byte)c-(byte)'A')%15)*21,(((byte)c-(byte)'A')/15)*23,20,22); + for (c=(byte)'a'; c<=(byte)'z'; c++) + myfont->getcharfig(c,(((byte)c-(byte)'a')%15)*21,46+(((byte)c-(byte)'a')/15)*23,20,22); + myfont->getcharfig('!',(((byte)c-(byte)'a')%15)*21,46+(((byte)c-(byte)'a')/15)*23,20,22); + c++; + myfont->getcharfig(':',(((byte)c-(byte)'a')%15)*21,46+(((byte)c-(byte)'a')/15)*23,20,22); + ffillblock(16,140,280,64,0x07070707); + myfont->write(24,144,1,2,"ABCDEFGHIJKLMNOPQRSTUVWXYZ"); + myfont->write(24,168,1,2,"Millennium Soft!:"); + if (getch()==13) myfont->save("big"); + delete myfont; + myfont = new Font("big"); + myfont->setdispl(0,0); + ffillblock(16,140,280,64,0x07070707); + myfont->write(24,144,1,2,"ABCDEFGHIJKLMNOPQRSTUVWXYZ"); + myfont->write(24,168,1,2,"abcdefghijklmnopqrstuvwxyz"); + delete myfont; + getch(); + */ + /* + if (!loadLBM("newfont.lbm",pal)) error("LBM NOT found !"); + setpal((TPal *)pal,256); + myfont = new Font(22,10,0,0); + for (c=(byte)'A'; c<=(byte)'Z'; c++) + myfont->getcharfig(c,(((byte)c-(byte)'A')%15)*21,(((byte)c-(byte)'A')/15)*29,20,28); + for (c=(byte)'a'; c<=(byte)'z'; c++) + myfont->getcharfig(c,(((byte)c-(byte)'a')%15)*21,58+(((byte)c-(byte)'a')/15)*29,20,28); + myfont->getcharfig('!',(((byte)c-(byte)'a')%15)*21,58+(((byte)c-(byte)'a')/15)*29,20,28); + c++; + myfont->getcharfig(':',(((byte)c-(byte)'a')%15)*21,58+(((byte)c-(byte)'a')/15)*29,20,28); + c++; + myfont->getcharfig('/',(((byte)c-(byte)'a')%15)*21,58+(((byte)c-(byte)'a')/15)*29,20,28); + c++; + myfont->getcharfig('%',(((byte)c-(byte)'a')%15)*21,58+(((byte)c-(byte)'a')/15)*29,20,28); + for (c=(byte)'0'; c<=(byte)'9'; c++) + myfont->getcharfig(c,(((byte)c-(byte)'0')%15)*21,116+(((byte)c-(byte)'0')/15)*29,20,28); + ffillblock(16,140,280,64,0x07070707); + myfont->write(24,144,1,2,"ABCDEFGHIJKLMNOPQRSTUVWXYZ"); + myfont->write(24,168,1,2,"Millennium Soft!:/%01234"); + if (getch()==13) myfont->save("big"); + delete myfont; + myfont = new Font("big"); + myfont->setdispl(0,0); + ffillblock(16,140,280,64,0x07070707); + myfont->write(24,144,1,2,"ABCDEFGHIJKLMNOPQRSTUVWXYZ"); + myfont->write(24,168,1,2,"abcdefghijklmnopqrstuvwxyz"); + delete myfont; + getch(); + */ + doneL(); + mm_done(); +} \ No newline at end of file diff --git a/KaosSrc/messages.hpp b/KaosSrc/messages.hpp new file mode 100644 index 0000000..fff870c --- /dev/null +++ b/KaosSrc/messages.hpp @@ -0,0 +1,42 @@ +/************************************************************************ + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + ************************************************************************/ + + +#define MSG_GOT_PISTOLA 1 +#define MSG_GOT_FUCILE MSG_GOT_PISTOLA+1 +#define MSG_GOT_MITRA MSG_GOT_FUCILE+1 +#define MSG_GOT_BAZOOKA MSG_GOT_MITRA+1 +#define MSG_GOT_BOMBA MSG_GOT_BAZOOKA+1 +#define MSG_GOT_BONUS MSG_GOT_BOMBA+1 +#define MSG_GOT_BIGCOIN MSG_GOT_BONUS+1 +#define MSG_GOT_LITCOIN MSG_GOT_BIGCOIN+1 + +#define MSG_GOT_FARMA_BIG MSG_GOT_LITCOIN+2 +#define MSG_GOT_FARMA_LIT MSG_GOT_FARMA_BIG+1 + +#define MSG_GOT_KEY_YELLOW MSG_GOT_FARMA_LIT+2 +#define MSG_GOT_KEY_RED MSG_GOT_KEY_YELLOW+1 +#define MSG_GOT_KEY_ANTIKAOS MSG_GOT_KEY_RED+1 + +#define MSG_GOT_AMMO_PISTOLA MSG_GOT_KEY_ANTIKAOS+2 +#define MSG_GOT_AMMO_FUCILE MSG_GOT_AMMO_PISTOLA+1 +#define MSG_GOT_AMMO_MITRA MSG_GOT_AMMO_FUCILE+1 +#define MSG_GOT_AMMO_BAZOOKA MSG_GOT_AMMO_MITRA+1 +#define MSG_TIMESLICE MSG_GOT_AMMO_BAZOOKA+1 +#define MSG_GETANTIKAOS MSG_TIMESLICE+1 +#define MSG_KAOS MSG_GETANTIKAOS+1 + +#define MSG_NEEDKEY_YELLOW MSG_KAOS+2 +#define MSG_NEEDKEY_RED MSG_NEEDKEY_YELLOW+1 + +#define MSG_INVINCIBLE MSG_NEEDKEY_RED+2 +#define MSG_INVISIBLE MSG_INVINCIBLE+1 +#define MSG_DEAD MSG_INVISIBLE+1 +#define MSG_RESURRECT MSG_DEAD+1 +#define MSG_POISONED MSG_RESURRECT+1 +#define MSG_HARDMODE MSG_POISONED+1 +#define MSG_GODMODE MSG_HARDMODE+1 \ No newline at end of file diff --git a/KaosSrc/mm4.cpp b/KaosSrc/mm4.cpp new file mode 100644 index 0000000..572180a --- /dev/null +++ b/KaosSrc/mm4.cpp @@ -0,0 +1,946 @@ +/************************************************************************ + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + ************************************************************************/ + +// MM - MemoryManager - (C)1997 Nicosoźt (Valentini Domenico) +// Tutti i diritti sono strettamente riservati ! + +// +Packer + +// V3.3 - DISK SWAPPING & NO DEALLOCATION CAPABILITY + +#define __PACKED_BDF__ + +#include "std.hpp" +#include "errorstr.hpp" +#include "xms.hpp" +#include "mm4.hpp" +#include "fastmem.hpp" +#include +#include +#include + +#include +#include +#include "lgraph.hpp" + +#define MM_MAXRESETCNT 8 + +#define CMPM_EVAL 0 +#define CMPM_PACK 1 +#define CMPM_STORE 2 + +//#include +//#include +//#include + +typedef struct { + pointer addr; // 0 + word size; // 4 + byte flag; // 6 + byte lock; // 7 + } TBlock; // size 8 !!! +#define SIZE_B 8 + +typedef struct { + int id; // 0 + pointer addr; // 2 + unsigned long size; // 6 + } TXMSBlock; // size 10 !!! +#define SIZE_XMSB 10 + +const char idBDF[9] = "NICbdf\x7\x1a"; + +TBlock *mm_BlockList; +TXMSBlock *mm_XMSList; +int mm_maxmemblocks = MAXMEMBLOCKS, + mm_memblocks, mm_xmsblocks; +word mm_xmshandle; +unsigned long mm_xmsfree, mm_allocvol, mm_allocfree; +#ifdef __MAINCHECK__ +long mm_mainmem; +#endif +#ifdef __DATAFILE__ +long *mm_DiskOfs; +#ifdef __PACKED_BDF__ +word *mm_BlkSize; +#endif +int mm_datafile; +#endif +static char mm_resetcnt; +/* +#pragma warn -rvl +void far *alignptr(void far *pntr) { +asm { + MOV AX, WORD PTR pntr + MOV DX, WORD PTR pntr[2] + MOV BX, AX + SHR BX, 4 + ADD DX, BX + AND AX, 0x000f +}} +#pragma warn +rvl +*/ + +//void mm_visualize(); // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +// Non voglio che gli hacker pensino che sono stupido... +// ...ma queste routines sono veramente controproducenti ! + +void near encrypt(void far *pntr, word size) { +asm { + //LES DI, pntr + LDS SI, pntr + MOV CX, size + SHR CX, 1 // se Š dispari chissene frega + // CLD no LODS !!! +} c1: asm { + ADD [SI], CL + INC SI + ADD [SI], CL + INC SI + /* + LODSW + ADD AX, CX + STOSW + */ + LOOP c1 + // ! SS==DS ! + MOV AX, SS + MOV DS, AX +}} + +void near decrypt(void far *pntr, word size) { +asm { + //LES DI, pntr + LDS SI, pntr + MOV CX, size + SHR CX, 1 // se Š dispari chissene frega + // CLD no LODS !!! +} c1: asm { + SUB [SI], CL + INC SI + SUB [SI], CL + INC SI + /* + LODSW + SUB AX, CX + STOSW + */ + LOOP c1 + // ! SS==DS ! + MOV AX, SS + MOV DS, AX +}} + +#ifdef __PACKED_BDF__ +word near mm_compress(void far *source, void far *destin, word size) { + word cmpsize = 0; + signed char count; + byte oldb, newb, mode = CMPM_EVAL; + byte far *app, + far *dest = (byte *)destin, + far *mark; + + oldb = *(app = (byte *)source); + app++; + size--; + while (size--) { + // Fetch + newb = *(app++); + switch(mode) { + case CMPM_STORE: + if (newb==oldb) { + if (size && *app==newb) { + // Mem + *(dest++) = count+1; // count NON viene incrementato ! + fwmove(dest,app+count-2,-count); + dest -= count; + cmpsize += (int)(-count)+1; + // Change Mode/Auto prefetch + mode = CMPM_PACK; + count=1; // o meglio count=2; app++; + break; + } + } + if (--count == -128) { + // Mem + *(dest++) = -128; + fwmove(dest,app-129,129); + dest += 129; + cmpsize += 130; + //dest -= count; + // Change Mode/Prefetch + mode = CMPM_EVAL; + if (!size--) return cmpsize; + newb = *(app++); + } + break; + case CMPM_PACK: + if (newb!=oldb) { + // Mem + *(dest++) = count; + *(dest++) = oldb; + cmpsize += 2; + // Change Mode + mode = CMPM_EVAL; + } else { + if (++count == 127) { + // Mem + *(dest++) = 127; + *(dest++) = oldb; + cmpsize += 2; + // Change Mode/Prefetch + mode = CMPM_EVAL; + if (!size--) return cmpsize; + newb = *(app++); + } + } + break; + case CMPM_EVAL: + if (newb==oldb) { + mode = CMPM_PACK; + count = 1; + } else { + mode = CMPM_STORE; + count = -1; + } + break; + } + oldb = newb; + } + switch(mode) { + case CMPM_PACK: + *(dest++) = count; + *dest = oldb; + cmpsize += 2; + break; + case CMPM_STORE: + *(dest++) = count; + fwmove(dest,app+count-1,(int)(-count)+1); + cmpsize += (int)(-count)+2; + break; + case CMPM_EVAL: + *(dest++) = 0; // store one + *dest = oldb; + cmpsize += 2; + break; + } + return cmpsize; +} + +void near mm_uncompress(void far *source, void far *dest, word cmpsize) { +asm { + LDS SI, source + LES DI, dest + MOV DX, cmpsize +} c1: asm { + LODSB + CBW + MOV CX, AX + OR AX, AX + JS store + DEC DX + LODSB + STOSB + REP STOSB // se CX==0 non fa niente + DEC DX + JNZ c1 + JMP end +} store: asm { + NEG CX + ADD DX, AX //SUB DX, CX + DEC DX + MOVSB + REP MOVSB + DEC DX + JNZ c1 +} end: asm { + // ! SS==DS ! + MOV AX, SS + MOV DS, AX +} } +#endif + +int mm_newblock() { + if (mm_memblocks= Block.size) { + if (XMSBlock.size > Block.size) { + // split the block if possible + if (mm_xmsblocks=0 && !(mm_BlockList[j].flag & BLF_USED) && + XMSBlock.size>=Block.size && + XMSBlock.size=bestsize) { // >= ! + bestsize = XMSBlock.size-mm_BlockList[j].size; + bestid = i; // e non "j" ! + } + } +#endif + } +#ifdef __DATAFILE__ + // last beach: the unused XMS block ! +//#ifndef __DEBUGMODE__ + if (bestid>=0) { + // NON SPLITTO I BLOCCHI ! (per scelta) + // Throw old Block out + TXMSBlock &XMSBlock = mm_XMSList[bestid]; + //mm_xmsfree += XMSBlock.size; no, tanto lo rioccupo subito + //mm_allocfree += mm_BlockList[XMSBlock.id].size; // !!! duplicate !!!! + mm_BlockList[XMSBlock.id].flag = BLF_DISK; + // Replace the space with newer block + mvdata.size = Block.size; // Moves only used data + mvdata.shandle = 0; + mvdata.sptr = Block.addr; + mvdata.dhandle = mm_xmshandle; + mvdata.dptr = XMSBlock.addr; + if (!XMSmove(&mvdata)) error("mm_swapblock()","move"); + Block.flag = BLF_XMS|BLF_USED; + XMSBlock.id = id; + //mm_XMSList[i].size = Block.size; ???!!! why ? + //mm_xmsfree -= XMSBlock.size; + mm_allocfree += Block.size; // !!! duplicate !!!! +#ifdef __MAINCHECK__ + mm_mainmem -= Block.size; +#endif + delete Block.addr.ptr; + Block.addr = XMSBlock.addr; + //sound(1000);delay(5);nosound(); + } else { +//#endif + // I'll not fail (using the disk) + //mm_xmsfree -= Block.size; NO non si libera XMS ! + mm_allocfree += Block.size; // !!! duplicate !!!! +#ifdef __MAINCHECK__ + mm_mainmem -= Block.size; +#endif + Block.flag = BLF_DISK; + delete Block.addr.ptr; +//#ifndef __DEBUGMODE__ + } +//#endif +#else + error("mm_swapblock","fail"); +#endif +} + +/* ...and where everybody fall, + where the known can't help, + where C++ can do nothing, + where the computer reclaims its born, + it, "The Wizard", solve any problem. +*/ +void far * near mm_wizard(word size) { +// This verion of The Wizard do NOT uses FORCED_FIRST_FIT method. + //register + int i, j; + //register + TBlock *Block; + int bestfit = -1; + word bestsize = 0xffff; + byte f; + void far *ptr; + + // if (!mm_memblocks) return NULL; ???!!! + + for (i=0,Block=mm_BlockList; iflag & (BLF_UNREADY|BLF_USED|BLF_LOCKED)) && + Block->size>=size && Block->sizesize; + } + } + + if (bestfit>=0) { + mm_swapblock(bestfit); + if ((ptr = new char[size]) != NULL) return ptr; + } + bestsize = 0xffff; + bestfit = -1; + + // Swap UNUSED, UNLOCKED conventional blocks + for (i=0, Block = mm_BlockList; iflag) & (BLF_UNREADY | BLF_USED | BLF_LOCKED))) { + mm_swapblock(i); + if ((ptr = new char[size]) != NULL) return ptr; + } else + if (!(f & (BLF_UNREADY | BLF_LOCKED)) && + Block->size>=size && Block->sizesize; + } + + // Swap best USED, UNLOCKED coventional block + if (bestfit>=0) { + mm_swapblock(bestfit); + if ((ptr = new char[size]) != NULL) return ptr; + } + + // Swap UNLOCKED conventional blocks + for (i=0, Block = mm_BlockList; iflag & (BLF_UNREADY | BLF_LOCKED))) { + mm_swapblock(i); + if ((ptr = new char[size]) != NULL) return ptr; + } + + if ((ptr = new char[size]) != NULL) return ptr; + else return NULL; // Sorry, I failed. +} + +void far * near mm_sysalloc(word size) { + void far *ptr; + size = (size+1) & 0xfffe; + if (!(ptr = new char[size])) + ptr = mm_wizard(size); + return ptr; +} + +// ---- USER ---- +//#pragma warn -rvl +void far *mm_reserve(word size) { + void far *ptr; + if ((ptr = mm_sysalloc(size)) == NULL) + error("mm_reserve","fail"); // return NULL; + return ptr; +} + +/* +void far *mm_alloc(word size, int &id) { + if ((id = mm_newblock()) == -1) + error("mm_alloc - No rooms"); +#ifdef __DATAFILE__ + if (!size) size = (word)(mm_DiskOfs[id+1]-mm_DiskOfs[id]); + else +#endif + size = (size+1) & 0xfffe; + mm_BlockList[id].size = size; + mm_BlockList[id].flag = 0; + if (!(mm_BlockList[id].addr.ptr = new char[size])) + if (!(mm_BlockList[id].addr.ptr = mm_wizard(size))) + error("mm_alloc - No memory"); + mm_allocvol += size; + mm_memblocks++; +#ifdef __DATAFILE__ + if (tell(mm_datafile) != mm_DiskOfs[id]) + lseek(mm_datafile,mm_DiskOfs[id],SEEK_SET); + // potrei confidare nel fatto che siano allineate + // le chiamate alla funzione... (ma non credo proprio) + _read(mm_datafile,mm_BlockList[id].addr.ptr,size); +#endif + return mm_BlockList[id].addr.ptr; +} +*/ + +int mm_alloc(word size) { + int id; + if ((id = mm_newblock())<0) + error("mm_alloc","no rooms"); +#ifdef __DATAFILE__ +#ifdef __PACKED_BDF__ + if (!size) size = mm_BlkSize[id]; +#else + if (!size) size = (word)(mm_DiskOfs[id+1]-mm_DiskOfs[id]); +#endif + else +#endif + size = (size+1) & 0xfffe; + mm_BlockList[id].size = size; +#ifdef __DATAFILE__ + mm_BlockList[id].flag = BLF_DISK; +#else + mm_BlockList[id].flag = 0; + if (!(mm_BlockList[id].addr.ptr = new char[size])) + if (!(mm_BlockList[id].addr.ptr = mm_wizard(size))) + error("mm_alloc",err_notenoughmemory); +#ifdef __MAINCHECK__ + mm_mainmem += size; +#endif +#endif + mm_allocvol += size; + mm_memblocks++; + return id; +} + +/* +void mm_pass_alloc(word size) { + lseek(mm_ +} +*/ +//#pragma warn +rvl + +word mm_getblocksize(int id) { + return mm_BlockList[id].size; +} + +void far *mm_recall(int id) { + if (id<0 || id>=mm_memblocks) error("Recall","ID out of range"); + + void far *ptr; + TBlock &Block = mm_BlockList[id]; + TXMSMoveStruct mvdata; + int idx; +#ifdef __PACKED_BDF__ + void far *cmpptr; + word cmpsize; +#endif + + //if (!mm_check()) error("Before Recall"); + if (Block.flag & BLF_UNREADY) { + if ((ptr = mm_sysalloc(Block.size)) != NULL) { +#ifdef __MAINCHECK__ + mm_mainmem += Block.size; +#endif +#ifdef __DATAFILE__ + if (Block.flag & BLF_XMS) { +#endif + //if (!(Block.flag & BLF_XMS)) error("Disk mapper error!"); + mvdata.size = Block.size; // moves only used data + mvdata.shandle = mm_xmshandle; + mvdata.sptr = Block.addr; + mvdata.dhandle = 0; + mvdata.dptr.ptr = ptr; + if (!XMSmove(&mvdata)) //error("mm_recall","move"); + + if ((idx = mm_findxmsidx(id)) != -1) + if (mm_XMSList[idx].addr.ofs == Block.addr.ofs) + { asm {MOV AX,3;INT 0x10} + printf("Recall Error #%d (%lu = %p)",_BL,Block.addr.ofs,Block.addr.ptr); + exit(1); + } else error("Recall","Uncongruent data"); + else error("Recall","Data corrupt"); + + Block.addr.ptr = ptr; + Block.flag = 0; + if ((idx = mm_findxmsidx(id)) != -1) { + mm_xmsfree += mm_XMSList[idx].size; + mm_allocfree -= Block.size; // !!! duplicate !!! + // Merges with the previous block if free + if (idx>0 && mm_XMSList[idx-1].id == -1) { + mm_XMSList[idx-1].size += mm_XMSList[idx].size; + // It's forward ! + fdmove(&mm_XMSList[idx],&mm_XMSList[idx+1], + sizeof(TXMSBlock) * (--mm_xmsblocks - idx)); + idx--; + } else mm_XMSList[idx].id = -1; + // Merges with the successive block if free + if (idx+1 < mm_xmsblocks && mm_XMSList[idx+1].id == -1) { + mm_XMSList[idx].size += mm_XMSList[idx+1].size; + // It's forward ! + fdmove(&mm_XMSList[idx+1],&mm_XMSList[idx+2], + sizeof(TXMSBlock) * (--mm_xmsblocks - idx-1)); + } + } else error("mm_recall","no block"); +#ifdef __DATAFILE__ + } else { + Block.addr.ptr = ptr; + Block.flag = 0; + lseek(mm_datafile,mm_DiskOfs[id],SEEK_SET); +#ifdef __PACKED_BDF__ + //sound(500); delay(5); nosound(); + mm_lock(id); + if ((cmpptr = mm_sysalloc(cmpsize = (word)(mm_DiskOfs[id+1]-mm_DiskOfs[id]))) == NULL) { + /* + mm_unlock(id); + mm_swapblock(id); + mm_recall(id); // !!!!!!!!!!!!!!!!! + mm_lock(id); + */ + if ((cmpptr = mm_sysalloc(cmpsize)) == NULL) { + mm_unlock(id); + Block.flag = BLF_DISK; + delete ptr; +#ifdef __MAINCHECK__ + mm_mainmem -= Block.size; +#endif + return NULL; + } + //error("mm_recall","can't unpack"); + } + /* + { + doneL(); + printf("mm_recall - Can't unpack %d bytes into %d.",Block.size,cmpsize); + exit(0); + } + */ + _read(mm_datafile,cmpptr,cmpsize); + decrypt(cmpptr,cmpsize); // EEEeeeh, e che Š ?!!! + mm_uncompress(cmpptr,ptr,cmpsize); + delete cmpptr; + mm_unlock(id); +#else + _read(mm_datafile,ptr,Block.size); + decrypt(ptr,Block.size); +#endif + mm_allocfree -= Block.size; + } +#endif + } else return NULL; + } + //if (!mm_check()) error("After Recall"); + + //mm_visualize(); + Block.flag |= BLF_USED; + return Block.addr.ptr; +} + +void mm_unload(int id) { + TBlock &Block = mm_BlockList[id]; + if (!(Block.flag & BLF_UNREADY)) mm_swapblock(id); +} + +byte mm_lock(int id) { + TBlock &block = mm_BlockList[id]; + block.flag |= BLF_LOCKED; + return ++block.lock; +} + +byte mm_unlock(int id) { + byte lckval; + TBlock &block = mm_BlockList[id]; + if (!(lckval = --block.lock)) block.flag &= ~BLF_LOCKED; + return lckval; +} + +unsigned long mm_memavail() { + return coreleft()+mm_xmsfree; +} + +unsigned long mm_totalloc() { + return mm_allocvol; +} + +unsigned long mm_freealloc() { + return mm_allocfree; +} + +void mm_reset() { +if (++mm_resetcnt>MM_MAXRESETCNT) { + mm_resetall(); + return; +} +// resets only conventional blocks +asm { + MOV CX, mm_memblocks + LDS SI, mm_BlockList + ADD SI, 6 // !!!! indice di flag + MOV BX, SIZE_B + MOV AL, BLF_UNUSED + // CLD no LODS +} l1: asm { + MOV DL, [SI] + TEST DL, (BLF_XMS+BLF_DISK) + JNZ goon + AND DL, AL + MOV [SI], DL +} goon: asm { + ADD SI, BX + LOOP l1 + // !!! SS==DS !!! + MOV AX, SS + MOV DS, AX +}} + +void mm_resetall() { + mm_resetcnt = 0; +asm { + MOV CX, mm_memblocks + LDS SI, mm_BlockList + ADD SI, 6 // !!!! indice di flag + MOV BX, SIZE_B + MOV AL, BLF_UNUSED + // CLD no LODS +} l1: asm { + AND [SI], AL + ADD SI, BX + LOOP l1 + // !!! SS==DS !!! + MOV AX, SS + MOV DS, AX +}} + +void mm_flushall() { + mm_resetall(); + TBlock *Block; + int id; + for (id=0,Block=mm_BlockList;idflag & (BLF_UNREADY|BLF_LOCKED))) + mm_swapblock(id); + } +} + +void mm_init() { + word size, check; + mm_resetcnt = 0; +#ifdef __DATAFILE__ + char id[9] = "........"; + if ((mm_datafile = _open(DATAFILENAME,O_RDONLY|O_BINARY)) != -1) { + _read(mm_datafile,id,8); + if (!fwcomp(id,(void *)&idBDF,8)) + error("mm_init",err_invalidformat); + // Loads data addresses + _read(mm_datafile,&mm_maxmemblocks,sizeof(mm_maxmemblocks)); + if (!(mm_DiskOfs = new long[mm_maxmemblocks+1]) +#ifdef __PACKED_BDF__ + || !(mm_BlkSize = new word[mm_maxmemblocks]) +#endif + ) + error("mm_init",err_notenoughmemory); +#ifdef __PACKED_BDF__ + _read(mm_datafile,mm_BlkSize,mm_maxmemblocks*sizeof(word)); +#endif + int i; + long part = 0l, +#ifdef __PACKED_BDF__ + totofs = 10l+(4l*mm_maxmemblocks); // 8(ID)+2(maxblocks)+(2+2)*max...+sizes... +#else + totofs = 10l+(2l*mm_maxmemblocks); // 8(ID)+2(maxblocks)+2*max...+sizes... +#endif + for (i=0;i 0) { + if (size>MM_MAXALLOC) size = MM_MAXALLOC; + } else size = MM_MAXALLOC; + // ...so I steal & fuck it ! + if ((mm_xmshandle = XMSnew(size)) != 0 && + XMSgetsize(mm_xmshandle,check)) { + if (check != size) size = check; + mm_xmsfree = (long)size << 10; + mm_XMSList[0].id = -1; + mm_XMSList[0].addr.ofs = 0l; + mm_XMSList[0].size = mm_xmsfree; + mm_xmsblocks = 1; + return; + } + } + mm_xmsfree = 0; +} + +void mm_done() { + if (mm_xmshandle) { + XMSdelete(mm_xmshandle); + mm_xmshandle = 0; +#ifdef __DATAFILE__ + _close(mm_datafile); +#endif + int i; + TBlock *Block; + for(i=0,Block=mm_BlockList;iflag & BLF_UNREADY)) + delete Block->addr.ptr; + } +} + +#ifdef __VISUALIZE__ +void mm_visualize() { + int i, j; + void far *p; + char far *vp = (char _seg *)0xA000+(char near *)0, far *app; + char col; + TBlock *Block = mm_BlockList; + app = vp; + //for (i=640;i--;) *(vp++)=0; + vp = app += 320*168; + for (i=mm_memblocks;i--;) *(vp++)=0; + for (i=0;iflag & BLF_UNREADY)) { + p = Block->addr.ptr; + asm { + MOV AX, WORD PTR p + MOV BX, WORD PTR p[2] + SHR AX, 5 + SHR BX, 1 + ADD AX, BX + MOV WORD PTR vp, AX // !!! + } + if (Block->flag & BLF_LOCKED) col = 128; else + if (Block->flag & BLF_USED) col = 112; else col = 1; + for (j=Block->size>>5;j--;) *(vp++) = col; + } else col=0; + if (Block->flag & BLF_XMS) /*col=118;*/ col = 96; + *(app+i) = col; + } +} +#endif + +/* +char mm_check() { + int idx; + TBlock *Block = mm_BlockList; + for (int i=0; iflag & BLF_XMS) && (idx=mm_findxmsidx(i))!=-1 && + (Block->addr.ofs != mm_XMSList[idx].addr.ofs)) + return 0; + return 1; +} +*/ + +#ifdef __MAKEDATA__ +#ifndef __DATAFILE__ +void mm_makedatafile() { + int datafile, i; + //long filepos; + TBlock *Block; + void far *ptr; +#ifdef __PACKED_BDF__ + void far *cmpptr; + word cmpsize; +#endif + + mm_resetall(); + + if ((datafile = _creat(DATAFILENAME,0x20/*FA_ARCH*/)) >= 0) { + _write(datafile,&idBDF,8); + _write(datafile,&mm_memblocks,sizeof(mm_memblocks)); + //filepos = 8l+sizeof(mm_memblocks)+(((long)mm_memblocks+1)*sizeof(long)); + /* + for (i=0,Block=mm_BlockList;isize; + } + _write(datafile,&filepos,sizeof(long)); + */ + for (i=0,Block=mm_BlockList;isize,sizeof(word)); +#ifdef __PACKED_BDF__ + _write(datafile,mm_BlockList,mm_memblocks*sizeof(word)); + // Warning! Ho solo lasciato lo spazio! La scrittura vera avverr… + // in seguito... +#endif + for (i=0,Block=mm_BlockList;isize<<1)) == NULL) // double size (!) + error("mm_makedatafile","can't pack"); + + cmpsize = mm_compress(ptr,cmpptr,Block->size); + lseek(datafile,8l+sizeof(mm_memblocks)+ + mm_memblocks*sizeof(word)+(i<<1),SEEK_SET); + _write(datafile,&cmpsize,sizeof(word)); + lseek(datafile,0,SEEK_END); // aggiunge + encrypt(cmpptr,cmpsize); // EEEEeeeeeh, e che Š ?!!! + _write(datafile,cmpptr,cmpsize); + delete cmpptr; + mm_unlock(i); +#else + encrypt(ptr,Block->size); + _write(datafile,ptr,Block->size); + decrypt(ptr,Block->size); +#endif + } else error("mm_makedatafile","can't recall"); + _close(datafile); + } else error("mm_makedatafile","can't create"); +} +#endif +#endif +// !!! +#pragma exit mm_done 64 diff --git a/KaosSrc/mm4.hpp b/KaosSrc/mm4.hpp new file mode 100644 index 0000000..95292df --- /dev/null +++ b/KaosSrc/mm4.hpp @@ -0,0 +1,55 @@ +/************************************************************************ + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + ************************************************************************/ + +#define MM_MAXALLOC 4096 +#define MAXMEMBLOCKS 581 +#ifdef __DATAFILE__ +#define MAXXMSBLOCKS 480 +#else +#define MAXXMSBLOCKS 768 +#endif + +#define DATAFILENAME "KAOS.BDF" + +#define BLF_USED 0x01 +#define BLF_XMS 0x02 +#define BLF_DISK 0x04 +#define BLF_LOCKED 0x08 + +#define BLF_UNREADY (BLF_XMS|BLF_DISK) +#define BLF_UNUSED 0xfe + +#ifdef __MAINCHECK__ +extern long mm_mainmem; +#endif + +extern void far *mm_reserve(word size); +//extern void far *mm_alloc(word size, int &id); +extern int mm_alloc(word size); +extern word mm_getblocksize(int id); +extern void far *mm_recall(int id); +extern void mm_unload(int id); +extern byte mm_lock(int id); +extern byte mm_unlock(int id); +extern unsigned long mm_memavail(); +extern unsigned long mm_totalloc(); +extern unsigned long mm_freealloc(); +extern void mm_reset(); +extern void mm_resetall(); +extern void mm_flushall(); +extern void mm_init(); +extern void mm_done(); +#ifdef __VISUALIZE__ +extern void mm_visualize(); // !!!!!!!!!!!!!!!!!!!!!!!!!!!!! +#endif +/* +extern char mm_check(); +*/ +//extern int mm_xmsblocks; +#ifdef __MAKEDATA__ +extern void mm_makedatafile(); +#endif \ No newline at end of file diff --git a/KaosSrc/mp.cpp b/KaosSrc/mp.cpp new file mode 100644 index 0000000..6345ff0 --- /dev/null +++ b/KaosSrc/mp.cpp @@ -0,0 +1,694 @@ +/************************************************************************ + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + ************************************************************************/ + +#include "std.hpp" +#include +#include +#include + +#include + +#define MAXTRACKS 24 +#define MAXCHANNELS 10 +/* +// Registers for the Sound Blaster card - (add I/O base) +#define sbReset 0x06 // W +#define sbFMStatus 0x08 // R +#define sbFMAddr 0x08 // W +#define sbFMData 0x09 // W +#define sbReadData 0x0a // R +#define sbWriteCmd 0x0c // W +#define sbWriteData 0x0c // W +#define sbWriteStat 0x0c // R +#define sbDataAvail 0x0e // R + +// Registers for the Sound Blaster Pro card - (add I/O base) +#define sbpLFMStatus 0x00 // R +#define sbpLFMAddr 0x00 // W +#define sbpLFMData 0x01 // W +#define sbpRFMStatus 0x02 // R +#define sbpRFMAddr 0x02 // W +#define sbpRFMData 0x03 // W +#define sbpMixerAddr 0x04 // W +#define sbpMixerData 0x05 // RW +#define sbpCDData 0x10 // R +#define sbpCDCommand 0x10 // W +#define sbpCDStatus 0x11 // R +#define sbpCDReset 0x12 // W +*/ + +// Registers for the AdLib card +#define alFMStatus 0x388 // R +#define alFMAddr 0x388 // W +#define alFMData 0x389 // W + +// Register addresses +#define alTimer1 2 +#define alTimer2 3 +#define alTimerControl 4 +// Operator stuff +#define alAVEKM 0x20 +#define alKOutLev 0x40 +#define alAttDec 0x60 +#define alSusRel 0x80 +#define alWave 0xe0 +// Channel stuff +#define alFreqL 0xa0 +#define alFreqH 0xb0 +#define alFeedCon 0xc0 +// Global stuff +#define alAMVDR 0xbd // Effects + +// Timer control commands +#define TCC_STARTT1 0x21 +#define TCC_STARTT2 0x42 +#define TCC_IRQRESET 0x80 +#define TCC_HALT 0xe0 +#define TCC_STOP 0x00 +#define TCC_CONTINUET1 0x01 +#define TCC_CONTINUET2 0x02 +#define TCC_RESET 0x60 +/* +#define TCC_STARTT1 0xa2 +#define TCC_STARTT2 0xc1 +#define TCC_IRQRESET 0x80 +#define TCC_HALT 0xe0 +#define TCC_STOP 0x00 +#define TCC_CONTINUET1 0x02 +#define TCC_CONTINUET2 0x01 +*/ +// Timer control monitor +#define TCM_IRQ 0x80 +#define TCM_IRQT1 0xc0 +#define TCM_IRQT2 0xa0 + +#define ULONG unsigned long +#define BOOL char +#define FALSE 0 +#define TRUE 1 + +// Macro +#define status() inportb(alFMStatus) +#define MakeFirm(a,b,c,d) ((ULONG)a+((ULONG)b<<8)+((ULONG)c<<16)+((ULONG)d<<24)) + +const ULONG MThd = MakeFirm('M','T','h','d'), + MTrk = MakeFirm('M','T','r','k'); + +typedef struct { + byte mAVEKM,cAVEKM, + mKOutLev,cKOutLev, + mAttDec,cAttDec, + mSusRel,cSusRel, + mWave,cWave, + nFeedCon, + unused[5]; // 16 bytes bound + } TInstrument; + +typedef struct { + //word far *seq; + long curpos; + long wait; + byte oldevent; + char oldmeta; + } TTrack; + +BOOL mp_active = FALSE, + mp_playing = FALSE, + mp_changetempo = FALSE; +int mp_handle = -1, + mp_numtracks = 0; + +long mp_totalwait = 0l, + mp_waitdown = 0l, + mp_timeslice = 0l, + mp_tickperquarter = 1l, + mp_microperquarter = 500000l, + mp_micropertick = 1l; // = microperquarter/tickperquarter +void interrupt (*mp_oldtimer)(...); + +// This table maps channel numbers to carrier and modulator op cells +static byte modulators[9] = { 0, 1, 2, 8, 9,10,16,17,18}, + carriers[9] = { 3, 4, 5,11,12,13,19,20,21}, +// This table maps percussive voice numbers to op cells + pmodulators[5] = {16, 17, 18, 20, 21}, + pcarriers[5] = {19,0xff,0xff,0xff,0xff}; +word fnums[12] = {363,385,408,432,458,485,514,544,577,611,647,686}; +TTrack track[MAXTRACKS]; + +const TInstrument Instrument[10] = { +{0x21,0x11,0x4C,0x00,0xF1,0xF2,0x63,0x72, // Instrument 0 + 0x00,0x00,0x04,0x00,0x00,0x00,0x00,0x00}, +{0xA5,0xB1,0xD2,0x80,0x81,0xF1,0x03,0x05, // Instrument 1 + 0x00,0x00,0x02,0x00,0x00,0x00,0x00,0x00}, +{0x72,0x62,0x1C,0x05,0x51,0x52,0x03,0x13, // Instrument 2 + 0x00,0x00,0x0E,0x00,0x00,0x00,0x00,0x00}, +{0x11,0x01,0x8A,0x40,0xF1,0xF1,0x11,0xB3, // Instrument 3 + 0x00,0x00,0x06,0x00,0x00,0x00,0x00,0x00}, +{0x21,0x11,0x11,0x00,0xA3,0xC4,0x43,0x22, // Instrument 4 + 0x02,0x00,0x0D,0x00,0x00,0x00,0x00,0x00}, +{0x31,0xA1,0x1C,0x80,0x41,0x92,0x0B,0x3B, // Instrument 5 + 0x00,0x00,0x0E,0x00,0x00,0x00,0x00,0x00}, +{0x71,0x62,0xC5,0x05,0x6E,0x8B,0x17,0x0E, // Instrument 6 + 0x00,0x00,0x02,0x00,0x00,0x00,0x00,0x00}, +{0x41,0x91,0x83,0x00,0x65,0x32,0x05,0x74, // Instrument 7 + 0x00,0x00,0x0A,0x00,0x00,0x00,0x00,0x00}, +{0x32,0x16,0x87,0x80,0xA1,0x7D,0x10,0x33, // Instrument 8 + 0x00,0x00,0x08,0x00,0x00,0x00,0x00,0x00}, +{0x01,0x13,0x8D,0x00,0x51,0x52,0x53,0x7C, // Instrument 9 + 0x01,0x00,0x0C,0x00,0x00,0x00,0x00,0x00}}; + +void al_out(byte port, byte data) { +asm { + //pushf + //cli + MOV DX, 0x388 + MOV AL, port + OUT DX, AL + IN AL, DX + IN AL, DX + IN AL, DX + IN AL, DX + IN AL, DX + IN AL, DX + INC DX + MOV AL, data + OUT DX, AL + //popf + DEC DX + + MOV CX, 35 // 35 +} c1: asm { + IN AL, DX + LOOP c1 +}} + +char mp_DetectAdLib() { + byte status1,status2; + int i; + + al_out(alTimerControl,0x60); // Reset & Mask T1 & T2 + al_out(alTimerControl,0x80); // Reset IRQ + status1 = status(); + al_out(alTimer1,0xff); // Set timer 1 + al_out(alTimerControl,0x21); // Start timer 1 & Mask timer 2 + asm { + MOV DX, 0x388 + MOV CX, 100 + } waitloop: asm { + IN AL, DX + LOOP waitloop + } + status2 = status(); + al_out(alTimerControl,0x60); // Stop + al_out(alTimerControl,0x80); // Reset + if ((!(status1 & 0xe0)) && ((status2 & 0xe0) == 0xc0)) { + for (i=1;i<=0xf5;i++) // Zero all the registers + al_out(i,0); + al_out(1,0x20); // WS=1 + al_out(8,0); // CSM=0 & KS=0 + return 1; + } + return 0; +} + +/* +void mp_setinstrument(int tracknum, int channel, TInstrument *inst, + char percussive) { + byte c, m; + if (percussive) { + c = pcarriers[channel]; + m = pmodulators[channel]; + } else { + c = carriers[channel]; + m = modulators[channel]; + } + + track[tracknum]->inst = *inst; + track[tracknum]->percussive = percussive; + + al_out(alAVEKM + m, inst->mAVEKM); + al_out(alKOutLev + m, inst->mKOutLev); + al_out(alAttDec + m, inst->mAttDec); + al_out(alSusRel + m, inst->mSusRel); + al_out(alWave + m, inst->mWave); + + // Most percussive instruments only use one cell + if (c != 0xff) { + al_out(alAVEKM + c, inst->cAVEKM); + al_out(alKOutLev + c, inst->cKOutLev); + al_out(alAttDec + c, inst->cAttDec); + al_out(alSusRel + c, inst->cSusRel); + al_out(alWave + c, inst->cWave); + } + + al_out(alFeedCon + channel, inst->nFeedCon); // DEBUG +} +*/ + +void mp_setinstrument(byte channel, TInstrument &inst) { + byte c, m; + + if (channel >= MAXCHANNELS) + ...channel -= 9; + if (percussive) { + c = pcarriers[channel]; + m = pmodulators[channel]; + } else { + c = carriers[channel]; + m = modulators[channel]; + } + + al_out(alAVEKM +m,inst.mAVEKM); + al_out(alKOutLev+m,inst.mKOutLev); + al_out(alAttDec +m,inst.mAttDec); + al_out(alSusRel +m,inst.mSusRel); + al_out(alWave +m,inst.mWave); + + // Most percussive instruments only use one cell + if (c != 0xff) { + al_out(alAVEKM +c,inst.cAVEKM); + al_out(alKOutLev+c,inst.cKOutLev); + al_out(alAttDec +c,inst.cAttDec); + al_out(alSusRel +c,inst.cSusRel); + al_out(alWave +c,inst.cWave); + } + al_out(alFeedCon+channel,inst.nFeedCon); // DEBUG +} + +void mp_NoteOn(byte channel, byte octave, byte note) { + word note2; + byte bl,bh; + + note2 = fnums[note]; + bl = (byte)(note2 & 0x00ff); + bh = (byte)(note2 >> 8)+(octave << 2) | 0x20; + al_out(alFreqL + channel,bl); + al_out(alFreqH + channel,bh); +} + +void mp_NoteOff(byte channel, byte octave, byte note) { + word note2; + byte bl,bh; + + note2 = fnums[note]; + bl = (byte)(note2 & 0x00ff); + bh = (byte)(note2 >> 8)+(octave << 2); + al_out(alFreqL + channel,bl); + al_out(alFreqH + channel,bh); +} + +void mp_MusicOn(void) { + if (mp_handle >= 0) { + al_out(alAMVDR,0); + mp_waitdown = 0l; + mp_totalwait = 0l; + mp_timeslice = 0l; + mp_playing = TRUE; + al_out(alTimerControl,0x60); // Reset & Mask T1 & T2 + al_out(alTimerControl,0x80); // Reset IRQ + al_out(alTimer1,0xff); // Set T2 + al_out(alTimerControl,TCC_STARTT1); // StartT2 + } +} + +void mp_MusicOff(void) { + if (mp_playing) { + al_out(alAMVDR,0); + for (int i=0; i= 0) { + close(mp_handle); + mp_handle = -1; + } +} + +#pragma warn -rvl +ULONG adjustulong(ULONG num) { +asm { + MOV DX, WORD PTR num + MOV AX, WORD PTR num[2] + XCHG AH, AL + XCHG DH, DL +} } + +ULONG adjusttribyte(ULONG num) { +asm { + MOV AL, BYTE PTR num[2] + MOV AH, BYTE PTR num[1] + MOV DL, BYTE PTR num + XOR DH, DH +} } + +unsigned adjustint(unsigned num) { +asm { + MOV AH, BYTE PTR num + MOV AL, BYTE PTR num[1] +} } +#pragma warn +rvl + +BOOL findfirm(const ULONG realfirm) { + ULONG firm, data = 0l; + + _read(mp_handle,&firm,4); + while (firm != realfirm && !eof(mp_handle)) { + _read(mp_handle,&data,1); // !!! + firm = (firm<<8) | data; + } + return (firm == realfirm); +} + +void play_note(int channel, byte num, byte spd) { + byte note = num % 12, + oct = num / 12, + ch; + /* + if (channel<9) ch = carriers[channel]; + else ch = pcarriers[channel-9]; + */ + ch = channel; + if (!spd) { + mp_NoteOff(ch,oct,note); + } else { + mp_NoteOn(ch,oct,note); + } +} + +long handle_trackevents(TTrack &curtrack) { + long totdelay; + byte channel,event, + bdat,bdat2; + BOOL meta; + int i; + + // read delay + bdat = 0l; + _read(mp_handle,&bdat,1); + curtrack.curpos++; + totdelay = bdat & 0x7f; + for (i=3; i--; ) + if (bdat & 0x80) { + _read(mp_handle,&bdat,1); + curtrack.curpos++; + totdelay = (totdelay<<7) + (bdat & 0x7f); + } else break; + // read event + _read(mp_handle,&event,1); + curtrack.curpos++; + if (!(event & 0x80)) { // event == no-event ? + bdat = event; + meta = curtrack.oldmeta; + event = curtrack.oldevent; + } else { + if ((meta = (event == 0xff)) != 0) { // meta-event ? + _read(mp_handle,&event,1); + curtrack.curpos++; + } + curtrack.oldmeta = meta; + curtrack.oldevent = event; + if ((event & 0xf0) != 0xf0) { // if not a system event, get 1st data + _read(mp_handle,&bdat,1); + curtrack.curpos++; + } + } + if (!meta) { + channel = event & 0x0f; + switch(event & 0xf0) { + case 0x80: // Note Off + _read(mp_handle,&bdat2,1); + curtrack.curpos++; + play_note(channel,bdat,0); + break; + case 0x90: // Note On + _read(mp_handle,&bdat2,1); + curtrack.curpos++; + play_note(channel,bdat,bdat2); + break; + case 0xa0: // Note after-touch + _read(mp_handle,&bdat2,1); + //printf("note %d after-touch (vel.%d)\n",bdat,bdat2); + curtrack.curpos++; + //play_note(bdat,bdat2); + break; + case 0xb0: // controller change + _read(mp_handle,&bdat2,1); + //printf("controller %d change to %d\n",bdat,bdat2); + curtrack.curpos++; + break; + case 0xc0: + //printf("program change to %d\n",bdat); + break; + case 0xd0: + //printf("channel after-touch to %d\n",bdat); + break; + case 0xe0: + _read(mp_handle,&bdat2,1); + curtrack.curpos++; + //printf("pitch wheel change of %d\n",(int)bdat+((int)bdat2<<7)); + break; + case 0xf0: // system event + /* + switch(event) { + case 0xf8: + printf("time sync\n"); + break; + case 0xfa: + printf("start sequence\n"); + break; + case 0xfb: + printf("continue sequence\n"); + break; + case 0xfc: + printf("stop sequence\n"); + break; + } + */ + break; + default: + // printf("???\n"); + break; + } + } else { // meta event + //printf(" me: "); + switch(event) { + case 0x2f: // end of track + //printf("end of track\n"); + curtrack.curpos = -1; + break; + case 0x51: // Set tempo + mp_microperquarter = 0l; + _read(mp_handle,&mp_microperquarter,bdat); + curtrack.curpos += bdat; + if (bdat==3) mp_microperquarter = adjusttribyte(mp_microperquarter); else + if (bdat==4) mp_microperquarter = adjustulong(mp_microperquarter); else + if (bdat==2) mp_microperquarter = adjustint(mp_microperquarter); + mp_changetempo = 1; + break; + case 0x58: + //printf("time signature: (%d) ...\n",bdat); + for (i=0;i=0) + curtrack.curpos = tell(mp_handle); + return totdelay; +} + +void mp_scantracks() { + BOOL dontstop = FALSE; + long mindelay, //totalticks, + totalmicro; + int i; + + //totalticks = mp_totalwait*320/mp_micropertick; // T2 va a 320microsec + totalmicro = mp_totalwait*80; //*320; + + //cprintf("totalwait = %ld\r\n",mp_totalwait); + //sound(300);delay(10);nosound();delay(100); + mindelay = 0x7fffffffl; + for (i=0; i= 0) { + if ((curtrack.wait -= totalmicro) <= 0) { + lseek(mp_handle,curtrack.curpos,SEEK_SET); + while (!kbhit() && curtrack.wait <= 0 && curtrack.curpos >= 0) + curtrack.wait += handle_trackevents(curtrack)*mp_micropertick; + } + if (curtrack.curpos >= 0) { + dontstop = TRUE; + if (curtrack.wait= 0) { + if (findfirm(MThd)) { + _read(mp_handle,&data,4); + data = adjustulong(data); + if (data == 6) { // header length + data = 0l; + _read(mp_handle,&data,2); + data = adjustint(data); + if (data <= 1) { // single or syncronous tracks + data = 0l; + _read(mp_handle,&data,2); + mp_numtracks = adjustint(data); + data = 0l; + _read(mp_handle,&data,2); + mp_tickperquarter = adjustint(data); + for(i=1; i<=mp_numtracks; i++) { + if (findfirm(MTrk)) { + _read(mp_handle,&data,4); + data = adjustulong(data); + track[i].curpos = tell(mp_handle); + track[i].wait = 0l; + lseek(mp_handle,data,SEEK_CUR); + } else error("main","no more tracks"); + } + for (i=mp_numtracks; i= 256l) { + mp_timeslice = 256l; + al_out(alTimer1,0); + } else { + al_out(alTimer1,(byte)(256l-(mp_timeslice = mp_waitdown))); + } + al_out(alTimerControl,TCC_CONTINUET1); + //al_out(alTimerControl,TCC_STARTT2); + } else al_out(alTimerControl,TCC_RESET); + */ + outportb(0x20,0x20); + } else + mp_oldtimer(); +} + +void mp_idle() { + if ((status() & TCM_IRQ) != 0) { + al_out(alTimerControl,TCC_RESET); + al_out(alTimerControl,TCC_IRQRESET); + // remaining time calculation + mp_totalwait += mp_timeslice; + if ((mp_waitdown -= mp_timeslice) <= 0) + mp_scantracks(); + if (mp_playing) { + if (mp_waitdown >= 256l) { + mp_timeslice = 256l; + al_out(alTimer1,0); + } else { + al_out(alTimer1,(byte)(256l-(mp_timeslice = mp_waitdown))); + } + al_out(alTimerControl,TCC_CONTINUET1); + //al_out(alTimerControl,TCC_STARTT2); + } //else al_out(alTimerControl,TCC_RESET); + } +} + +void mp_init() { + if ((mp_active = mp_DetectAdLib()) != 0) { + mp_playing = FALSE; + // Installs new hooked handler + mp_oldtimer = getvect(0x08); + setvect(0x08,mp_newtimer); + for (int i=0; i> 8)+0x20+(octave << 2); + b1 = (byte)(note2 & 0x00ff); + mp_Block_FNum(instnum,b1,b2); +} + +void mp_NoteOff(byte instnum, byte octave, byte note) { + word note2; + byte b1,b2; + + note2 = fnums[note]; + b2 = (byte)(note2 >> 8)+(octave << 2); + b1 = (byte)(note2 & 0x00ff); + mp_Block_FNum(instnum,b1,b2); +} + +void mp_setinstrument(int tracknum, int chnum, TInstrument *inst, + char percussive) { + byte c, m; + if (percussive) { + c = pcarriers[chnum]; + m = pmodifiers[chnum]; + } else { + c = carriers[chnum]; + m = modifiers[chnum]; + } + + tracks[track-1]->inst = *inst; + tracks[track-1]->percussive = percussive; + + alOut(m + alChar,inst->mChar); + alOut(m + alScale,inst->mScale); + alOut(m + alAttack,inst->mAttack); + alOut(m + alSus,inst->mSus); + alOut(m + alWave,inst->mWave); + + // Most percussive instruments only use one cell + if (c != 0xff) { + alOut(c + alChar,inst->cChar); + alOut(c + alScale,inst->cScale); + alOut(c + alAttack,inst->cAttack); + alOut(c + alSus,inst->cSus); + alOut(c + alWave,inst->cWave); + } + + alOut(chnum + alFeedCon,inst->nFeedCon); // DEBUG +} + +void mp_MusicOn(void) { + mp_mactive = 1; +} + +void mp_MusicOff(void) { +{ + word i; !!! + + alFXReg = 0; + alOut(alEffects,0); + for (i = 0;i < sqMaxTracks;i++) + alOut(alFreqH + i + 1,0); + sm_mactive = 0; +} + +void mp_StartMusic(MusicGroup far *music) { + mp_MusicOff(); +//asm pushf +//asm cli + sqHackPtr = sqHack = music->values; + sqHackSeqLen = sqHackLen = music->length; + sqHackTime = 0; + alTimeCount = 0; + mp_MusicOn(); +//asm popf +} \ No newline at end of file diff --git a/KaosSrc/objects.cpp b/KaosSrc/objects.cpp new file mode 100644 index 0000000..9db275c --- /dev/null +++ b/KaosSrc/objects.cpp @@ -0,0 +1,992 @@ +/************************************************************************ + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + ************************************************************************/ + +// OBJECTS - (C)1997 Nicosoźt (Valentini Domenico) + +#include "std.hpp" +#include "fastmem.hpp" +#include "fixed.h" +#include "events.hpp" +#include "doors.hpp" +#include "3dengine.hpp" +#include "mm4.hpp" +#include "crcio.hpp" +#include "kaos.hpp" +#include "objects.hpp" +#include "lgraph.hpp" + +#include "infobar.hpp" // !!!! + +TArm ArmList[MAXARMS] = { + {AFL_ASCIA, 8, 36, -1, -1}, + {AFL_PISTOLA, 7, 18, 20,100}, + {AFL_FUCILE, 8, 36, 10, 80}, + {AFL_MITRA, 6, 5, 48,200}, + {AFL_BAZOOKA, 20, 30, 2, 20}, + {AFL_BOMB, 20, 30, 1, 20} +}; + +Mover::Mover(int handle) { // Constructor Load + // don't load the type (loaded by the object for dispatching) + // Questo metodo fa veramente schifo, sono sicuro che ce n'Š + // uno migliore... + CRC_read(handle,&id,sizeof(id)); + CRC_read(handle,&x,sizeof(x)); + CRC_read(handle,&y,sizeof(y)); + CRC_read(handle,&z,sizeof(z)); + CRC_read(handle,&angle,sizeof(angle)); + CRC_read(handle,&shdim,sizeof(shdim)); + CRC_read(handle,&flags,sizeof(flags)); + CRC_read(handle,&index,sizeof(index)); + CRC_read(handle,&under,sizeof(under)); +} + +void Mover::save(int handle) { + CRC_write(handle,&mover_type,sizeof(mover_type)); + CRC_write(handle,&id,sizeof(id)); + CRC_write(handle,&x,sizeof(x)); + CRC_write(handle,&y,sizeof(y)); + CRC_write(handle,&z,sizeof(z)); + CRC_write(handle,&angle,sizeof(angle)); + CRC_write(handle,&shdim,sizeof(shdim)); + CRC_write(handle,&flags,sizeof(flags)); + CRC_write(handle,&index,sizeof(index)); + CRC_write(handle,&under,sizeof(under)); +} + +void Mover::enqueue(int idx, int &undr) { + undr = IDMap[idx]; + IDMap[idx] = id; + objmap[idx] += flags; +} + +void Mover::dequeue(int idx, int undr) { + int top; + + if ((top = IDMap[idx]) == id) + IDMap[idx] = undr; + else { + Mover *mvr; + while ((top = (mvr = objectslist.get(top)->mover)->underq(idx)) != id); + mvr->correctq(idx,undr); + } + objmap[idx] -= flags; +} + +#pragma warn -par +void Mover::correctq(int idx, int undid) { + under = undid; +} +#pragma warn +par + +void Mover::place() { + enqueue(index = xytoidx(x,y), under); +} + +void Mover::remove() { + dequeue(index, under); +} + +char Mover::canmove(fixed nx, fixed ny) { + int idx, top; + Mover *mvr; + fixed dist; + // !!! si possono togliere i margini !? + if ((nx >= (32l<= (32l<=0) { + mvr = objectslist.get(top)->mover; + if (mvr->flags & OMM_UNWALKABLE) { + dist = (FIXONE<shdim); + /* + if (LABS(mvr->x-nx) <= dist || + LABS(mvr->y-ny) <= dist) return 0; + */ + //if (fixdist(mvr->x-nx,mvr->y-ny) <= dist) return 0; + if (LABS(mvr->x-nx)+LABS(mvr->y-ny) <= dist) return 0; // !!!!! + } + top = mvr->underq(idx); + } + return 1; + } + return 0; +} + +char Mover::move(int ang, int lshift) { + fixed nx = x + (costab[ang]<0) {if (canmove(nx+dim,y-vdim) && canmove(nx+dim,y+vdim)) {x=nx;moved++;}} else + if (ca<0) {if (canmove(nx-dim,y-vdim) && canmove(nx-dim,y+vdim)) {x=nx;moved++;}} + if (sa>0) {if (canmove(x-vdim,ny+dim) && canmove(x+vdim,ny+dim)) {y=ny;moved++;}} else + if (sa<0) {if (canmove(x-vdim,ny-dim) && canmove(x+vdim,ny-dim)) {y=ny;moved++;}} + if (moved && (!ca || !sa)) moved++; + return moved; //(moved==2); + /* + ax = sa<0l) {if (canmove(nx+dim,y-ay) && canmove(nx+dim,y+ay)) {x=nx;moved++;}} + else if (canmove(nx-dim,y-ay) && canmove(nx-dim,y+ay)) {x=nx;moved++;} + if (!sa) moved++; else + if (sa>0l) {if (canmove(x-ax,ny+dim) && canmove(x+ax,ny+dim)) {y=ny;moved++;}} + else if (canmove(x-ax,ny-dim) && canmove(x+ax,ny-dim)) {y=ny;moved++;} + return (moved==2); + */ +} + +char Mover1::fluidmove(int ang, fixed mult) { + fixed ca = costab[ang], + sa = sintab[ang], + nx = x + fixmul(ca,mult), + ny = y + fixmul(sa,mult), + dim = (FIXONE<0) {if (canmove(nx+dim,y-vdim) && canmove(nx+dim,y+vdim)) {x=nx;moved++;}} else + if (ca<0) {if (canmove(nx-dim,y-vdim) && canmove(nx-dim,y+vdim)) {x=nx;moved++;}} + if (sa>0) {if (canmove(x-vdim,ny+dim) && canmove(x+vdim,ny+dim)) {y=ny;moved++;}} else + if (sa<0) {if (canmove(x-vdim,ny-dim) && canmove(x+vdim,ny-dim)) {y=ny;moved++;}} + if (moved && (!ca || !sa)) moved++; + return moved; //(moved==2); + /* + if (!ca) moved++; else + if (ca>0l) {if (canmove(nx+dim,y-vdim) && canmove(nx+dim,y+vdim)) {x=nx;moved++;}} + else if (canmove(nx-dim,y-vdim) && canmove(nx-dim,y+vdim)) {x=nx;moved++;} + if (!sa) moved++; else + if (sa>0l) {if (canmove(x-vdim,ny+dim) && canmove(x+vdim,ny+dim)) {y=ny;moved++;}} + else if (canmove(x-vdim,ny-dim) && canmove(x+vdim,ny-dim)) {y=ny;moved++;} + return (moved==2); + */ + /* + + ax = sa<0l) {if (canmove(nx+dim,y-ay) && canmove(nx+dim,y+ay)) {x=nx;moved++;}} + else if (canmove(nx-dim,y-ay) && canmove(nx-dim,y+ay)) {x=nx;moved++;} + if (!sa) moved++; else + if (sa>0l) {if (canmove(x-ax,ny+dim) && canmove(x+ax,ny+dim)) {y=ny;moved++;}} + else if (canmove(x-ax,ny-dim) && canmove(x+ax,ny-dim)) {y=ny;moved++;} + return (moved==2); + */ + /* + if (!ca) moved++; else + if (ca>0l) {if (canmove(nx+(FIXONE<0l) {if (canmove(x,ny+(FIXONE<0l) {if (canmove(nx+(FIXONE<0l) {if (canmove(x,ny+(FIXONE<0l) {if (canmove(nx+(FIXONE<0l) {if (canmove(x,ny+(FIXONE<= (32l<= (32l<>5) & 1 == (lshr16(nx)>>5) & 1) && + ((lshr16(nx)>>5) & 1) ^ ((lshr16(x)>>5) & 1)) + return 0; + break; + case MSH_HORIZ: + if (((lshr16(y)>>5) & 1 == (lshr16(ny)>>5) & 1) && + ((lshr16(ny)>>5) & 1) ^ ((lshr16(y)>>5) & 1)) + return 0; + break; + case MSH_DIAG1: + if (((lshr16(x)>>6)+(lshr16(y)>>6) & 1) ^ + ((lshr16(nx)>>6)+(lshr16(ny)>>6) & 1) && + ((lshr16(LMAX_X-1-nx+ny)>>6) & 1) ^ + ((lshr16(LMAX_Y-1-x+y)>>6) & 1)) + return 0; + break; + case MSH_DIAG2: + if (((lshr16(x)>>6)+(lshr16(y)>>6) & 1) ^ + ((lshr16(nx)>>6)+(lshr16(ny)>>6) & 1) && + ((lshr16(nx+ny)>>6) & 1) ^ + ((lshr16(x+y)>>6) & 1)) + return 0; + break; + } + } + top = IDMap[idx]; + while (top) { + mvr = objectslist.get(top-1)->mover; + if (mvr->flags & OMM_UNWALKABLE) { + dist = (FIXONE<shdim); + + //if (LABS(mvr->x-nx) <= dist || + // LABS(mvr->y-ny) <= dist) return 0; + //if (fixdist(mvr->x-nx,mvr->y-ny) <= dist) return 0; + if (LABS(mvr->x-nx)+LABS(mvr->y-ny) <= dist) return 0; // !!!!! + } + top = mvr->underq(idx); + } + return 1; + } + } + return 0; +} +*/ +/* +char Mover3::canmove(fixed nx, fixed ny) { + char candoit; + int id, idx, xang, yang; + Mover *mvr; + fixed cx,cy,alt,dist,basedist; + basedist = FIXONE<= (32l<= (32l<x) xang=ANG0; else xang=ANG180; + cx=x;cy=y; + id = fireray(cx,cy,xang,dist,alt,id); + candoit = (dist>=basedist) || (id<-1); + //if (disty) yang=ANG90; else yang=ANG270; + cx=x;cy=y; + id = fireray(cx,cy,yang,dist,alt,id); + candoit = candoit && ((dist>=basedist) || (id<-1)); + if (xang==ANG0) + if (yang==ANG90) xang=ANG45; + else xang=ANG270+ANG45; + else + if (yang==ANG90) xang=ANG90+ANG45; + else xang=ANG180+ANG45; + cx=x;cy=y; + id = fireray(cx,cy,xang,dist,alt,id); + candoit = candoit && ((dist>=basedist) || (id<-1)); + return candoit; + } + return 0; +} +*/ +Object::Object(fixed px, fixed py, int startfig, + char numfig, byte movertype) { + switch (movertype) { + case MVT_0: + delete mm_reserve(sizeof(Mover)); + mover = new Mover; + break; + case MVT_1: + delete mm_reserve(sizeof(Mover1)); + mover = new Mover1; + break; + case MVT_2: + delete mm_reserve(sizeof(Mover2)); + mover = new Mover2; + break; + /* + case MVT_3: + delete mm_reserve(sizeof(Mover3)); + mover = new Mover3; + break; + */ + default: error("Object","invalid Mover"); + } + if (mover == NULL) error("Object","no Mover"); + mover->x = px; + mover->y = py; + mover->z = 0l; + //mover->flags = OMF_UNWALKABLE | OMF_VISIBLE | OMF_HITABLE | OMF_SOUNDABLE; + mover->angle = 0; + mover->shdim = 4; + oflags = 0; + selflight = 0; + changefig(startfig,numfig); + object_type = OBJT_OBJECT; +} + +Object::Object(int handle) {// Constructor Load + byte movertype; + + CRC_read(handle,&movertype,sizeof(movertype)); + switch (movertype) { + case MVT_0: + delete mm_reserve(sizeof(Mover)); + mover = new Mover(handle); + break; + case MVT_1: + delete mm_reserve(sizeof(Mover1)); + mover = new Mover1(handle); + break; + case MVT_2: + delete mm_reserve(sizeof(Mover2)); + mover = new Mover2(handle); + break; + /* + case MVT_3: + delete mm_reserve(sizeof(Mover3)); + mover = new Mover3(handle); + break; + */ + default: error("Object","invalid Mover"); + } + if (mover == NULL) error("Object","no Mover"); + mover->mover_type = movertype; // Lo informo IO ! + CRC_read(handle,&oflags,sizeof(oflags)); + CRC_read(handle,&selflight,sizeof(selflight)); + CRC_read(handle,&figstart,sizeof(figstart)); + CRC_read(handle,&fignum,sizeof(fignum)); +} + +void Object::save(int handle) { + CRC_write(handle,&object_type,sizeof(object_type)); + mover->save(handle); //saves also the Mover Type + CRC_write(handle,&oflags,sizeof(oflags)); + CRC_write(handle,&selflight,sizeof(selflight)); + CRC_write(handle,&figstart,sizeof(figstart)); + CRC_write(handle,&fignum,sizeof(fignum)); +} + +void Object::changefig(int startfig, char numfig) { + if (startfig+numfig-1 < MAXFIGURES) { + if (numfig<0) { + oflags |= OFL_REVERSE; + numfig = -numfig; + } else oflags &= ~OFL_REVERSE; + if ((numfig==16) || (numfig==8) || + (numfig==4) || (numfig==2) || (numfig<=1)) { + figstart = startfig; + fignum = numfig; + } else error("Object::changefig","views must be powers of 2"); + } else error("Object::changefig","out of range"); +} + +int Object::getviewfig(int ang) { + int displ = ANG360 / fignum; + if (fignum > 1) { + int myfig = (ang-mover->angle+(displ >> 1)); + if (myfig=ANG360) myfig-=ANG360; + if (oflags & OFL_REVERSE) { + if ((myfig = (myfig/displ)&(fignum-1))>(fignum>>1)) { + myfig |= 0x4000; + myfig = fignum-myfig; + } + return figstart+myfig; + } else return figstart+((myfig/displ)&(fignum-1)); + } else + return figstart; +} + +void Object::handle_event(TEvent &event) { +int arctan[8][8] = { +{ANG45,ANG30,ANG30, ANG0, ANG0, ANG0, ANG0, ANG0}, +{ANG60,ANG45,ANG30,ANG30,ANG30, ANG0, ANG0, ANG0}, +{ANG60,ANG60,ANG45,ANG45,ANG30,ANG30,ANG30, ANG0}, +{ANG90,ANG60,ANG45,ANG45,ANG45,ANG30,ANG30,ANG30}, +{ANG90,ANG60,ANG60,ANG45,ANG45,ANG45,ANG45,ANG30}, +{ANG90,ANG90,ANG60,ANG60,ANG45,ANG45,ANG45,ANG45}, +{ANG90,ANG90,ANG60,ANG60,ANG45,ANG45,ANG45,ANG45}, +{ANG90,ANG90,ANG60,ANG60,ANG60,ANG45,ANG45,ANG45}}; + switch (event.what) { + case EV_GOT: eventmanager.sendcom(EV_KILL,mover->id); break; + case EV_BOOM: + fixed fdx, fdy; + int dx = lshr16(fdx = mover->x-event.data.pos.x), + dy = lshr16(fdy = mover->y-event.data.pos.y), + //power = (ABS(dx)+ABS(dy))/28, + ang = 0; + int power = fixdiv(fixdist(fdx,fdy),20l<<16); + if (power) power = event.data.pos.z/power; + else power = event.data.pos.z; + // if (power<4) break; + if (power<4 || lookray(mover->x,mover->y, + event.data.pos.x,event.data.pos.y,OMM_SOUNDABLE)) break; + // SOUNDABLE perchŠ le grate non devono bloccare !!! + if (!dx) if (dy>=0) ang=ANG90; else ang=ANG270; else + if (!dy) if (dx>=0) ang=ANG0; else ang=ANG180; else { + int d1x = dx, d1y = dy; + if (dx>0) {if (--dx>7) dx=7;} else + {if (++dx<-7) dx=-7;} + if (dy>0) {if (--dy>7) dy=7;} else + {if (++dy<-7) dy=-7;} + ang = arctan[ABS(dy)][ABS(dx)]; + if (d1x<0) ang=ANG180-ang; + if (d1y<0) ang=ANG360-ang; + if (ang=ANG360) ang-=ANG360; + } + eventmanager.senddirect(EV_HIT,event.source,mover->id,ang,power); + eventmanager.senddirect(EV_ADDSTAT,mover->id,event.source, + STT_TECNO,1); + if (GETFLAG(gameflags,GFL_SHOWBLOOD)) { + Object *obj; + if (doblood(ang)) + eventmanager.senddirect(EV_ADDSTAT,mover->id,event.source, + STT_BLOOD,5); + doblood(angleadd(ang,ANG45)); + doblood(anglesub(ang,ANG45)); + doblood(angleadd(ang,ANG45+ANG90)); + doblood(anglesub(ang,ANG45+ANG90)); + } + break; + } +} + +Object::~Object() { + if (!ShutDown) mover->remove(); + delete mover; +} + +Actor::Actor(int handle) + :Object(handle) { // Load Constructor + CRC_read(handle,&animcount,sizeof(animcount)); + CRC_read(handle,&health,sizeof(health)); +} + +void Actor::save(int handle) { + Object::save(handle); + CRC_write(handle,&animcount,sizeof(animcount)); + CRC_write(handle,&health,sizeof(health)); +} + +void Actor::setid(int the_id) { + Object::setid(the_id); + makeActor(); +}; + +char Actor::makeActor() { + if (!(oflags & OFL_ISACTOR)) { + actorslist.add(mover->id); + oflags |= OFL_ISACTOR; + return 1; + } + return 0; +} + +char Actor::makeObject() { + //actorslist.erase(mover->id); + if (oflags & OFL_ISACTOR) { + if (eventmanager.sendcom(EV_ERASEACT,mover->id)) { + oflags &= ~OFL_ISACTOR; + return 1; + } + } + return 0; +} + +char Actor::nearPlayer(fixed maxdist) { + return (is_nearPlayer(mover->x,mover->y,maxdist) >= 0); +} + +/* +byte Actor::getviewfig(int ang) { + int displ = ANG360 / fignum; + if (fignum > 0) + return figstart+(animcount*fignum)+(((ang-mover->angle+(displ >> 1)+ANG360) % ANG360)/displ) % fignum; + else + return figstart; ??? ma siamo sicuri che era cosŤ ? +} +*/ +int Actor::getviewfig(int ang) { + int displ = ANG360 / fignum; + if (fignum > 1) { + int myfig = (ang-mover->angle+(displ >> 1)); + if (myfig=ANG360) myfig-=ANG360; + if (oflags & OFL_REVERSE) { + if ((myfig = (myfig/displ)&(fignum-1))>(fignum>>1)) { + myfig |= 0x4000; + myfig = fignum-myfig; + } + return figstart+(animcount*((fignum>>1)+1))+myfig; + } else return figstart+(animcount*fignum)+((myfig/displ)&(fignum-1)); + } else + return figstart+animcount; +} + +/* +void Actor::handle_event(Event &event) { + // Object::handle_event(event); + if (event.what == EV_HIT && + (event.x == index1 || event.x == index2)) { + if ((health-=event.y) <= 0) + eventmanager.send(EV_KILL,id,0,0); + } +} +*/ + +void Actor::draw(int vidx, int vidy, char &cd, char &fd) { + drawview(vidx,vidy,mover->x,mover->y,mover->z, + mover->angle,0,mover->id,cd,fd,0); +} + +void Actor::virtualdraw() { + virtualview(mover->x,mover->y,mover->angle,mover->id); +} + +void Actor::transf(int vidx, int vidy) { + /* + if (viewwidth==320) ftransfarea(0,168,VMEMPTR); // !!! + else + */ + ftransfblock(vidx-halfwidth,vidy-halfheight,viewwidth,viewheight,VMEMPTR); +} + +Actor::~Actor() { + if (!ShutDown) actorslist.erase(mover->id); + //Object::~Object(); +} + +LightActor::LightActor(int handle) + :Actor(handle) { // Constructor Load + CRC_read(handle,&lightrange,sizeof(lightrange)); + if (GETFLAG(oflags,OFL_HASLIGHT)) { + CRC_read(handle,&lightz,sizeof(lightz)); + CRC_read(handle,&lightpow,sizeof(lightpow)); + } +} + +void LightActor::save(int handle) { + Actor::save(handle); + CRC_write(handle,&lightrange,sizeof(lightrange)); + if (GETFLAG(oflags,OFL_HASLIGHT)) { + CRC_write(handle,&lightz,sizeof(lightz)); + CRC_write(handle,&lightpow,sizeof(lightpow)); + } +} + +void LightActor::lights() { + if (!lightrange) return; + + int i,j,k; + int bx = lshr16(mover->x) >> 6, + by = lshr16(mover->y) >> 6, + lr2 = (lightrange<<1)-1; + char *map1 = &(LightMap[bxytoidx(bx-lightrange,by-lightrange)]), + *map2; + + for (i=-lightrange;i<=lightrange;i++,map1+=MAP_DX) + if ((bx+i) >= 0 && (bx+i) < MAP_DX ) + for (j=-lightrange,map2=map1;j<=lightrange;j++,map2++) + if ((by+j) >= 0 && (by+j) < MAP_DY ) + if ((k = lr2-(ABS(i)+ABS(j))) > 0) *map2 += k; +} + +void LightActor::unlights() { + if (!lightrange) return; + + int i,j,k; + int bx = lshr16(mover->x) >> 6, + by = lshr16(mover->y) >> 6, + lr2 = (lightrange<<1)-1; + char *map1 = &(LightMap[bxytoidx(bx-lightrange,by-lightrange)]), + *map2; + + for (i=-lightrange;i<=lightrange;i++,map1+=MAP_DX) + if ((bx+i) >= 0 && (bx+i) < MAP_DX ) + for (j=-lightrange,map2=map1;j<=lightrange;j++,map2++) + if ((by+j) >= 0 && (by+j) < MAP_DY ) + if ((k = lr2-(ABS(i)+ABS(j))) > 0) *map2 -= k; +} + +void LightActor::place() { + mover->place(); + lights(); +} + +void LightActor::remove() { + mover->remove(); + unlights(); +} + +LightActor::~LightActor() { + if (!ShutDown) unlights(); +} + +char CanFireActor::setarm(byte armtype) { + if (armtype == curarm) return 1; + if (GETFLAG(armflag,ArmList[armtype].flag) && !armcharge) { + if (armchanging<(ARMCHGSPEED/2)) { + oldarm = curarm; + armchanging = ARMCHGSPEED-armchanging; + } + curarm = armtype; + return 1; + } + return 0; +} + +//#pragma warn -par +char CanFireActor::fire(int angle) { + if (!armcharge && !armchanging && + (!curarm || Armbull[curarm-1]>0)) { + armcharge = ArmList[curarm].chargetime; + if (curarm) Armbull[curarm-1]--; + return 1; + } + return 0; +} +//#pragma warn +par + +CanFireActor::CanFireActor(fixed px, fixed py, int startfig, + char numfig, byte movertype) + :LightActor(px,py,startfig,numfig,0,0,movertype), + curarm(0), oldarm(0), + armcharge(0), armchanging(0), armflag(0) +{ object_type=OBJT_CANFIREACTOR; + fwfill(Armbull,0,sizeof(Armbull)); +} + +CanFireActor::CanFireActor(int handle) + :LightActor(handle) { // Constructor Load + CRC_read(handle,&armflag,sizeof(armflag)); + CRC_read(handle,&curarm,sizeof(curarm)); + CRC_read(handle,&armcharge,sizeof(armcharge)); + CRC_read(handle,Armbull,sizeof(Armbull)); + armchanging=0; //oldarm=curarm; +} + +void CanFireActor::save(int handle) { + LightActor::save(handle); + CRC_write(handle,&armflag,sizeof(armflag)); + CRC_write(handle,&curarm,sizeof(curarm)); + CRC_write(handle,&armcharge,sizeof(armcharge)); + CRC_write(handle,Armbull,sizeof(Armbull)); +} + +void CanFireActor::animate() { + // Object::animate(); + if (armchanging) { + armchanging--; + } else { + // Warning! It doesn't remove & place ! + if (curarm) { + lightrange = (armcharge+8)>>4; // !!! + if (!armcharge && !Armbull[curarm-1]) { + byte old = curarm; + byte app = curarm; + do { + while (app && !Armbull[app-1]) app--; + } while (!setarm(app--)); + // ! WARNING ! Non tutti dovrebbero farlo ! + // A questo punto era meglio nel setarm() !!! + if (old!=curarm) + eventmanager.sendshort(EV_UPDATEBAR,mover->id,0,IBR_ARMS,0); + } + } + if (armcharge) armcharge--; + } +} + +char CanFireActor::takearm(byte armtype) { + TArm &arm = ArmList[armtype]; + byte token = 0; + if (!GETFLAG(armflag,arm.flag)) { + SETFLAG(armflag,arm.flag); + token |= 2; + // anche se non vengono prese le munizioni + if (curarm arm.max_ammo) + Armbull[armtype-1] = arm.max_ammo; + if (/*Armbull[armtype-1]==ammo &&*/curarmmover->id]=object; + if ((object->oflags & OFL_ISACTOR) == OFL_ISACTOR) + actorslist.add(object->mover->id); + object->object_type=objtype; // !!! lo informo io... + objnum++; +} + +void ObjectsList::save(int handle) { + int objid=0, num=objnum; + while (num) { + if (objlist[objid] != NULL) { + objlist[objid]->save(handle); + num--; + } + objid++; + } + objid = OBJT_END; + CRC_write(handle,&objid,1); // !!! attenzione 1 - sizeof(objtype)==1 !!! +} + +void ObjectsList::put(Object *object) { + if (object == NULL) error("ObjectsList::put","no Object"); + if (objnum < MAXOBJECTS) { + int i = 0; + while (objlist[i] != NULL) i++; + objlist[i] = object; + object->setid(i); + object->place(); // !!! + objnum++; + } else delete object; // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + //error("ObjectList::put","too many Objects"); +} + +Object *ObjectsList::get(int objidx) { + if (objidx < MAXOBJECTS) + return objlist[objidx]; + return NULL; +} + +void ObjectsList::erase(int objidx) { + if (objidx < MAXOBJECTS) + if (objlist[objidx] != NULL) { + delete objlist[objidx]; + objlist[objidx] = NULL; + objnum--; + } +} + +void ObjectsList::eraseall() { + int objidx=0; + while (objnum) { + if (objlist[objidx] != NULL) { + delete objlist[objidx]; + objlist[objidx] = NULL; + objnum--; + } + objidx++; + } +} + +/* +void ObjectsList::reset() { + for (int i=0, j=0; jreset(); + j++; + } +} +*/ + +void ObjectsList::handle_event(TEvent &event) { + for (int i=0, j=0; jhandle_event(event); + j++; + } +} + +void ObjectsList::preloadall() { + int k; + for (int i=0, j=0; j0) k=obj.fignum; + else k=(obj.fignum>>1)+1; + for(;k--;) mm_recall(FigList[obj.figstart+k].memidx); + j++; + } +} + +ObjectsList::~ObjectsList() { + int i=0; + while (objnum) { + while (!objlist[i]) i++; + erase(i++); + } +} + +void ActorsList::add(int objidx) { + register int i; + if (actorsnum < MAXACTORS) { + i=0; + while ((ianimate(); +} + +void ActorsList::handle_event(TEvent &event) { + for (int i=0; ihandle_event(event); +} + +void ActorsList::reset() { + // Must be fast ! + for (register int i=0;ireset(); +} + +void DrawList::add(int objid, long objdist) { + int i; + if (drawnum < MAXDRAWING) { + i = drawnum++; + while (i && distlist[i-1]>objdist) i--; + if (drawnum-i > 1) { + fodmove(&drawlist[i+1],&drawlist[i],(drawnum-i-1)*sizeof(objid)); + fodmove(&distlist[i+1],&distlist[i],(drawnum-i-1)*sizeof(objdist)); + } + /* + while (i && distlist[i-1]>objdist) { + drawlist[i] = drawlist[i-1]; + distlist[i] = distlist[i-1]; + i--; + } + */ + drawlist[i] = objid; + distlist[i] = objdist; + } //else error("DrawList::add - too many Objects"); !!! +} + +int DrawList::get(fixed &objdist) { + if (drawnum) { + objdist = distlist[--drawnum]; + return drawlist[drawnum]; + } else return 0xffff; +} \ No newline at end of file diff --git a/KaosSrc/objects.hpp b/KaosSrc/objects.hpp new file mode 100644 index 0000000..55676e4 --- /dev/null +++ b/KaosSrc/objects.hpp @@ -0,0 +1,281 @@ +/************************************************************************ + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + ************************************************************************/ + +#ifndef __OBJECTS__ +#define __OBJECTS__ + +#define OFL_SEEN 0x01 +#define OFL_ONESEEN 0x02 +#define OFL_ISACTOR 0x04 +#define OFL_TAKEABLE 0x08 +#define OFL_REVERSE 0x10 +#define OFL_ISLIGHT 0x20 +#define OFL_HASLIGHT 0x40 + +#define MVT_0 0 // Single square placer +#define MVT_1 1 // Single square mover +#define MVT_2 2 // Double " " +//#define MVT_3 3 // Walls follower + +#define MAXARMS 6 +#define ARMCHGSPEED 36 +// Arm Flags +#define AFL_ASCIA 0x01 +#define AFL_PISTOLA 0x02 +#define AFL_FUCILE 0x04 +#define AFL_MITRA 0x08 +#define AFL_BAZOOKA 0x10 +#define AFL_BOMB 0x20 +//#define AFL_FIREBALL 0x40 // ??? + +// Arm recharge bullets values +#define ARM_ADDPISTOLA 20 +#define ARM_ADDFUCILE 4 +#define ARM_ADDMITRA 24 +#define ARM_ADDBAZOOKA 2 +#define ARM_ADDBOMB 1 + +typedef struct { + byte flag, power, chargetime; + int pre_ammo, max_ammo; + } TArm; +extern TArm ArmList[MAXARMS]; + +//class Object; + +class Mover +{ + protected: + friend Object; + byte mover_type; + void enqueue(int idx, int &undr); + void dequeue(int idx, int undr); + public: + int id; + int flags; + int index; + int under; + char shdim; + fixed x, y, z; + int angle; + Mover(fixed _x=0l, fixed _y=0l, fixed _z=0l, int _shdim=5, + word _flags=OMF_STANDARD) : + x(_x), y(_y), z(_z), id(0), shdim(_shdim), flags(_flags), + mover_type(MVT_0) {}; + Mover(int handle); + virtual void save(int handle); + void setid(int the_id) { + if (!id) id = the_id; + else error("Object::setid","multiple IDs"); + } + virtual char canmove(fixed nx, fixed ny); + virtual void place(); + virtual void remove(); + virtual int underq(int idx) {return under;}; + virtual void correctq(int idx, int undid); + virtual char move(int ang, int lshift); + virtual char fluidmove(int ang, fixed mult); +}; + +class Mover1 : public Mover +{ + public: + Mover1(fixed _x=0l, fixed _y=0l, fixed _z=0l, int _shdim=5, + word _flags=OMF_STANDARD) : + Mover(_x,_y,_z,_shdim,_flags) {mover_type=MVT_1;}; + Mover1(int handle):Mover(handle) {}; + virtual char move(int ang, int lshift); + virtual char fluidmove(int ang, fixed mult); +}; + +class Mover2 : public Mover1 // ... !!! +{ + protected: + int index1; + int under1; + public: + Mover2(fixed _x=0l, fixed _y=0l, fixed _z=0l, int _shdim=5, + word _flags=OMF_STANDARD) + :Mover1(_x,_y,_z,_shdim,_flags) {mover_type=MVT_2;}; + Mover2(int handle); + virtual void save(int handle); + virtual void place(); + virtual void remove(); + virtual int underq(int idx); + virtual void correctq(int idx, int undid); + //virtual char move(int lshift); + //virtual char fluidmove(fixed mult); +}; + +/* +class Mover3 : public Mover2 +{ + public: + Mover3(fixed _x=0l, fixed _y=0l, fixed _z=0l, int _shdim=5, + word _flags=OMF_STANDARD) + :Mover2(_x,_y,_z,_shdim,_flags) {mover_type=MVT_3;}; + virtual char canmove(fixed nx, fixed ny); +}; +*/ + +class Object +{ + char doblood(int angle); + protected: + byte object_type; + friend ObjectsList; // per setid + virtual void setid(int _id) {mover->setid(_id);}; + public: + Mover *mover; + char oflags, selflight; + int figstart; + char fignum; + Object(fixed px, fixed py, int startfig = 0, + char numfig = 1, byte movertype = MVT_0); + Object(int handle); // Load Constructor + virtual void save(int handle); + virtual ~Object(); + int getid() {return mover->id;}; + //void setshdim(char dim) {mover->shdim = dim;}; + void changefig(int startfig, char numfig); + virtual int getviewfig(int ang); // !!!! New Reverse Mode !!!! + virtual void place() {mover->place();}; + virtual void remove() {mover->remove();}; + virtual void handle_event(TEvent &event); + + char have_seen() {return (oflags & OFL_SEEN);}; + char had_seen() {return (oflags & OFL_ONESEEN);}; + void seen() {oflags |= OFL_SEEN | OFL_ONESEEN;}; + void reset() {oflags &= ~OFL_SEEN;}; + + byte get_type() {return object_type;}; +}; + +class Actor : public Object +{ + protected: + int animcount; + virtual void setid(int the_id); + virtual char makeActor(); + virtual char makeObject(); + char nearPlayer(fixed maxdist); + public: + int health; + Actor(fixed px, fixed py, int startfig = 0, char numfig = 1, + byte movertype = MVT_0) + :Object(px,py,startfig,numfig,movertype), + animcount(0), health(1) {object_type=OBJT_ACTOR;}; + Actor(int handle); // Constructor Load + virtual void save(int handle); + virtual ~Actor(); + virtual int getviewfig(int ang); + virtual void animate() {}; + virtual void draw(int vidx, int vidy, char &cd, char &fd); + virtual void virtualdraw(); + virtual void transf(int vidx, int vidy); + // virtual void handle_event(Event &event); +}; + +class LightActor : public Actor +{ + protected: + char lightrange; + void lights(); + void unlights(); + public: + fixed lightz; + char lightpow; + LightActor(fixed px, fixed py, int startfig = 0, char numfig = 1, + char lr = 0, char self = 0, byte movertype = MVT_0) : + Actor(px,py,startfig,numfig,movertype), + lightrange(lr) { + selflight=self; + object_type=OBJT_LIGHTACTOR; + lightz = 0; + lightpow = 0; + SETFLAG(oflags,OFL_HASLIGHT); + }; + LightActor(int handle); // Constructor Load + virtual void save(int handle); + ~LightActor(); + virtual void place(); + virtual void remove(); + virtual int getlightfig() { return -1; }; +}; + +class CanFireActor : public LightActor +{ + protected: + word armflag; + byte oldarm, curarm, armcharge, armchanging; + int Armbull[MAXARMS-1]; + virtual char setarm(byte armtype); + virtual char fire(int angle); + public: + CanFireActor(fixed px, fixed py, int startfig = 0, + char numfig = 1, byte movertype = MVT_0); + /* + :LightActor(px,py,startfig,numfig,0,0,movertype), + curarm(0), oldarm(0), armcharge(0), armchanging(0), armflag(0) + {object_type=OBJT_CANFIREACTOR;}; + */ + CanFireActor(int handle); // Constructor Load + virtual void save(int handle); + virtual void animate(); + virtual char takearm(byte armtype); + virtual char takeammo(byte armtype, int ammo); +}; + +class ObjectsList +{ + friend ActorsList; + Object *objlist[MAXOBJECTS]; + int objnum; + public: + ObjectsList(); + ~ObjectsList(); + void loadobj(Object *object, byte objtype); // !!! + void save(int handle); + void put(Object *object); + Object *get(int objidx); + void erase(int objidx); + void eraseall(); + void handle_event(TEvent &event); + void preloadall(); +}; + +class ActorsList +{ + int actorslist[MAXACTORS]; + int actorsnum; + public: + ActorsList() : actorsnum(0) {}; + void add(int objidx); + void erase(int objidx); + void eraseall(); + void animate(); + void handle_event(TEvent &event); + void reset(); +}; + +class DrawList +{ + int drawlist[MAXDRAWING]; + fixed distlist[MAXDRAWING]; + byte drawnum; + public: + DrawList() : drawnum(0) {}; + char not_empty() {return drawnum;}; + void flush() {drawnum=0;}; + void add(int objidx, fixed objdist); + int get(fixed &objdist); +}; + +extern ObjectsList objectslist; +extern ActorsList actorslist; + +#endif // __OBJECTS__ \ No newline at end of file diff --git a/KaosSrc/objects2.cpp b/KaosSrc/objects2.cpp new file mode 100644 index 0000000..f687253 --- /dev/null +++ b/KaosSrc/objects2.cpp @@ -0,0 +1,2484 @@ +/************************************************************************ + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + ************************************************************************/ + +// OBJECTS2 - (C)1997 NicoSoźt (Valentini Domenico) + +#include "std.hpp" +#include "fastmem.hpp" +#include "fixed.h" +#include "events.hpp" +#include "mm4.hpp" // per Kaos.hpp +#include "crcio.hpp" +#include "kaos.hpp" +#include "objects.hpp" +#include "objects2.hpp" +#include "3dengine.hpp" +#include "3dsound.hpp" +#include "doors.hpp" +#include "messages.hpp" +#include // per random()... + +//#include // sound() !!! + +// Ehi, un po' in ritardo. +char Object::doblood(int angle) { + int oppangle; + fixed x,y; + + if (!(figstart>=F_PLAYER && figstart<=F_MOUSE)) return 0; + oppangle = angleadd(angle,ANG180); + x = mover->x + fixmul(costab[oppangle],FIXONE<shdim); + y = mover->y + fixmul(sintab[oppangle],FIXONE<shdim); + delete mm_reserve(sizeof(FireBoom)); + objectslist.put(new FireBoom(x,y,mover->z,oppangle,BOOM_BLOOD)); + if (figstartz; + // !!!! vangle usato impropriamente (o Š angle ???) !!! + int id1 = fireray(x,y,angle,ANG0,dist,z,mover->id); + if (id1==-1 && dist<(128l<flags = OMF_VISIBLE; + } + animtrig=0; +} + +Ossa::Ossa(int handle) + :Actor(handle) { + animtrig=0; +} + +void Ossa::animate() { + if (--animtrig<=0) makeObject(); +} + +void Ossa::launch(int angle, int strong) { + if (!animtrig) { + animtrig = 2; + makeActor(); + delete mm_reserve(sizeof(FlOssa)); + if (!GETFLAG(gameflags,GFL_NORANDOM)) + angle = anglesub(angleadd(angle,ANG30>>1),random(ANG30)); + objectslist.put(new FlOssa(mover->x,mover->y,angle,strong)); + play3Dsound(mover->x,mover->y,SND_OSSA,SM_NORMVOL,SYSOWN,SFL_NORMAL); + } else animtrig++; +} + +void Ossa::handle_event(TEvent &event) { + if (event.what != EV_GOT) Object::handle_event(event); + switch (event.what) { + case EV_HIT: + case EV_GOT: + launch(event.data.msg.x,event.data.msg.y); + //if (random(5)==2) launch(event.data.msg.x,event.data.msg.y); + break; + } +} + +FlOssa::FlOssa(fixed px, fixed py, int angle, int _speed) + :Actor(px,py,F_TESCHIO+random(2),1,MVT_1) +{ + object_type=OBJT_FLOSSA; + if (_speed>24) speed=24; else speed=_speed; + mover->angle = angle; + mover->shdim = 3; + mover->flags = OMF_VISIBLE; + bang = 0; +} + +FlOssa::FlOssa(int handle) + :Actor(handle) { + CRC_read(handle,&speed,sizeof(speed)); + CRC_read(handle,&bang,sizeof(bang)); +} + +void FlOssa::save(int handle) { + Actor::save(handle); + CRC_write(handle,&speed,sizeof(speed)); + CRC_write(handle,&bang,sizeof(bang)); +} + +void FlOssa::animate() { + Mover &mv = *mover; + if (speed>0) { + remove(); + fixed nx = mv.x + (costab[mv.angle]*(speed>>1)), + ny = mv.y + (sintab[mv.angle]*(speed>>1)); + if (!mv.canmove(nx,mv.y)) { + if (mv.angle<=ANG180) mv.angle=ANG180-mv.angle; + else mv.angle=ANG180+ANG360-mv.angle; + } else mv.x = nx; + if (!mv.canmove(mv.x,ny)) { + if (mv.angle!=ANG0) mv.angle=ANG360-mv.angle; + } else mv.y = ny; + bang = angleadd(bang,(12-(speed>>1))<<5); + mv.z = LABS(fixmul(lshl16(speed),sintab[bang])); + /* + oldz = mv.z; + if ((mv.z = (6l<<16)+LABS(fixmul(lshl16(speed),sintab[bang])))>oldz) + play3Dsound(mover->x,mover->y,SND_TESCHIO,0,0,mover->id,SFL_AUTO); + */ + place(); + speed--; + } else + if ((--speed)<=-20) + if (!eventmanager.sendcom(EV_KILL,mv.id)) speed=-19; +} + +ObjMover::ObjMover(int _objlinkID, int _angle, int _speed) + :Actor(0,0,F_TESCHIO,1,MVT_0) // F_TESCHIO = no one fig +{ + Object *objlink; + + object_type=OBJT_OBJMOVER; + /* + if ((objlink = objectslist.get(objlinkID = _objlinkID)) == NULL) + error("ObjMover","no Object"); + */ + objlink = objectslist.get(objlinkID = _objlinkID); + if (_speed>24) speed=24; else speed=_speed; + mover->angle = _angle; + mover->x = objlink->mover->x; + mover->y = objlink->mover->y; + mover->z = objlink->mover->z; + mover->shdim = 3; + mover->flags = 0; // no visible, no hittable, nothing ! + bounceang = 0; +} + +ObjMover::ObjMover(int handle) + :Actor(handle) { + CRC_read(handle,&speed,sizeof(speed)); + CRC_read(handle,&bounceang,sizeof(bounceang)); + CRC_read(handle,&objlinkID,sizeof(objlinkID)); +} + +void ObjMover::save(int handle) { + Actor::save(handle); + CRC_write(handle,&speed,sizeof(speed)); + CRC_write(handle,&bounceang,sizeof(bounceang)); + CRC_write(handle,&objlinkID,sizeof(objlinkID)); +} + +void ObjMover::animate() { + Object *objlink = objectslist.get(objlinkID); + Mover &mv = *mover; + + if (objlink==NULL) { + eventmanager.sendcom(EV_KILL,mv.id); + return; + } + if (speed>0) { + remove(); + fixed nx = mv.x + (costab[mv.angle]*(speed>>1)), + ny = mv.y + (sintab[mv.angle]*(speed>>1)); + if (!mv.canmove(nx,mv.y)) { + if (mv.angle<=ANG180) mv.angle=ANG180-mv.angle; + else mv.angle=ANG180+ANG360-mv.angle; + } else mv.x = nx; + if (!mv.canmove(mv.x,ny)) { + if (mv.angle!=ANG0) mv.angle=ANG360-mv.angle; + } else mv.y = ny; + bounceang = angleadd(bounceang,(12-(speed>>1))<<4); + objlink->mover->z = mover->z+LABS(fixmul(lshl16(speed<<1),sintab[bounceang])); + objlink->remove(); + objlink->mover->x = mv.x; + objlink->mover->y = mv.y; + objlink->place(); + place(); + speed--; + } else { + objlink->mover->z = mv.z; + eventmanager.sendcom(EV_KILL,mv.id); + } +} + +void ObjMover::handle_event(TEvent &event) { + Object::handle_event(event); + switch (event.what) { + case EV_KILL: + if (event.source == objlinkID) { + eventmanager.sendcom(EV_KILL,mover->id); + objlinkID = -1; // morte forzata ! + } + } +} + +Bonus::Bonus(fixed px, fixed py) + :LightActor(px,py,F_BONUS,1,2,3,MVT_0) { + object_type=OBJT_BONUS; + mover->z = 24l<flags,OMF_UNWALKABLE|OMF_HITABLE); + SETFLAG(oflags,OFL_TAKEABLE); + animtrig = random(16); + animang = random(ANG360); + lightz = mover->z; +} + +Bonus::Bonus(int handle) + :LightActor(handle) { + animtrig = random(16); + animang = random(ANG360); +} + +void Bonus::animate() { + if (++animtrig >= 16) { + animtrig = 0; + if (++animcount > 1) animcount = 0; + } + animang = angleadd(animang,ANGLVL<<2); + lightz = mover->z = (24l<z = 40l<flags,OMF_UNWALKABLE|OMF_HITABLE); + SETFLAG(oflags,OFL_TAKEABLE); + animtrig = random(ANG360); + animang = random(ANG360); +} + +AntiKaos::AntiKaos(int handle) + :LightActor(handle) { + animtrig = random(ANG360 & 0x7ff8); + animang = random(ANG360 & 0x7ffc); +} + +void AntiKaos::animate() { + if (Kaos_count == -1) { + eventmanager.sendcom(EV_KILL,mover->id); + eventmanager.sendcom(EV_MESSAGE,MSG_KAOS); + delete mm_reserve(sizeof(FireBoom)); + objectslist.put(new FireBoom(mover->x,mover->y,mover->z, + mover->angle,BOOM_SMOG)); + play3Dsound(mover->x,mover->y,SND_MISSILE,SM_NORMVOL,SYSOWN,SFL_NORMAL); + } else { + mover->angle = animang = angleadd(animang,ANGLVL<<2); + lightz = mover->z = (40l<id); + break; + } +} + +Enemy::Enemy(fixed px, fixed py, byte type) + :Actor(px,py,F_SPIDER,-8,MVT_2) +{ + animtrig = 0; + walkspeed = 2; + speed = 0; + mover->shdim = 4; // ??? !!! serve ??? + animstate = 2; + hitangle=0; + switch (type) { + case F_BUB: + changefig(F_BUB,-8); + mover->z = 32l<<16; + health = 80; + walkspeed = 1; + break; + case F_FACE: + changefig(F_FACE,-8); + mover->z = 32l<<16; + health = 20; + mover->shdim = 4; + break; + } + posneg = 1; + firstfig = figstart; +} + +void Enemy::animate() { + if (viewstate) return; + switch (animstate) { + case 2: // Anim & Walk + if (++animtrig > 15) animtrig = 0; + animcount = animtrig >> 3; + case 0: // Walk + char dir = mover->angle/ANG45; //flags & 0x07, + if (!had_seen()) return; + remove(); + if (!random(50)) dir = (dir+random(3)-1) & 0x7; + if (have_seen() && random(100)==37) { + switch (figstart) { + case F_BUB: + play3Dsound(0l,0l,SND_BUB,SM_NORMVOL,mover->id,SFL_AUTO); + break; + } + } + if (random(17)==13) posneg = -posneg; + for (int i=0;i<8;i++) { + if (mover->move(mover->angle,walkspeed)) i=8; + else { + dir=(dir+8+posneg) & 0x07; + mover->angle = (int)dir*ANG45; + } + } + place(); + break; + case 1: // Back Walk or Die + if (health>0) { + if (speed) { + remove(); + mover->fluidmove(hitangle,lshl16(speed--)); + place(); + } else { + animtrig=0; + animstate=2; + animcount=0; + changefig(firstfig,-8); + } + } else { + if (speed) { + remove(); + mover->fluidmove(hitangle,lshl16(speed--)); + place(); + } + if (animtrig) { + mover->flags = OMF_VISIBLE; + if (!(--animtrig & 3)) animcount++; + } else if (!speed) { + selflight=0; + makeObject(); + ownerdead(mover->id); + } + } + break; + } +} + +void Enemy::handle_event(TEvent &event) { + int dead; + Object::handle_event(event); + if (health && (event.what == EV_HIT || + (event.what == EV_SCODE && event.source == SC_MNStrg))) { + if (event.what == EV_SCODE) { + health=0; speed=0; + dead=1; + } else { + if ((health-=event.data.msg.y) <=0) { + health=0; + eventmanager.senddirect(EV_ADDSTAT,mover->id,event.source, + STT_KILL,1); + dead=1; + } else dead=0; + switch (figstart) { + case F_BUB: + if ((speed+=event.data.msg.y>>1) > 12) speed = 12; + break; + case F_FACE: + if ((speed+=event.data.msg.y<<1) > 18) speed = 18; + break; + } + hitangle=event.data.msg.x; + } + switch (firstfig) { + case F_FACE: + changefig(firstfig+10+(dead<<1),2-dead); + animtrig=19-(dead<<2); + break; + case F_BUB: + changefig(firstfig+12+(dead<<1),2-dead); + animtrig=23-(dead<<2); + break; + } + animcount=0; + animstate=1; + } + // eventmanager.sendcom(EV_KILL,mover->id); +} + +Slimer::Slimer(fixed px, fixed py) + :Actor(px,py,F_SLIMER,-8,MVT_2) { + object_type=OBJT_SLIMER; + numenemies++; // !!! + animstate=2; + animtrig=0; + mover->z = 38l<shdim = 5; + scanangle = ANG0; + objlink = -1; + mysound = -1; + floatangle = ANG0; + cannoncharge = 0; + speed = 0; + posneg = 1; + sndcount = 0; + turning = 0; turnnum = 0; turnable=0; +} + +Slimer::Slimer(int handle) + :Actor(handle) { + numenemies++; // !!! + CRC_read(handle,&animstate,sizeof(animstate)); + CRC_read(handle,&animtrig,sizeof(animtrig)); + CRC_read(handle,&posneg,sizeof(posneg)); + CRC_read(handle,&objlink,sizeof(objlink)); + CRC_read(handle,&scanangle,sizeof(scanangle)); + CRC_read(handle,&cannoncharge,sizeof(cannoncharge)); + CRC_read(handle,&turning,sizeof(turning)); + CRC_read(handle,&turnnum,sizeof(turnnum)); + CRC_read(handle,&turnable,sizeof(turnable)); + CRC_read(handle,&speed,sizeof(speed)); + CRC_read(handle,&hitangle,sizeof(hitangle)); + sndcount=0; mysound=-1; floatangle=ANG0; +} + +void Slimer::save(int handle) { + Actor::save(handle); + CRC_write(handle,&animstate,sizeof(animstate)); + CRC_write(handle,&animtrig,sizeof(animtrig)); + CRC_write(handle,&posneg,sizeof(posneg)); + CRC_write(handle,&objlink,sizeof(objlink)); + CRC_write(handle,&scanangle,sizeof(scanangle)); + CRC_write(handle,&cannoncharge,sizeof(cannoncharge)); + CRC_write(handle,&turning,sizeof(turning)); + CRC_write(handle,&turnnum,sizeof(turnnum)); + CRC_write(handle,&turnable,sizeof(turnable)); + CRC_write(handle,&speed,sizeof(speed)); + CRC_write(handle,&hitangle,sizeof(hitangle)); +} + +void Slimer::animate() { + fixed cx, cy, dist, alt; + Object *object; + int i,j; + char oldseen; + + if (viewstate) return; + switch (animstate) { + case 0: // Walk & Scan + case 3: // Persecution + // Scanner + if (cannoncharge) cannoncharge--; + + cx=mover->x; cy=mover->y; + i = fireray(cx,cy,scanangle,0,dist,alt,mover->id); + oldseen = objseen; + objseen = 0; + if (i>=0) { + switch ((object = objectslist.get(i))->figstart) { + case F_SLIMER: + // Se non Š un vecchio nemico allora niente... + if (objlink!=i) { + scanangle = angleadd(scanangle,ANG30>>1); + break; + } + case F_SPIDER: + // Se prima avevo sott'occhio un Player allora niente... + if (objlink>=0 && animstate==3 && + objectslist.get(objlink)->get_type() == OBJT_PLAYER) { + scanangle = angleadd(scanangle,ANG30>>1); + break; + } + case F_PLAYER: // normale + case F_PLAYER+32: // colpito + objlink = i; + objseen = 1; + mover->angle = scanangle; + turnnum=0;turning=0; + if (dist >= 200l<>1); + } else + if (dist <= 80l<>1); + break; + default: scanangle = angleadd(scanangle,ANG30>>1); + } + } else scanangle = angleadd(scanangle,ANG30>>1); + + // Turner Reset + if (oldseen && !objseen) { + turnable=0; + turning=0; + turnnum=0; + posneg = !posneg; + //mover->angle = (mover->angle/(ANG45>>3))*(ANG45>>3); + } + + // Move + remove(); + if (objlink>=0) { + object = objectslist.get(objlink); + if (object!=NULL && ((Actor *)object)->health>0) { + if (objseen) { + // Se l'oggetto Š visibile, gli corro addosso... + for (i=3;i>=0;i--) + if ((j = mover->move(mover->angle,i))>0) break; + // ...e gli giro intorno + if (j<2) mover->move(anglesub(mover->angle,ANG60),1); + } else { + // Cammina un p• prima di poter girare di nuovo + if (turnable) { + //if (mover->move(mover->angle,1)) turnable--; + //else turnable=0; + mover->move(mover->angle,2); + turnable--; + + // Si avvicina al muro + if (turnnum && turnable<5) { + if (posneg) mover->move(anglesub(mover->angle,ANG60),1); + else mover->move(angleadd(mover->angle,ANG60),1); + } + + } else + if (turning) { // Cambia direzione + // Giro nella direzione posneg se turning>0 + // altrimenti faccio il contrario + if (turning<0 ^ posneg) + mover->angle = angleadd(mover->angle,ANG45>>3); + else + mover->angle = anglesub(mover->angle,ANG45>>3); + if (!(mover->angle % ANG90)) { + turning=0; + //if (turnnum) + turnable=8; + } + mover->fluidmove(mover->angle,FIXONE>>1); + } else + if (turnnum) { + turnnum--; turning--; + /* + if (posneg) i = (anglesub(mover->angle,ANG90)/ANG90)*ANG90; + else i = (angleadd(mover->angle,ANG90)/ANG90)*ANG90; + */ + if (posneg) i = anglesub(mover->angle,ANG90); + else i = angleadd(mover->angle,ANG90); + for (j=0; j<3; j++) { + if (mover->move(i,2)<2) { + if (posneg) i = angleadd(i,ANG90); + else i = anglesub(i,ANG90); + turnnum++; turning++; + } else break; + } + if (turnnum>=16) { + turnnum=0; + posneg=!posneg; + } + } else { + int dx = (lshr16(object->mover->x - mover->x)) >> 4, + dy = (lshr16(object->mover->y - mover->y)) >> 4, + dir; + + if (animstate==0 && ABS(dx)+ABS(dy)>32) objlink=-1; + if (dx>1) { + if (dy>0) dir=1; else + if (dy<0) dir=7; else + dir=0; + } else + if (dx<1) { + if (dy>0) dir=3; else + if (dy<0) dir=5; else + dir=4; + } else { + if (dy>0) dir=2; else + if (dy<0) dir=6; else + dir=-1; + } + if (dir>=0) { + mover->angle = dir*ANG45; + if (!mover->move(mover->angle,2)) { + turnnum++; + turning++; + } + } else objlink=-1; + } + } + } else objlink = -1; + } else { + //if (random(20)==13) + // if (posneg) mover->angle = anglesub(mover->angle,ANG45>>4); + // else mover->angle = angleadd(mover->angle,ANG45>>4); + animstate=0; + if (!mover->move(mover->angle,1)) { + if (posneg) mover->angle = anglesub(mover->angle,ANG45>>3); + else mover->angle = angleadd(mover->angle,ANG45>>3); + //mover->angle = (mover->angle/ANG45)*ANG45; + //for (i=0;i<8;i++) { + // if (mover->move(1)) break; + // mover->angle = angleadd(mover->angle,ANG45); + //} + } + } + place(); + // Animate + if (++animtrig > 31) animtrig = 0; + animcount = animtrig >> 4; + // Fly & talk + if (!sndcount) { + if (mysound<0) { + if (objlink>=0) { // && nearPlayer(192l<id,SFL_AUTO); + sndcount = 108; + } + } else + if (have_seen() || nearPlayer(140l<id,SFL_AUTO); + sndcount = 90; + reset(); + } + } + } else sndcount--; + floatangle = angleadd(floatangle,ANGLVL<<3); + mover->z = (38l<fluidmove(hitangle,lshl16(speed--)); + place(); + } else { + if (health) { + animtrig=0; + animstate=3; // Persecution !!! + animcount=0; + changefig(F_SLIMER,-8); + } else + if (!animtrig) { + selflight=0; + makeObject(); + eventmanager.sendcom(EV_DEAD,mover->id); + //ownerdead(mover->id); // !!! usare mysound ??? + } + } + if (!health && animtrig) { + if (GETFLAG(mover->flags,OMF_UNWALKABLE)) { + mover->z = 38l<flags = OMF_VISIBLE; + place(); + SETFLAG(oflags,OFL_TAKEABLE); + } + if (!(--animtrig & 3)) animcount++; + if (animtrig==4) + play3Dsound(mover->x,mover->y,SND_SLIMDOWN,SM_NORMVOL, + SYSOWN,SFL_NORMAL); + } + break; + case 4: // Fire + case 7: + switch (animtrig++) { + case 0: break; + case 6: + changefig(F_SLIMER+14,2); + animcount=0; + break; + case 12: + // re-scan + cx=mover->x; cy=mover->y; + fireray(cx,cy,scanangle,0,dist,alt,mover->id); + + delete mm_reserve(sizeof(Fireball)); + object = new Fireball(mover->x,mover->y,scanangle,F_SLIMFIRE, + mover->z,alt,dist,mover->id); + mysound = play3Dsound(mover->x,mover->y,SND_MISSILE,SM_NORMVOL, + mover->id,SFL_NORMAL); + objectslist.put(object); + //scanangle = anglesub(scanangle,ANG30>>1); + cannoncharge = 48; + break; + case 18: + changefig(F_SLIMER,-8); + animcount=0; + animtrig=0; + animstate-=4; + break; + } + break; + case 5: // Attack + case 8: + remove();mover->move(mover->angle,0);place(); + switch (animtrig++) { + case 0: break; + case 6: + changefig(F_SLIMER+10,2); + animcount=0; + break; + case 12: + animcount=1; + mysound=play3Dsound(mover->x,mover->y,SND_SLIMATT,SM_NORMVOL, + mover->id,SFL_NORMAL); + break; + case 16: + // re-scan + cx=mover->x; cy=mover->y; + i = fireray(cx,cy,scanangle,0,dist,alt,mover->id); + if (i>=0 && dist<80l<id,i,mover->angle,6); + //scanangle = anglesub(scanangle,ANG30>>1); + break; + case 20: changefig(F_SLIMER,-8); break; + case 21: animstate-=5; animtrig=0; break; + } + break; + case 2: + if (had_seen()) { + animstate=0; + reset(); // !!!! + } + break; + } + +} + +void Slimer::handle_event(TEvent &event) { + int dead; + Object::handle_event(event); + if (!health) return; + if ((event.what == EV_HIT || event.what == EV_POISON || + (event.what == EV_SCODE && event.source == SC_MNStrg))) { + if (event.what == EV_SCODE) { + health=0; speed=0; + dead=1; + } else { + if (event.source != mover->id) objlink = event.source; + // Come fa a colpirsi da solo ? + // Con i barili o con un muro di fronte ! + if ((health-=event.data.msg.y) <=0) { + health=0; + eventmanager.senddirect(EV_ADDSTAT,mover->id,event.source, + STT_KILL,1); + play3Dsound(mover->x,mover->y,SND_SLIMDEAD,SM_NORMVOL, + SYSOWN,SFL_NORMAL); + dead=1; + } else { + mysound=play3Dsound(0l,0l,SND_SLIMHIT,SM_NORMVOL, + mover->id,SFL_AUTO); + dead=0; + } + if ((speed += event.data.msg.y<<1) > 18) speed = 18; + hitangle=event.data.msg.x; + } + changefig(F_SLIMER+14+(dead<<1),2-dead); + animtrig=23-(dead<<2); + animcount=0; + animstate=1; + } else + if (mysound>=0 && event.what == EV_ENDSOUND && event.source==mysound) + mysound=-1; +} + +Spider::Spider(fixed px, fixed py) + :Actor(px,py,F_SPIDER,-8,MVT_2) { + object_type=OBJT_SPIDER; + numenemies++; // !!! + animstate=2; + animtrig=0; + mover->z = 22l<shdim=5; // !!!!! + health = 10; + speed = 0; + hitangle=0; + scanangle = ANG0; + objlink = -1; + mysound=-1; + cannoncharge=0; +} + +Spider::Spider(int handle) + :Actor(handle) { + numenemies++; // !!! + CRC_read(handle,&animstate,sizeof(animstate)); + CRC_read(handle,&animtrig,sizeof(animtrig)); + CRC_read(handle,&objlink,sizeof(objlink)); + CRC_read(handle,&scanangle,sizeof(scanangle)); + CRC_read(handle,&speed,sizeof(speed)); + CRC_read(handle,&hitangle,sizeof(hitangle)); + CRC_read(handle,&cannoncharge,sizeof(cannoncharge)); + mysound=-1; +} + +void Spider::save(int handle) { + Actor::save(handle); + CRC_write(handle,&animstate,sizeof(animstate)); + CRC_write(handle,&animtrig,sizeof(animtrig)); + CRC_write(handle,&objlink,sizeof(objlink)); + CRC_write(handle,&scanangle,sizeof(scanangle)); + CRC_write(handle,&speed,sizeof(speed)); + CRC_write(handle,&hitangle,sizeof(hitangle)); + CRC_write(handle,&cannoncharge,sizeof(cannoncharge)); +} + +void Spider::animate() { + fixed cx, cy, dist, alt; + Object *object; + int i; + if (viewstate) return; + switch (animstate) { + case 3: // Run out + case 0: // Walk & Scan + // Scanning + if (cannoncharge) cannoncharge--; + if (animtrig & 1) { + /* + if (ABS(scanangle-mover->angle)>ANG90) + scanangle = anglesub(mover->angle,ANG90); + */ + scanangle = angleadd(scanangle,ANG45>>1); + cx=mover->x; cy=mover->y; + i = fireray(cx,cy,scanangle,0,dist,alt,mover->id); + if (i>=0) + switch ((object = objectslist.get(i))->figstart) { + case F_SLIMER: + if (ABS(object->mover->angle-angleadd(scanangle,ANG180))<=ANG45) { + if (GETFLAG(gameflags,GFL_NORANDOM) || random(2)) + mover->angle = angleadd(scanangle,ANG90); + else + mover->angle = anglesub(scanangle,ANG90); + animstate = 3; + objlink = i; + } + break; + case F_PLAYER: + case F_PLAYER+32: + animstate=0; + objlink = i; + mover->angle = scanangle; + if (dist >= 148l<>1); + } else + if (dist <= 96l<>1); + break; + } + } + remove(); + if (objlink>=0) { + object = objectslist.get(objlink); + if (object != NULL || ((Actor *)object)->health<=0) { + if (mover->move(mover->angle,3)<2) { + //if (animstate==0) { + int dx = (lshr16(object->mover->x - mover->x)) >> 5, + dy = (lshr16(object->mover->y - mover->y)) >> 5; + if (ABS(dx)+ABS(dy)>6) objlink=-1; + //} else objlink=-1; + } + } else objlink = -1; + } else { + if (!GETFLAG(gameflags,GFL_NORANDOM)) { + if (random(20)==13) + if (random(2)) mover->angle = angleadd(mover->angle,ANG45); + else mover->angle = anglesub(mover->angle,ANG45); + } + if (mover->move(mover->angle,3)<2) + for (i=0;i<8;i++) { + if (mover->move(mover->angle,3)) break; + mover->angle = angleadd(mover->angle,ANG45); + } + } + place(); + // Animate + if (++animtrig >= 8) animtrig = 0; + animcount = animtrig >> 2; + // Sound + if (/*!animstate &&*/ mysound<0 && nearPlayer(160l<id,SFL_AUTO); + break; + case 1: + if (speed) { + remove(); + mover->fluidmove(hitangle,lshl16(speed--)); + place(); + } else { + if (health) { + animtrig=0; + animstate=0; + animcount=0; + changefig(F_SPIDER,-8); + } else if (!animtrig) { + selflight=0; + makeObject(); + eventmanager.sendcom(EV_DEAD,mover->id); + // ownerdead(mover->id); // ??? !!!! + } + } + if (!health && animtrig) { + if (GETFLAG(mover->flags,OMF_UNWALKABLE)) { + remove(); + mover->flags = OMF_VISIBLE; + place(); + SETFLAG(oflags,OFL_TAKEABLE); + } + if (!(--animtrig & 3)) animcount++; + if (animtrig==4) + play3Dsound(mover->x,mover->y,SND_SPIDDOWN,SM_NORMVOL, + SYSOWN,SFL_NORMAL); + } + break; + case 4: // Dispel Venom + switch (animtrig++) { + case 0: break; + case 6: + changefig(F_SPIDER+10,2); + animcount=0; + break; + case 12: + // re-scan + cx=mover->x; cy=mover->y; + fireray(cx,cy,scanangle,0,dist,alt,mover->id); + + delete mm_reserve(sizeof(Fireball)); + object = new Fireball(mover->x,mover->y,scanangle,/*0,*/F_SPIDFIRE, + mover->z,alt,dist,mover->id); + play3Dsound(mover->x,mover->y,SND_MISSILE,SM_NORMVOL, + mover->id,SFL_NORMAL); + objectslist.put(object); + scanangle = anglesub(scanangle,ANG45>>1); + cannoncharge = 40; + break; + case 16: changefig(F_SPIDER,-8); + animcount=0; break; + case 20: animtrig=0; animstate=0; break; + } + break; + case 5: // Attack + remove();mover->move(mover->angle,0);place(); + switch (animtrig++) { + case 0: break; + case 6: + changefig(F_SPIDER+12,2); + animcount=0; + play3Dsound(mover->x,mover->y,SND_SPIDATT,SM_NORMVOL, + mover->id,SFL_NORMAL); + break; + case 12: + // re-scan + cx=mover->x; cy=mover->y; + i = fireray(cx,cy,scanangle,0,dist,alt,mover->id); + scanangle = anglesub(scanangle,ANG45>>1); + if (i>=0) + eventmanager.senddirect(EV_HIT,mover->id,i,scanangle,4); + break; + case 18: changefig(F_SPIDER,-8); + animcount=0; break; + case 20: animtrig=0; animstate=0; break; + } + break; + case 2: + if (had_seen()) { + animstate=0; + reset(); // !!!! + } + break; + } +} + +void Spider::handle_event(TEvent &event) { + int dead; + Object::handle_event(event); + if (!health) return; + if ((event.what == EV_HIT || + (event.what == EV_SCODE && event.source == SC_MNStrg))) { + if (event.what == EV_SCODE) { + health=0; speed=0; + dead=1; + } else { + if (event.source != mover->id) { + animstate = 3; + objlink = event.source; + mover->angle = angleadd(event.data.msg.x,ANG90); + } + if ((health-=event.data.msg.y) <=0) { + health=0; + eventmanager.senddirect(EV_ADDSTAT,mover->id,event.source, + STT_KILL,1); + play3Dsound(mover->x,mover->y,SND_SPIDDEAD,SM_NORMVOL, + SYSOWN,SFL_NORMAL); + dead=1; + } else { + mysound = play3Dsound(0l,0l,SND_SPIDHIT,SM_NORMVOL, + mover->id,SFL_AUTO); + dead=0; + } + if ((speed += event.data.msg.y*3>>1) > 16) speed = 16; + hitangle=event.data.msg.x; + } + + changefig(F_SPIDER+12+(dead<<1),2-dead); + animtrig=19-(dead<<2); + animcount=0; + animstate=1; + } else + if (event.source==mysound && event.what == EV_ENDSOUND && mysound>=0) + mysound=-1; +} + +Soldier::Soldier(fixed px, fixed py) + :Actor(px,py,F_SOLDIER,8,MVT_2) { + object_type=OBJT_SOLDIER; + numenemies++; // !!! + animstate=2; + animtrig=0; + mover->z = 40l<<16; + mover->shdim = 4; + health = 100; + speed = 0; + hitangle=0; + + scanangle=ANG0; + zigzagang=ANG0; + recover=0; + objseen=0; + objlink=-1; + + turncount=0; + havetoturn=0; +} + +Soldier::Soldier(int handle) + :Actor(handle) { + numenemies++; // !!! + CRC_read(handle,&animstate,sizeof(animstate)); + CRC_read(handle,&animtrig,sizeof(animtrig)); + CRC_read(handle,&objlink,sizeof(objlink)); + CRC_read(handle,&scanangle,sizeof(scanangle)); + CRC_read(handle,&zigzagang,sizeof(zigzagang)); + CRC_read(handle,&recover,sizeof(recover)); + CRC_read(handle,&speed,sizeof(speed)); + CRC_read(handle,&hitangle,sizeof(hitangle)); + CRC_read(handle,&turncount,sizeof(turncount)); + CRC_read(handle,&havetoturn,sizeof(havetoturn)); + CRC_read(handle,&oldobjx,sizeof(oldobjx)); + CRC_read(handle,&oldobjy,sizeof(oldobjy)); +} + +void Soldier::save(int handle) { + Actor::save(handle); + CRC_write(handle,&animstate,sizeof(animstate)); + CRC_write(handle,&animtrig,sizeof(animtrig)); + CRC_write(handle,&objlink,sizeof(objlink)); + CRC_write(handle,&scanangle,sizeof(scanangle)); + CRC_write(handle,&zigzagang,sizeof(zigzagang)); + CRC_write(handle,&recover,sizeof(recover)); + CRC_write(handle,&speed,sizeof(speed)); + CRC_write(handle,&hitangle,sizeof(hitangle)); + CRC_write(handle,&turncount,sizeof(turncount)); + CRC_write(handle,&havetoturn,sizeof(havetoturn)); + CRC_write(handle,&oldobjx,sizeof(oldobjx)); + CRC_write(handle,&oldobjy,sizeof(oldobjy)); +} + +void Soldier::animate() { + fixed cx,cy,dist,alt; + int i,app; + Object *object; + + if (viewstate) return; + if (health<100 && ++recover>=18) { health++; recover=0; } + switch (animstate) { + case 0: + case 3: // fuga dal missile + //case 5: // fuga ricostituente ELIMINATO + + // Gestione animazione e suono del passo + if (++animtrig > 63) animtrig = 0; + if (!(animtrig & 0x000f)) { + switch(animtrig>>4) { + case 0: animcount=1; break; + case 1: + case 3: animcount=0; + if (nearPlayer(384l<x,mover->y,SND_PASSO2,SM_NORMVOL,mover->id,SFL_NORMAL); + break; + case 2: animcount=2; break; + } + } + + // Scanner (solo se non sta fuggendo dal missile) + if (animstate != 3) { + scanangle = angleadd(scanangle,ANG45>>1); + cx = mover->x; cy = mover->y; + i = fireray(cx,cy,scanangle,0,dist,alt,mover->id); + objseen = 0; // Nessun oggetto selezionato + if (i>=0) { // Visto un oggetto + object = objectslist.get(i); + if (i == objlink || + (object->figstart >= F_PLAYER && + object->figstart <= F_PLAYER+32)) { + // Se Š una vecchia conoscenza o un Player vivo + objlink = i; // Nuova conoscenza + oldobjx = object->mover->x; + oldobjy = object->mover->y; + objseen = 1; + mover->angle = scanangle; // Si dirige verso il nemico + if (dist<70l<>1); + } + } + } + } + + // Movimento + remove(); + if (animstate == 3) { // Fuggire via + if (mover->move(mover->angle,2)<2) { // ostacolo + animstate=0; // smetti di fuggire + turncount=0; + havetoturn=0; + } + } else { + if (objlink>=0) { // c'era qualcuno che mi stava antipatico... + object = objectslist.get(objlink); + if (object != NULL && ((Actor *)object)->health>0) { + // Il tizio Š ancora vivo + if (!objseen) { // non lo vede + // Inseguimento guidato (circolare) + if (turncount) { + if (turncount>0) { + mover->angle = anglesub(mover->angle,ANG45>>3); + if (!(--turncount)) havetoturn--; + } else + if (turncount<0) { + mover->angle = angleadd(mover->angle,ANG45>>3); + if (!(++turncount)) havetoturn++; + } + //mover->move(mover->angle,0); + } else + if (havetoturn) { + if (mover->move(app = anglesub(mover->angle,ANG45),2)>1) { + turncount = 8; + } else { + int j; + j = xytoidx(mover->x+(costab[app]<<6), + mover->y+(sintab[app]<<6)); + if ((Map[j].type==MTP_DOOR1 || Map[j].type==MTP_DOOR2) && + (app = doormanager.doorpos(Map[j].data))<64) { + eventmanager.sendshort(EV_ACTIVATE,mover->id,0,j,0); + mover->move(mover->angle,0); + } else { + //mover->angle = angleadd(mover->angle,ANG45); + if (mover->move(mover->angle,2)<2) { + j = xytoidx(mover->x+(costab[mover->angle]<<6), + mover->y+(sintab[mover->angle]<<6)); + if (Map[j].type==MTP_DOOR1 || Map[j].type==MTP_DOOR2) { + if (!(app = doormanager.doorpos(Map[j].data))) + eventmanager.sendshort(EV_ACTIVATE,mover->id,0,j,0); + else + if (app == 64) turncount = -8; + } else + turncount = -8; + } + } + } + } else { + int dx = (lshr16(oldobjx - mover->x)) >> 4, + dy = (lshr16(oldobjy - mover->y)) >> 4, + dir; + + if (dx>0) { + if (dy>0) dir=1; else + if (dy<0) dir=7; else + dir=0; + } else + if (dx<0) { + if (dy>0) dir=3; else + if (dy<0) dir=5; else + dir=4; + } else { + if (dy>0) dir=2; else + if (dy<0) dir=6; else + dir=-1; // niente... aspetto un indizio + } + if (dir>=0) + mover->angle = dir*ANG45; + if (!mover->move(mover->angle,2)) { + int j = xytoidx(mover->x+(costab[mover->angle]<<6), + mover->y+(sintab[mover->angle]<<6)); + if (Map[j].type==MTP_DOOR1 || Map[j].type==MTP_DOOR2) + eventmanager.sendshort(EV_ACTIVATE,mover->id,0,j,0); + else + turncount = -16; + } + } + } else { + turncount=0; + havetoturn=0; + // Guida a zig-zag + zigzagang=angleadd(zigzagang,ANGLVL<<3); + i = mover->angle; + if ((mover->angle = i+(int)fixmul(ANG45,sintab[zigzagang]))>=ANG360) + mover->angle-=ANG360; else + if (mover->angleangle+=ANG360; + if (!mover->move(mover->angle,3)) { + int j = xytoidx(mover->x+(costab[mover->angle]<<6), + mover->y+(sintab[mover->angle]<<6)); + if (Map[j].type==MTP_DOOR1 || Map[j].type==MTP_DOOR2) + eventmanager.sendshort(EV_ACTIVATE,mover->id,0,j,0); + } + mover->angle = i; + } + } else { + //mover->angle = angleadd(mover->angle,ANG180); + objlink=-1; + turncount=0; + havetoturn=0; + } + } else { + if (!mover->move(mover->angle,1)) { + mover->angle = (mover->angle/ANG45)*ANG45; + mover->angle = angleadd(mover->angle,ANG45); + } + } + } + place(); + break; + case 1: // Colpito + recover=0; + if (speed) { + remove(); + mover->fluidmove(hitangle,lshl16(speed--)); + if (speed) speed--; + place(); + } else { + if (health) { + animtrig=0; + animstate=0; + animcount=0; + turncount=0; + havetoturn=0; + changefig(F_SOLDIER,8); + } else if (!animtrig) { + selflight=0; + makeObject(); + eventmanager.sendcom(EV_DEAD,mover->id); + //ownerdead(mover->id); + } + } + if (!health && animtrig) { + if (GETFLAG(mover->flags,OMF_UNWALKABLE)) { + remove(); + mover->flags = OMF_VISIBLE; + place(); + SETFLAG(oflags,OFL_TAKEABLE); + } + if (!(--animtrig % 6)) animcount++; + if (animtrig==6) + play3Dsound(mover->x,mover->y,SND_SOLDDOWN,SM_NORMVOL, + SYSOWN,SFL_NORMAL); + } + break; + case 4: // Attack + if (animtrig & 1) {remove(); mover->move(mover->angle,0); place();} + switch (animtrig++) { + case 0: animcount=0; break; + case 3: + changefig(F_SOLDIER+24,2); + //animcount=0; + play3Dsound(mover->x,mover->y,SND_SOLDATT,SM_NORMVOL, + mover->id,SFL_NORMAL); + break; + case 8: animcount++; break; + case 9: + // re-scan + cx=mover->x; cy=mover->y; + i = fireray(cx,cy,scanangle,0,dist,alt,mover->id); + if (i>=0 && dist<80l<id,i,scanangle,12); + break; + case 14: + changefig(F_SOLDIER,8); + animcount=0; break; + case 16: + animtrig=0; + animstate=0; + turncount=0; + havetoturn=0; + break; + } + break; + case 2: + if (had_seen()) { + animstate=0; + turncount=0; + havetoturn=0; + reset(); // !!!! + } + break; + } +} + + +void Soldier::handle_event(TEvent &event) { + int dead; + Object::handle_event(event); + if (!health) return; + if (event.what == EV_ALERT) { + animstate=3; // Let's run out ! + if (anglesub(angleadd(mover->angle,ANG180),event.data.msg.x) <= ANG180) + mover->angle = anglesub(event.data.msg.x,ANG90); + else + mover->angle = angleadd(event.data.msg.x,ANG90); + } else + if ((event.what == EV_HIT || + (event.what == EV_SCODE && event.source == SC_MNStrg))) { + if (event.what == EV_SCODE) { + health=0; speed=0; + dead=1; + } else { + if ((health-=event.data.msg.y) <=0) { + health=0; + eventmanager.senddirect(EV_ADDSTAT,mover->id,event.source, + STT_KILL,1); + play3Dsound(mover->x,mover->y,SND_SOLDDEAD,SM_NORMVOL, + SYSOWN,SFL_NORMAL); + dead=1; + } else { + play3Dsound(0l,0l,SND_SOLDHIT,SM_NORMVOL, + mover->id,SFL_AUTO); + dead=0; + } + if ((speed+=event.data.msg.y*3>>1) > 16) speed = 16; + scanangle = angleadd(hitangle=event.data.msg.x,ANG180); + objlink = event.source; + } + changefig(F_SOLDIER+28+(dead<<1),2-dead); + //animtrig=19-(dead<<2); + animtrig=29-(dead*6); + animcount=0; + animstate=1; + } else + if (event.what==EV_PLNOISE && event.source==objlink) { + //if (fixdist(event.data.pos.x-mover->x,event.data.pos.y-mover->y)<(640l<z = 4l<<16; + mover->shdim = 3; + CLRFLAG(mover->flags,OMF_UNWALKABLE); +} + +Mouse::Mouse(int handle) + :Actor(handle) { + CRC_read(handle,&animstate,sizeof(animstate)); + CRC_read(handle,&animtrig,sizeof(animtrig)); +} + +void Mouse::save(int handle) { + Actor::save(handle); + CRC_write(handle,&animstate,sizeof(animstate)); + CRC_write(handle,&animtrig,sizeof(animtrig)); +} + +void Mouse::animate() { + if (viewstate) return; + switch (animstate) { + case 1: // dead + if (++animtrig>=20) { + remove(); + mover->flags = OMF_VISIBLE; + place(); + makeObject(); + eventmanager.sendcom(EV_DEAD,mover->id); + //ownerdead(mover->id); + break; + } + animcount=animtrig>>2; + case 0: // forward + case 3: // backward + remove(); + if (mover->move(mover->angle,2) != 2) { + if (!GETFLAG(gameflags,GFL_NORANDOM)) { // !!! + if (animstate!=1 && random(10)==5) + if (animstate) animstate=0; else animstate=3; + } + if (animstate) mover->angle = anglesub(mover->angle,ANG45); + else mover->angle = angleadd(mover->angle,ANG45); + } + place(); + if (have_seen() && random(50)==37) { + play3Dsound(0l,0l,SND_TOPO,SM_NORMVOL,mover->id,SFL_AUTO); + reset(); // !!!! + } + break; + case 2: + if (had_seen()) { + animstate=0; + reset(); // !!!! + } + break; + } +} + +void Mouse::handle_event(TEvent &event) { + /* + if (event.what == EV_GOT) { + health=0; + animtrig=17; + animstate=1; + changefig(F_MOUSE+8,1); + } else + */ + if (!health) return; + Object::handle_event(event); + if (event.what == EV_HIT || + (event.what == EV_SCODE && event.source == SC_MNStrg)) { + if (event.what == EV_SCODE || (health-=event.data.msg.y) <= 0) { + health=0; + animtrig=0; + animstate=1; + changefig(F_MOUSE+5,1); + /* + if (event.what != EV_SCODE) + eventmanager.senddirect(EV_ADDSTAT,mover->id,event.source, + STT_KILL,1,0); + */ + } + } +} + +FireBoom::FireBoom(fixed px, fixed py, fixed h, int angle, byte boomtype) + :LightActor(px,py,F_FIREBOOM,1,0,10,MVT_0) { + object_type=OBJT_FIREBOOM; + lightz = mover->z = h; + animtrig = 0; //animcount=0; + mover->flags = OMF_VISIBLE; + switch (type = boomtype) { // ! + + case BOOM_ASCIA: animcount++; + case BOOM_PALLOT: mover->shdim=2; break; + case BOOM_SPIDER: animcount+=3; selflight=2; + case BOOM_SLIMER: lightrange-=3; animcount+=6; + //case BOOM_3: animcount++; + case BOOM_MISSIL: + mover->shdim=4; + changefig(F_BOOM,1); + lightrange+=3; + break; + case BOOM_BLOOD: + decay = 0l; + /* + if (norandom) { + decayspd = FIXONE<<2; + animtrig = 0; + } else { + */ + decayspd = (16384l * (random(8)+1)) >> 3; // !!! + animtrig=random(4); + //} + mover->shdim=3; + animcount=0; + selflight=0; + changefig(F_BLOOD,1); + break; + case BOOM_SMOG: + changefig(F_SMOG,1); + //SETFLAG(oflags,OFL_ISLIGHT); + selflight=0; + //lightpow=0; + lightrange=0; + break; + default: type = BOOM_PALLOT; + } + mover->x -= costab[angle]<<(mover->shdim-1); + mover->y -= sintab[angle]<<(mover->shdim-1); + if (type != BOOM_MISSIL) CLRFLAG(oflags,OFL_HASLIGHT); +} + +FireBoom::FireBoom(int handle) + :LightActor(handle) { + CRC_read(handle,&animtrig,sizeof(animtrig)); + CRC_read(handle,&type,sizeof(type)); +} + +void FireBoom::save(int handle) { + LightActor::save(handle); + CRC_write(handle,&animtrig,sizeof(animtrig)); + CRC_write(handle,&type,sizeof(type)); +} + +void FireBoom::animate() { +const byte light[6] = {2,4,5,3,2,1}; + switch(type) { + case BOOM_PALLOT: + mover->z+=FIXONE>>1; + break; + case BOOM_BLOOD: + if ((mover->z-=decay)z=FIXONE; + decay += decayspd; + break; + case BOOM_SMOG: + mover->z+=FIXONE>>1; + //lightpow = 6-ABS((animcount*4+animtrig)-6); + break; + } + if (++animtrig >= 4) { + animtrig = 0; + animcount++; + switch (type) { + case BOOM_PALLOT: + if (animcount==2 && mover->under<0 /*&& mover->z==32l<x,mover->y,SND_PROIETTILE,SM_NORMVOL, + SYSOWN,SFL_NORMAL & ~SFL_AUTOSTOP); + case BOOM_ASCIA: + if (animcount<=3) return; + animcount=3; + break; + case BOOM_MISSIL: + //case BOOM_3: + // animtrig++; + if (animcount<=4) { + remove(); + lightrange = light[animcount]; + place(); + return; + } + animcount=4; + break; + case BOOM_BLOOD: + if (animcount<=4) return; + animcount=4; + eventmanager.sendshort(EV_CHGTEXTURE,2,0,mover->index,0); + break; + case BOOM_SMOG: + if (animcount<=2) return; + animcount=2; + break; + /* + case BOOM_4: + // animtrig++; + if (animcount==1) animcount++; else + if (animcount==3) animcount+=2; else + if (animcount==6) {animcount=5;break;} + remove(); + lightrange = light[animcount]; + place(); + return; + */ + case BOOM_SLIMER: + // animtrig++; + if (animcount<=8) return; + animcount=8; + break; + case BOOM_SPIDER: + // animtrig++; + if (animcount<=11) return; + animcount=11; + break; + } + if (!eventmanager.sendcom(EV_KILL,mover->id)) { + animtrig=4; + animcount--; + } + } +} + +int FireBoom::getlightfig() { + //if (type == BOOM_MISSILE) + return F_SPIKELIGHT; + //return -1; +} + +Fireball::Fireball(fixed px, fixed py, int fireangle, /*int _vangle,*/ int type, + fixed h1, fixed h2, fixed dist, int _ownerid) + :LightActor(px,py,F_MISSILE,-8,3,5,MVT_1) // !!! + +{ + object_type=OBJT_FIREBALL; + mover->angle = fireangle; + mover->shdim = 3; + animtrig=0; + /*vangle = _vangle;*/ + switch (type) { + case F_MISSILE: + shspeed = 4; + //animtrig = 2; + CLRFLAG(oflags,OFL_HASLIGHT); + break; + case F_SLIMFIRE: + changefig(F_SLIMFIRE,1); + shspeed = 3; + break; + case F_SPIDFIRE: + changefig(F_SPIDFIRE,1); + shspeed = 3; + CLRFLAG(oflags,OFL_HASLIGHT); + break; + } + if (dist>>=16+shspeed) deh = fixdiv(h2-h1,dist); + else deh = 0l; + lightz = mover->z = h1; + ownerid = _ownerid; + sendsound=1; + boomcount=1365; // CioŠ un bel p• +} + +Fireball::Fireball(int handle) + :LightActor(handle) { + CRC_read(handle,&ownerid,sizeof(ownerid)); + CRC_read(handle,&deh,sizeof(deh)); + CRC_read(handle,&boomcount,sizeof(boomcount)); + CRC_read(handle,&shspeed,sizeof(shspeed)); // !!! ...vabbŠ va + sendsound=1; +} + +void Fireball::save(int handle) { + LightActor::save(handle); + CRC_write(handle,&ownerid,sizeof(ownerid)); + CRC_write(handle,&deh,sizeof(deh)); + CRC_write(handle,&boomcount,sizeof(boomcount)); + CRC_write(handle,&shspeed,sizeof(shspeed)); // !!! ...vabbŠ va +} + +void Fireball::animate() { + fixed &x = mover->x, + &y = mover->y, + &z = mover->z; + fixed cn, sn, cl, sl; + fixed cx,cy,dist,alt; + int idx, objid, altok; + int i; + Object *owner; + Mover *mvr; + + if (viewstate) { + sendsound=1; + return; + } + + if (sendsound) { + if (figstart==F_MISSILE) i=SM_MAXVOL; else i=SM_NORMVOL; + play3Dsound(0l,0l,SND_MISSILGO,i,mover->id,SFL_AUTO|SFL_CONTINUE); + sendsound=0; + } + + switch (figstart) { + case F_MISSILE: + if (animtrig++ >= 3) { + animtrig=0; + delete mm_reserve(sizeof(FireBoom)); + objectslist.put(new FireBoom(mover->x,mover->y,mover->z, + mover->angle,BOOM_SMOG)); + } + break; + case F_SLIMFIRE: + if (++animtrig>7) { + animcount = (animcount+1) & 1; + animtrig = 0; + } + break; + case F_SPIDFIRE: + deh-=256l; + if (++animtrig>4) { + animcount = (animcount+1) & 3; + animtrig = 0; + } + break; + } + + remove(); + if ((owner = objectslist.get(ownerid)) != NULL) { + // removes the owner !!!!! + owner->remove(); + } + cn = costab[mover->angle]; + sn = sintab[mover->angle]; + /* + xl = sn<shdim; + yl = cn<shdim; + cn <<= shspeed; + sn <<= shspeed; + */ + objid = -1; + if (health) { + int old = boomcount; + /* + for (i=8;i>0;i--) + if (!mover->canmove(mover->x+cn/i,mover->y+sn/i)) break; + */ + + cx=x-(sn<shdim); cy=y+(cn<shdim); + objid = fireray(cx,cy,mover->angle,0,dist,alt,mover->id); + if (objid==-2) boomcount=old=0; else { + altok = (objid<0) || (LABS(z-alt)<=FIXONE<shdim); + if (!(i = (dist<=64l<shdim); cy=y-(cn<shdim); + objid = fireray(cx,cy,mover->angle,0,dist,alt,mover->id); + if (objid==-2) boomcount=old=0; else { + altok = (objid<0) || (LABS(z-alt)<=FIXONE<shdim); + if (!(i= (dist<=64l<angle,0,dist,alt,mover->id); + if (objid==-2) boomcount=old=0; else { + altok = (objid<0) || (LABS(z-alt)<=FIXONE<shdim); + i = (dist<=64l<>(shspeed/*+1*/)))<0 || boomcount>old) + boomcount = old; + if (objid>=0 && objectslist.get(objid)->figstart==F_SOLDIER) + eventmanager.senddirect(EV_ALERT,mover->id,objid,mover->angle,0); + } else { + i=1; + boomcount=0; + } + if (boomcount && (z+deh>FIXONE<shdim) && + (z+deh<(128l<shdim))) { + // !!!!!!! occhio al 128 !!!!!!!! + boomcount--; + x += cn<id; + /* + //idx = xytoidx(x---+cn,y----+sn); + objid = IDMap[idx]; + while (objid) { + mvr = (objectslist.get(--objid))->mover; + if (mvr->flags & OMF_HITABLE) + // Sends an owner's message + if (figstart==F_SLIMFIRE) + eventmanager.senddirect(EV_HIT,i,objid,mover->angle,10); + else + eventmanager.senddirect(EV_HIT,i,objid,mover->angle,ArmList[ARM_FIREBALL].danno); + objid = mvr->underq(idx); + } + */ + cx=x; cy=y; + objid = fireray(cx,cy,mover->angle,0,dist,alt,mover->id); + altok = (objid<0) || (LABS(z-alt)<=FIXONE<shdim); + if (objid==-2 || (dist<64l<=0) { + // Sends an owner's message + switch (figstart) { + case F_SLIMFIRE: + eventmanager.senddirect(EV_HIT,ownerid,objid,mover->angle,10); + break; + case F_SPIDFIRE: + eventmanager.senddirect(EV_POISON,ownerid,objid,mover->angle,6); + break; + default: + eventmanager.senddirect(EV_HIT,ownerid,objid,mover->angle,ArmList[ARM_BAZOOKA].power); + } + } + } + if (eventmanager.sendcom(EV_KILL,mover->id) && objid>-2) { + //ownerdead(mover->id); + // prima muoio e poi faccio il botto ! + switch (figstart) { + case F_SPIDFIRE: + play3Dsound(x,y,SND_VENOM,SM_NORMVOL,SYSOWN,SFL_NORMAL); + i=BOOM_SPIDER; + break; + case F_SLIMFIRE: + eventmanager.sendpos(EV_BOOM,ownerid,x,y,8l); // !!! + i=BOOM_SLIMER; + //quake = 7; + break; + default: + eventmanager.sendpos(EV_BOOM,ownerid,x,y,(long)ArmList[ARM_BAZOOKA].power); + i=BOOM_MISSIL; + quake = 14; + break; + } + delete mm_reserve(sizeof(FireBoom)); + objectslist.put(new FireBoom(x,y,z,mover->angle,i)); + } + } + if (owner) owner->place(); + place(); +} + +void Fireball::handle_event(TEvent &event) { + if (!health) return; + Object::handle_event(event); + if (event.what == EV_HIT && event.data.msg.y>=10) health=0; +} + +int Fireball::getlightfig() { + return F_CIRCLIGHT; +} + +Bomb::Bomb(fixed px, fixed py, fixed h, int angle, int strng, int _ownerid) + :Actor(px,py,F_BOMB,-8) { + object_type = OBJT_BOMB; + if (!(strenght = strng)) makeObject(); // !!! + mover->z = h; + mover->angle = angle; + mover->shdim = 3; // inutile ? + timer = 5*36; + mover->flags = OMF_VISIBLE|OMF_HITABLE; + SETFLAG(oflags,OFL_TAKEABLE); + animtrig = 0; + decay = FIXONE; + ownerid = _ownerid; +} + +Bomb::Bomb(int handle) + :Actor(handle) { + CRC_read(handle,&ownerid,sizeof(ownerid)); + CRC_read(handle,&decay,sizeof(decay)); + CRC_read(handle,&strenght,sizeof(strenght)); + CRC_read(handle,&timer,sizeof(timer)); + CRC_read(handle,&animtrig,sizeof(animtrig)); +} + +void Bomb::save(int handle) { + Actor::save(handle); + CRC_write(handle,&ownerid,sizeof(ownerid)); + CRC_write(handle,&decay,sizeof(decay)); + CRC_write(handle,&strenght,sizeof(strenght)); + CRC_write(handle,&timer,sizeof(timer)); + CRC_write(handle,&animtrig,sizeof(animtrig)); +} + +void Bomb::animate() { + //int i; + if (viewstate) return; + if (!timer--) { + //if (objectslist.get(ownerid)) i = ownerid; else i = mover->id; + eventmanager.sendcom(EV_KILL,mover->id); + eventmanager.sendpos(EV_BOOM,ownerid,mover->x,mover->y, + ArmList[ARM_BOMB].power); + delete mm_reserve(sizeof(FireBoom)); + objectslist.put(new FireBoom(mover->x,mover->y,mover->z+(8l<<16), + mover->angle,BOOM_MISSIL)); + quake = 21; // !!!!!!!!! + } else { + if (animtrig>=0) { + if (++animtrig >= 6) { + animtrig = 0; + animcount = (animcount+1) % 3; + } + mover->z += (decay -= FIXONE>>2); // !!! ...forse ho esagerato + if (mover->z <= 0) { + mover->z = 0; + decay = -(decay>>1); + if (decay < (FIXONE>>4)) animtrig = -1; + strenght >>= 1; + play3Dsound(mover->x,mover->y,SND_BBOUNCE,SM_NORMVOL,mover->id,SFL_NORMAL); + } + if (strenght) { + Object *obj = objectslist.get(ownerid); + remove(); + if (obj) obj->remove(); + fixed nx = mover->x + (costab[mover->angle]*(strenght>>1)), + ny = mover->y + (sintab[mover->angle]*(strenght>>1)); + if (!mover->canmove(nx,mover->y)) { + if (mover->angle<=ANG180) mover->angle=ANG180-mover->angle; + else mover->angle=ANG180+ANG360-mover->angle; + play3Dsound(mover->x,mover->y,SND_BBOUNCE,SM_NORMVOL,mover->id,SFL_NORMAL); + } else mover->x = nx; + if (!mover->canmove(mover->x,ny)) { + if (mover->angle!=ANG0) mover->angle=ANG360-mover->angle; + play3Dsound(mover->x,mover->y,SND_BBOUNCE,SM_NORMVOL,mover->id,SFL_NORMAL); + } else mover->y = ny; + if (obj) obj->place(); + place(); + //strenght--; + } + } + } +} + +void Bomb::handle_event(TEvent &event) { + if (event.what == EV_GOT) { + if (!GETFLAG(oflags,OFL_ISACTOR)) { + Object::handle_event(event); + return; + } + } else Object::handle_event(event); + switch (event.what) { + case EV_HIT: + case EV_GOT: + //int i; + //if (objectslist.get(ownerid)) i = ownerid; else i = mover->id; + CLRFLAG(oflags,OFL_TAKEABLE); + eventmanager.sendcom(EV_KILL,mover->id); + eventmanager.sendpos(EV_BOOM,ownerid,mover->x,mover->y, + ArmList[ARM_BOMB].power); + delete mm_reserve(sizeof(FireBoom)); + objectslist.put(new FireBoom(mover->x,mover->y,mover->z+(8l<<16), + mover->angle,BOOM_MISSIL)); + quake = 21; // !!!!!!!!! + break; + } +} + +Torcia::Torcia(fixed px, fixed py, int fig) + :LightActor(px,py,fig,1,2,4,MVT_0) +{ + object_type=OBJT_TORCIA; + if (fig==F_BRAZIER) { + mover->z = 20l<<16; + mover->shdim = 4; + CLRFLAG(oflags,OFL_HASLIGHT); + } else { + lightz = mover->z = (32l+20)<<16; + mover->shdim = 2; + mover->flags = OMF_VISIBLE; + } + health = 10; + if (GETFLAG(gameflags,GFL_NORANDOM)) { + animcount = (lshr16(mover->x)>>6) % 3; + animtrig = (lshr16(mover->y)>>6) % 3; + } else { + animcount = random(3); + animtrig = random(3); + } + fireid = -1; +} + +Torcia::Torcia(int handle) + :LightActor(handle) { + if (GETFLAG(gameflags,GFL_NORANDOM)) { + animcount = (lshr16(mover->x)>>6) % 3; + animtrig = (lshr16(mover->y)>>6) % 3; + } else { + animcount = random(3); + animtrig = random(3); + } + fireid = -1; +} + +void Torcia::animate() { + char lr; + if (animtrig>=100) { + if (++animtrig >= 116) { + animcount=3; + selflight=0; + //remove(); !!! + //eventmanager.sendcom(EV_ERASEACT,id); + CLRFLAG(oflags,OFL_HASLIGHT); + if (lightrange) { + remove(); + lightrange=0; + place(); + } + if (fireid>=0) { + stopsound(fireid); + fireid=-1; + //fireid=-1; non serve... ormai Š un object! + } + makeObject(); + } else animcount = (animtrig/6) % 3; + return; + } + + if (nearPlayer(128l<x,mover->y,SND_FIRE,0,mover->id,SFL_NORMAL|SFL_CONTINUE); + else + fireid=play3Dsound(mover->x,mover->y,SND_FIRE,SM_LOWVOL,mover->id,SFL_NORMAL|SFL_CONTINUE); + } else + if (fireid>=0) + if (stopsound(fireid)) fireid=-1; + + if (!have_seen()) { + if (lightrange) { + remove(); + lightrange=0; + place(); + } + /* + if (fireid!=-1) + if (stopsound(fireid)) fireid=-1; + */ + return; + } else reset(); // !!!! + + /*else { + if (nearPlayer(192l<x,mover->y,SND_FIRE,0,0,mover->id,SFL_NORMAL|SFL_CONTINUE); + else + fireid=play3Dsound(mover->x,mover->y,SND_FIRE,16,16,mover->id,SFL_NORMAL|SFL_CONTINUE); + } else + if (fireid!=-1) + if (stopsound(fireid)) fireid=-1; + } + */ + + if (figstart==F_BRAZIER) { + if (++animtrig >= 8) { + animtrig = 0; + if (++animcount > 2) animcount = 0; + } + if (!(animtrig & 3)) + if (GETFLAG(gameflags,GFL_NORANDOM)) { + if (lightrange != animcount+2) { + remove(); + lightrange = animcount+2; + place(); + } + } else { + if (lightrange != (lr = random(2)+2)) { + remove(); + lightrange = lr; + place(); + } + } + } else { + if (++animtrig > 5) { + animtrig = 0; + if (++animcount > 2) animcount = 0; // !!! non voglio usare % + } + if (animtrig & 1) { + //lightpow = -2+random(5); + if (GETFLAG(gameflags,GFL_NORANDOM)) { + if (lightrange != animcount+1) { + remove(); + lightrange = animcount+1; + place(); + } + } else { + if (lightrange != (lr = random(2)+1)) { + remove(); + lightrange = lr; + place(); + } + } + } + } +} + +void Torcia::handle_event(TEvent &event) { + if (!health) return; + if (event.what == EV_BOOM && + (LABS(mover->x-event.data.pos.x)<=48l<y-event.data.pos.y)<=48l< health) { + health = 0; + animtrig = 100; + } + } else + if (event.what == EV_SCODE && event.source == SC_MNDark) { + health = 0; + animtrig = 100; + } else + if (fireid>=0 && event.what == EV_ENDSOUND && event.source==fireid) + fireid=-1; +} + +int Torcia::getlightfig() { + return F_TORCLIGHT; +} + +Lampadario::Lampadario(fixed px, fixed py, int fig) + :LightActor(px,py,fig,1,3,6,MVT_0) +{ + object_type=OBJT_LAMPADARIO; + if (GETFLAG(gameflags,GFL_NORANDOM)) + animtrig = (lshr16(px)>>6) % 6; + else + animtrig = random(6); + mover->flags = OMF_VISIBLE|OMF_HITABLE; + if (fig==F_LAMP) { + mover->z = (68l+16l)<z+(FIXONE<<1); + } else { + mover->z=32l<flags,OMF_UNWALKABLE|OMF_HITABLE); + lightz = 52l<shdim = 2+1; // !!! + health = 18; + decay = 0; +} + +Lampadario::Lampadario(int handle) + :LightActor(handle) { + if (GETFLAG(gameflags,GFL_NORANDOM)) + animtrig = (lshr16(mover->x)>>6) % 6; + else + animtrig = random(6); + decay=0; +} + +void Lampadario::animate() { + char lr; + if (animtrig==127) { + makeObject(); + return; + } + if (animtrig>=100) { + if (animtrig==100) { + selflight=0; + changefig(F_LAMP+2,1); + animcount=0; + animtrig++; + CLRFLAG(oflags,OFL_HASLIGHT); + if (lightrange) { + remove(); + lightrange=0; + place(); + } + //mover->z = 40l<z -= decay)<=0l) { + animtrig++; + mover->z=0l; + changefig(F_LAMP+3,1); + play3Dsound(mover->x,mover->y,SND_GLASS,0, + mover->id,SFL_NORMAL & ~SFL_AUTOSTOP); + } + } else { + if (++animtrig >= 108) { + changefig(F_LAMPX,1); + remove(); + mover->flags = OMF_VISIBLE; + place(); + makeObject(); + } + } + return; + } + if (!have_seen()) { + if (lightrange) { + remove(); + lightrange=0; + place(); + } + return; + } else reset(); // !!!! + if (++animtrig >= 8) { + animtrig = 0; + if (++animcount > 1) animcount = 0; + } + if (!(animtrig & 3)) { + if (GETFLAG(gameflags,GFL_NORANDOM)) { + if (lightrange != animcount+2) { + remove(); + lightrange = animcount+2; + place(); + } + } else + if (lightrange != (lr = random(2)+2)) { + remove(); + lightrange = lr; + place(); + } + } +} + +void Lampadario::handle_event(TEvent &event) { + Object::handle_event(event); + if (animtrig<100 && event.what == EV_HIT) { + //(LABS(mover->x-event.data.pos.x)<=64l<y-event.data.pos.y)<=64l<7 && (health-=(int)event.data.msg.y) <= 0) { + health=0; + animtrig=100; + // if (!(oflags & OFL_ISACTOR)) + makeActor(); + } + } else + if (animtrig<100 && (oflags & OFL_ISACTOR) && + event.what == EV_SCODE && event.source == SC_MNDark) { + //health = 0; + remove(); + lightrange=0; + selflight=0; + place(); + animcount=0; + if (figstart==F_LAMP) changefig(F_LAMPOFF,1); + else changefig(F_TRESPOLOFF,1); + CLRFLAG(oflags,OFL_HASLIGHT); + animtrig=234; + makeObject(); + } +} + +int Lampadario::getlightfig() { + return F_LAMPLIGHT; +} + +Barile::Barile(fixed px, fixed py) + :LightActor(px,py,F_BARILE,1,0,0,MVT_1) +{ + object_type=OBJT_BARILE; + health = 8; + speed = 0; + mover->z = 24l<<16; + //mover->shdim = 4; perchŠ F_BARILX Š largo 33 ! + animtrig = 0; + ownerid = -1; +} + +Barile::Barile(int handle) + :LightActor(handle) { + CRC_read(handle,&animtrig,sizeof(animtrig)); + CRC_read(handle,&speed,sizeof(speed)); + CRC_read(handle,&ownerid,sizeof(ownerid)); +} + +void Barile::save(int handle) { + LightActor::save(handle); + CRC_write(handle,&animtrig,sizeof(animtrig)); + CRC_write(handle,&speed,sizeof(speed)); + CRC_write(handle,&ownerid,sizeof(ownerid)); +} + +void Barile::animate() { + // fixed nx, ny; + const animlight[15] = {0,0,1,1,2,3,4,3,3,2,2,1,1,0,0}; + if (health<=0) { + selflight = 8; + animcount = ++animtrig/6; // ++animtrig>>3; + } + remove(); + if (speed) { + /* + nx = x+costab[angle]*speed; // <<(speed>>2)); + ny = y+sintab[angle]*speed; // <<(speed>>2)); + if (isfree(nx,ny,angle)) { x=nx;y=ny; } else + if (isfree(nx,y,angle)) { x=nx; } else + if (isfree(x,ny,angle)) { y=ny; } + */ + mover->fluidmove(mover->angle,lshl16(speed)); + if (!(--speed) && !animtrig) + //eventmanager.sendcom(EV_ERASEACT,id); + if (!makeObject()) speed=1; + } + /* + if (animtrig==1) { + MemoryManager.reserve(sizeof(FireBoom)); + objectslist.put(new FireBoom( + x-(CosTab[angle]>>14),y-(SinTab[angle]>>14), + BOOM_2)); + } + */ + // if (animtrig == 3) soundmanager->play(id,x,y,SndBoomLen,SFL_ONESHOT,SndBoom); + if (animtrig == 11) { + if (ownerid>=0) + // Sends an owner's message + eventmanager.sendpos(EV_BOOM,ownerid,mover->x,mover->y,32l); + else eventmanager.sendpos(EV_BOOM,mover->id,mover->x,mover->y,32l); + quake = 28; // !!!!!!!!! + } + if (animcount > 4) { + changefig(F_BARILX,1); + //eventmanager.sendcom(EV_ERASEACT,id); + mover->flags = OMF_VISIBLE; + if (makeObject()) { + lightrange=0; + selflight=0; + animcount=0; + } + } else lightrange = animlight[animtrig>>1]; + place(); +} + +void Barile::handle_event(TEvent &event) { + if (animtrig) return; + Object::handle_event(event); + if (event.what == EV_HIT) { + if ((health-=event.data.msg.y) < 0) { + health=0; + ownerid = event.source; + } + makeActor(); // !!! attenti ai doppioni su mitragliata, "ma Š necessario" ! + mover->angle = event.data.msg.x; + if ((speed += event.data.msg.y>>1)>9) speed=9; + } else + /* + if (event.what == EV_BOOM && + (LABS(mover->x-event.data.pos.x)<=96l<y-event.data.pos.y)<=96l<angle = 0; + speed = 0; + } +} + +Vaso::Vaso(fixed px, fixed py, int fig, byte objin) + :Actor(px,py,fig,1,MVT_1) { + object_type=OBJT_VASO; + animtrig = 0; + speed = 0; + mover->z = 24l<shdim = 3; + whatin = objin; +} + +Vaso::Vaso(int handle) + :Actor(handle) { + CRC_read(handle,&animtrig,sizeof(animtrig)); + CRC_read(handle,&speed,sizeof(speed)); + CRC_read(handle,&whatin,sizeof(whatin)); +} + +void Vaso::save(int handle) { + Actor::save(handle); + CRC_write(handle,&animtrig,sizeof(animtrig)); + CRC_write(handle,&speed,sizeof(speed)); + CRC_write(handle,&whatin,sizeof(whatin)); +} + +void Vaso::animate() { + if (health<=0) + animcount = (++animtrig/6)+1; // ++animtrig>>3; + remove(); + if (speed) { + mover->fluidmove(mover->angle,lshl16(speed)); + if (!(--speed) && !animtrig) + if (!makeObject()) speed++; + } + // if (animtrig == 3) soundmanager->play(id,x,y,SndBoomLen,SFL_ONESHOT,SndBoom); + if ((figstart == F_VASO && animcount >= 5) || + (figstart == F_PIANTA && animcount >= 4)) { + mover->flags = OMF_VISIBLE; + if (!makeObject()) animtrig--; + } + place(); +} + +void Vaso::handle_event(TEvent &event) { + if (animtrig) return; + Object::handle_event(event); + if (event.what == EV_HIT) { + if ((health-=event.data.msg.y) < 0) { + health=0; + if (figstart==F_VASO) + play3Dsound(mover->x,mover->y,SND_VASO1,SM_NORMVOL,mover->id,SFL_NORMAL & ~SFL_AUTOSTOP); + else + play3Dsound(mover->x,mover->y,SND_VASO2,SM_NORMVOL,mover->id,SFL_NORMAL & ~SFL_AUTOSTOP); + } + makeActor(); // !!! attenti ai doppioni su mitragliata, "ma Š necessario" ! + animtrig++; // Questo evita i doppioni ! + mover->angle = event.data.msg.x; + if ((speed += event.data.msg.y>>1)>9) speed=9; + + remove(); + mover->flags = OMF_VISIBLE; + place(); + + // Eject souvenirs + //if (figstart == F_PIANTA) { + int angle, + strength = event.data.msg.y; + word fig; + Object *obj; + + if (!GETFLAG(gameflags,GFL_NORANDOM)) + angle = anglesub(angleadd(event.data.msg.x,ANG180+(ANG30>>1)),random(ANG30)); + else + angle = angleadd(event.data.msg.x,ANG180); + /* + int x; + if (norandom) x = (lshr16(mover->x + mover->y) >> 6) % 9; + else x = random(9); + */ + switch (whatin) { + case 0: fig = 0; break; + case 1: fig = F_FUCILE; break; + case 2: fig = F_MITRA; break; + case 3: fig = F_BAZOOKA; break; + case 4: fig = F_BOMB; break; + case 5: fig = F_CARTUCCIA1; break; + case 6: fig = F_CARTUCCIA2; break; + case 7: fig = F_CARTUCCIA3; break; + case 8: fig = F_CARTUCCIA4; break; + case 9: fig=0; break;// BOOM, now do nothing + } + if (fig) { + delete mm_reserve(sizeof(Object)); + obj = new Object(mover->x,mover->y,fig,1,MVT_0); + CLRFLAG(obj->mover->flags,OMF_UNWALKABLE|OMF_HITABLE); + SETFLAG(obj->oflags,OFL_TAKEABLE); + objectslist.put(obj); + delete mm_reserve(sizeof(ObjMover)); + objectslist.put(new ObjMover(obj->getid(),angle,strength)); + } else + if (whatin==9) { + eventmanager.sendpos(EV_BOOM,mover->id,mover->x,mover->y, + (long)ArmList[ARM_BAZOOKA].power); + delete mm_reserve(sizeof(FireBoom)); + objectslist.put(new FireBoom(mover->x,mover->y,mover->z, + mover->angle,BOOM_MISSIL)); + quake=14; + } + //} + } + /* + if (event.what == EV_BOOM && + (LABS(mover->x-event.data.pos.x)<=96l<y-event.data.pos.y)<=96l< // ONLY for RANDOM + +#include + +static word packcount; + +Player::Player(fixed px, fixed py, int ang, byte cntrlnum) + :CanFireActor(px,py,F_PLAYER,8,MVT_2) +{ + object_type = OBJT_PLAYER; + control = PControl[controlnum = cntrlnum]; + mover->angle = ang; + mover->z = 32l<shdim = 4; // !!! + SETFLAG(armflag,AFL_ASCIA); + takearm(ARM_PISTOLA); + //curarm = ARM_PISTOLA; + //Armbull[0] = ARM_PREPISTOLA; + //score = 0l; + hitspeed = 0; + hitangle = 0; + vangle = 0; + vangang = 0; + pflags = 0; + cecita = 0; + hardcount = 0; + //hwalk = 32l<angle = ang; + mover->z = 32l<shdim = 4; // !!! + speed = 0; angspeed = 0; latspeed = 0; + angwalk = 0; animtrig=0; handang = ANG0; + hitspeed = 0; hitangle = 0; + vangle = 0; vangang = 0; + cecita = 0; + hardcount=0; + pflags = 0; + upwalk=0; + //score = data.score; + health = data.health; + curarm = data.curarm; + if (GETFLAG(gameflags,GFL_COMPETITIVE)) keys = data.keys; + else keys = 0; + armflag = data.armflag; + fwmove(Armbull,data.armbull,sizeof(Armbull)); + setcomtype(COM_DIRECT); + fires=0;hits=0;blood=0;kills=0;tecno=0; + plkilled=0; + // dead check + if (health<=0) { + health = -1; + hwalk = 4l<>5); + } +} + +void Player::setcomtype(char type) { + comtype = type; + oldpack=0x8000; // Combinazione impossibile (per ora) + packcount=0; +} + +void Player::save(int handle) { + CanFireActor::save(handle); + CRC_write(handle,&controlnum,sizeof(controlnum)); + CRC_write(handle,&keys,sizeof(keys)); + //CRC_write(handle,&score,sizeof(score)); + //CRC_write(handle,Armbull,sizeof(Armbull)); + CRC_write(handle,&cecita,sizeof(cecita)); + //CRC_read(handle,&hwalk,sizeof(hwalk)); // se morto + CRC_write(handle,&hardcount,sizeof(hardcount)); + CRC_write(handle,myseenmap,MAPDIM); + CRC_write(handle,&fires,sizeof(fires)); + CRC_write(handle,&hits,sizeof(hits)); + CRC_write(handle,&blood,sizeof(blood)); + CRC_write(handle,&kills,sizeof(kills)); + CRC_write(handle,&tecno,sizeof(tecno)); + CRC_write(handle,&plkilled,sizeof(plkilled)); + // dead check + if (health<=0) { + health = -1; + hwalk = 4l<>5); + } +} + +void Player::draw(int vidx, int vidy, char &cd, char &fd) { + int k; + if (MAPVIEW) { + virtualview(mover->x,mover->y,mover->angle,mover->id); + updatemap(myseenmap); + drawmap(vidx,vidy,mover->x,mover->y,mover->angle,myseenmap); + } else { + k = cecita>>5; + drawview(vidx,vidy,mover->x,mover->y,hwalk, + mover->angle,vangle,mover->id,cd,fd,k); + updatemap(myseenmap); + if (health>0) { + int arm, cfact; + if (armchanging<(ARMCHGSPEED/2)) { + arm = curarm; + cfact = -armchanging; + } else { + arm = oldarm; + cfact = armchanging-ARMCHGSPEED; + } + switch(arm) { + case ARM_ASCIA: // 36 vedi animate per la sincronizzazione ! + if (armcharge<12) + drawhand(PlayerAscia[0],50,115,-30,(cfact*115)/18,115,handang,k); + else + if (armcharge>28) + drawhand(PlayerAscia[1],85,150,-40-12,0,150,handang,k); + else + drawhand(PlayerAscia[2],106,123,4,0,123,handang,k); + break; + case ARM_PISTOLA: // 18 + if (armcharge<6) + drawhand(PlayerPist[0],55,61,23,(cfact*61)/18,61,handang,k); + else + if (armcharge>14) { + drawhand(PlayerPist[2],42,39,22,47,61,handang,k); + drawhand(PlayerPist[0],55,61,23,0,61,handang,k); + } else + drawhand(PlayerPist[1],55,67,21,-10,67,handang,k); + break; + case ARM_FUCILE: // 36 + if (armcharge<13) + drawhand(PlayerFuc[0],65,53,37,(cfact*53)/18,53,handang,k); + else + if (armcharge>30) { + drawhand(PlayerFuc[2],40,31,20,41,53,handang,k); + drawhand(PlayerFuc[0],65,53,37,0,53,handang,k); + } else + if (armcharge>26) + drawhand(PlayerFuc[0],65,53,37,0,53,handang,k); + else + //if (armcharge>12) + drawhand(PlayerFuc[1],99,108,62,0,108,handang,k); + break; + case ARM_MITRA: // + if (armcharge>2 && armcharge<5) + drawhand(PlayerMitr[4],42,41,21,64,77,handang,k); + drawhand(PlayerMitr[0],53,77,33,(cfact*77)/18,77,handang,k); + switch(armcharge) { + case 0: break; + case 5: + case 1: + drawhand(PlayerMitr[1],53,31,33,46,77,handang,k); + break; + case 4: + case 2: + drawhand(PlayerMitr[2],53,31,33,46,77,handang,k); + break; + default: + drawhand(PlayerMitr[3],53,31,33,46,77,handang,k); + } + if (armcharge) + switch(random(2)) { + case 0: handang=angleadd(handang,random(ANG30)); break; + case 1: handang=anglesub(handang,random(ANG30)); break; + } + break; + case ARM_BAZOOKA: + int app = ArmList[ARM_BAZOOKA].chargetime; + if (armcharge && !armchanging) { + if (app-armcharge <= app>>2) + cfact = (armcharge-app)*6/(app>>2); // negativo + else + if (armcharge >= app>>2) + cfact = ((app>>2)-armcharge)*6/(app>>1); // negativo + else cfact=0; + } + drawhand(PlayerBaz,83,68,41,(cfact*68)/18,68,handang,k); + break; + } + } + } + k = 0; + if (health>100) { + putlfig(vidx-(viewwidth>>1),vidy+(viewheight>>1)-16,16,16,mm_recall(minibox_I)); + k+=16; + } + if (hardcount>0) putlfig(vidx-(viewwidth>>1)+k,vidy+(viewheight>>1)-16,16,16,mm_recall(minibox_F)); +} + +void Player::transf(int vidx, int vidy) { + if (viewwidth==320) ftransfarea(0,168,VMEMPTR); // !!! + else ftransfblock(vidx-halfwidth,vidy-halfheight,viewwidth,viewheight,VMEMPTR); +} + +void Player::updatecommands() { + command.up = Key[control.up]; + command.down = Key[control.down]; + command.left = Key[control.left]; + command.right = Key[control.right]; + command.open = kb_pressed(control.open); + command.fire = kb_pressed(control.fire); + command.fast = Key[control.fast]; + command.strafe = Key[control.strafe]; + command.chgarm = kb_onepressed(control.chgarm); + command.lookup = Key[control.lookup]; + command.lookmid = Key[control.lookmid]; + command.lookdown= Key[control.lookdown]; + command.map = kb_onepressed(control.map); +} + +void Player::savepack(word pack) { + if (Key[KB_F5]) { + if (packcount) { + packcount |= 0x8000; // il primo bit indica delay + CRC_write(playbackhandle,&packcount,sizeof(packcount)); + } + pack = 0x8000; // END OF FILE + CRC_write(playbackhandle,&pack,sizeof(pack)); + eventmanager.sendcom(EV_ENDPLAYBACK,0); + setcomtype(COM_DIRECT); + } else + if (pack==0x8000) { // see destructor + if (packcount) { + packcount |= 0x8000; // il primo bit indica delay + CRC_write(playbackhandle,&packcount,sizeof(packcount)); + } + // ready to die + } else + if (pack!=oldpack || packcount>32700) { + if (packcount) { + packcount |= 0x8000; // il primo bit indica delay + CRC_write(playbackhandle,&packcount,sizeof(packcount)); + } + packcount=0; + oldpack = pack; + CRC_write(playbackhandle,&pack,sizeof(pack)); + } else packcount++; +} + +word Player::loadpack() { + word pack = 0x8000; + if (packcount<=1) { + //if (!CRC_eof(packfile)) { + CRC_read(playbackhandle,&pack,sizeof(pack)); + if (pack != 0x8000) { + if (pack & 0x8000) packcount=pack & 0x7fff; + else { + oldpack=pack; + packcount=0; + return pack; + } + } else { + eventmanager.sendcom(EV_ENDPLAYBACK,0); + setcomtype(COM_DIRECT); + return 0; + } + } else packcount--; + return oldpack; +} + +/* +void Player::savepack2(word pack) { + if (Key[KB_F5]) { + pack = 0xff; + CRC_write(playbackhandle,&pack,1); // !!! 1 !!! + eventmanager.sendcom(EV_ENDPLAYBACK,0); + setcomtype(COM_DIRECT); + } else + if (pack!=oldpack) { + oldpack = pack; + asm { // make high-part first + MOV AX, pack + XCHG AH, AL + MOV pack, AX + } + CRC_write(playbackhandle,&pack,sizeof(pack)); + } else { + pack = 0x80; + CRC_write(playbackhandle,(void *)&pack,1); // !!! occhio 1 !!! + } +} + +word Player::loadpack2() { + word data; + CRC_read(playbackhandle,&data,1); + if ((data & 0x00ff) == 0x00ff) { + eventmanager.sendcom(EV_ENDPLAYBACK,0); + setcomtype(COM_DIRECT); + return 0; + } else + if (!(data & 0x0080)) { + data <<= 8; + CRC_read(playbackhandle,&data,1); + return oldpack = data; + } + return oldpack; +} +*/ + +word Player::setpackbit(byte bit, byte val) { + if (val) return (word)1<x, + dy2 = mover->y; + long dx1 = LABS(dx2-x), + dy1 = LABS(dy2-y); + */ + if ((mover->x != x) || (mover->y != y) || (mover->angle != ang)) { + //if ((dx2 != x) || (dy2 != y) || (mover->angle != ang)) { + mover->angle = ang; + if (x>=mover->x) { + //if (x>=dx2) { + if (mover->canmove(x+(16l<<16),y+(8l<<16)) && + mover->canmove(x+(16l<<16),y-(8l<<16))) + mover->x = x; + } else { + if (mover->canmove(x-(16l<<16),y+(8l<<16)) && + mover->canmove(x-(16l<<16),y-(8l<<16))) + mover->x = x; + } + if (y>=mover->y) { + //if (y>=dy2) { + if (mover->canmove(x+(8l<<16),y+(16l<<16)) && + mover->canmove(x-(8l<<16),y+(16l<<16))) + mover->y = y; + } else { + if (mover->canmove(x+(8l<<16),y-(16l<<16)) && + mover->canmove(x-(8l<<16),y-(16l<<16))) + mover->y = y; + } + /* + dx2 = LABS(dx2-mover->x); + dy2 = LABS(dy2-mover->y); + dx1 += dy1; dx2 += dy2; + if (dx2x, ny = mover->y; + int i, j, newang = mover->angle; + + if (viewstate>=2) return; // !!! + + switch(comtype) { + case COM_DIRECT: + if (!viewstate) updatecommands(); + break; + case COM_LOAD: unpackcom(loadpack()); break; + case COM_SAVE: + updatecommands(); + savepack(packcom()); + break; + } + + if (health<0) { + if (!viewstate) + if (command.left) mover->angle = anglesub(newang,ANG45>>3); else + if (command.right) mover->angle = angleadd(newang,ANG45>>3); + return; + } + + remove(); + if (!viewstate) { + CanFireActor::animate(); + if (health==0) { + changefig(F_PLAYER+34,1); + CLRFLAG(mover->flags,OMF_HITABLE|OMF_UNWALKABLE); + if (ABS(newang-angleadd(hitangle,ANG180))>ANG45) + newang=angleadd(newang,ANG45>>3); + if (hitspeed) { + nx+=costab[hitangle]*hitspeed; + ny+=sintab[hitangle]*hitspeed; + vangang=angleadd(vangang,ANGLVL*12); + vangle = (int)fixmul((-sintab[vangang])*hitspeed/30,ANG30); + if (vangle<0) vangle+=ANG360; + hwalk += hitspeed*sintab[vangang>>1]; + if (hwalk>62l< 32l< 4l<x,mover->y,SND_SOLDDOWN,0,mover->id,SFL_NORMAL); + eventmanager.sendcom(EV_MESSAGE,MSG_DEAD); + } + if (hwalk<32l<>1;//anglesub(ANG30>>1,hwalk>>(FIXSHIFT-3)); + vangle=anglesub(ANG0,(lshr16(hwalk)-32)*ANG30>>5); + animcount = 4-((lshr16(hwalk)-4)/7); + if (animcount<0) animcount=0; else + if (animcount>4) animcount=4; + } + moveto(nx,ny,newang); + place(); + return; + } + + if (cecita) cecita--; + if (hardcount) { + if (!(--hardcount)) animpal(PAA_UNHARD,0); + } + if (upwalk) + if (upwalk>0) upwalk=-upwalk; // comincia la discesa + else upwalk+=2; // si scende ! + if (health>100) { + if (--health == 100) { + //animpal(PAA_GOLD,1); + animpal(PAA_UNGOD,0); + //playsound(SND_COLPO1,0,0,127,SFL_FIXED); + } + if (!((health-100) & 31)) + eventmanager.sendshort(EV_UPDATEBAR,mover->id,0,IBR_HEALTH,0); + } + + // Arm animation handler + if (armcharge>0) { + if (!curarm) { + if (armcharge==30) { + play3Dsound(nx,ny,SND_SOLDATT,SM_NORMVOL,mover->id,SFL_NORMAL); + } else + if (armcharge==24) { + updatestat(STT_FIRE,1); + fixed cx = nx, cy = ny, + alt = hwalk, dist; + i = fireray(cx,cy,newang,vangle,dist,alt,mover->id); + if (dist<=74l<-2) makeboom(cx,cy,alt,newang,i,BOOM_ASCIA); + if (i>=0) + eventmanager.senddirect(EV_HIT,mover->id,i, + newang,ArmList[ARM_ASCIA].power); + if (i>=-1) + play3Dsound(cx,cy,SND_ASCIAHIT,0,SYSOWN,SFL_NORMAL); + /* + if (id>-2) { + delete mm_reserve(sizeof(FireBoom)); + objectslist.put(new FireBoom(cx,cy,alt,BOOM_1)); + } + */ + } + } + } else + if (curarm==ARM_FUCILE && armcharge==30) + play3Dsound(mover->x,mover->y,SND_CHARGE,SM_LOWVOL,SYSOWN,SFL_NORMAL); + } + + if (command.map) CHGFLAG(pflags,PFL_MAPVIEW); //pflags = pflags ^ PFL_MAPVIEW; + + if (command.open) + eventmanager.sendshort(EV_PLACTIVATE,mover->id,0, + xytoidx(mover->x+(costab[newang]<<5), + mover->y+(sintab[newang]<<5)), + keys); + if (command.chgarm) { + j = i = curarm; + //while (!setarm(j = (j+1)%(ARM_BOMB+1)) && j!=i); + do { + do { + j = (j+1)%(ARM_BOMB+1); + } while (j && !Armbull[j-1]); + } while (!setarm(j)); + if (i!=curarm) + eventmanager.sendshort(EV_UPDATEBAR,mover->id,0,IBR_ARMS,0); + } else + if (players<2 && comtype==COM_DIRECT) { + j = curarm; + if (kb_onepressed(KB_1)) i=0; else + if (kb_onepressed(KB_2)) i=1; else + if (kb_onepressed(KB_3)) i=2; else + if (kb_onepressed(KB_4)) i=3; else + if (kb_onepressed(KB_5)) i=4; else + if (kb_onepressed(KB_6)) i=5; else i=-1; + if (i>=0) setarm(i); + if (j!=curarm) + eventmanager.sendshort(EV_UPDATEBAR,mover->id,0,IBR_ARMS,0); + } + if (command.fire && fire(newang)) { + animtrig = 200+armcharge; + animcount = 1; + } + /* + else { + if (!GODMODE && !armcharge && armchanging<18 && !Armbull[curarm-1]) { + j = i = curarm; + do { + while (j && !Armbull[j-1]) j--; + } while (!setarm(j)); + if (i!=curarm) + eventmanager.sendshort(EV_UPDATEBAR,mover->id,0,IBR_ARMS,0); + } + } + */ + i=0; j=0; + if (command.strafe) { + j++; + if (command.left) { + if (command.fast) + {if (latspeed>-8) {if ((latspeed-=2)<-8) latspeed=-8;}} + else + {if (latspeed>-6) {if ((latspeed-=2)<-6) latspeed=-6;}} + } else + if (command.right) { + if (command.fast) + {if (latspeed<8) {if ((latspeed+=2)>8) latspeed=8;}} + else + {if (latspeed<6) {if ((latspeed+=2)>6) latspeed=6;}} + } else i++; + } else { + i++; + if (command.left) { + if (command.fast) { + if (angspeed>-5) angspeed-=2; + else angspeed=-6; + } else { + if (angspeed>-3) angspeed-=2; + else angspeed=-4; + } + } else + if (command.right) { + if (command.fast) { + if (angspeed<5) angspeed+=2; + else angspeed=6; + } else { + if (angspeed<3) angspeed+=2; + else angspeed=4; + } + } else j++; + } + if (i) { + if (latspeed>0) latspeed--; else + if (latspeed<0) latspeed++; + } + if (j) { + if (angspeed>0) angspeed--; else + if (angspeed<0) angspeed++; + } + + if (angspeed) { + if (angspeed>=0) newang = angleadd(newang,ANGLVL*angspeed); + else newang = anglesub(newang,ANGLVL*(-angspeed)); + } + + if (latspeed) { + i = newang+ANG90; if (i>=ANG360) i-=ANG360; + j = ABS(latspeed)>>1; + // if (Key[KB_LSHIFT]) j--; + if (latspeed>0) { + nx += costab[i]<36) speed=36;} else speed=36;} + else + {if (speed<28) {if ((speed+=4)>28) speed=28;} else speed=28;} + } else + if (command.down) { + if (command.fast) + {if (speed>-36) {if ((speed-=4)<-36) speed=-36;} else speed=-36;} + else + {if (speed>-28) {if ((speed-=4)<-28) speed=-28;} else speed=-28;} + } else { + if (speed>0) speed--; else + if (speed<0) speed++; + } + if (hitspeed<0) { + i = ANGLVL<<2; + if (command.lookup) { + vangle=angleadd(vangle,i); + if (vangle>ANG30-i && vangleANG30-i && vangle0) latspeed--; else + if (latspeed<0) latspeed++; + if (angspeed>0) angspeed--; else + if (angspeed<0) angspeed++; + if (speed>0) speed--; else + if (speed<0) speed++; + } + } + + if (!viewstate) { + if (speed) { + + if (GETFLAG(gameflags,GFL_AUTOCENTER)) + if (ABS(speed)>24 && hitspeed<0 && vangle) hitspeed=0; + + nx += costab[newang]*speed>>2; + ny += sintab[newang]*speed>>2; + //if (health>0) { + if (!GODMODE) { + i = angwalk; + angwalk = (angwalk+((speed*ANGLVL<<1)/3)+ANG360) % ANG360; + hwalk = (FIXONE*ABS(upwalk))+(32l<<16)+(sintab[angwalk]*ABS(speed)>>4); + // hwalk = (FIXONE*ABS(upwalk))+(32l<<16); + if (abs(angwalk-ANG270)<=ANG30 && + abs(i-ANG270)>ANG30) + play3Dsound(0l,0l,SND_PASSO,SM_LOWVOL,mover->id,SFL_MULTI|SFL_FOLLOW); + } else { + angwalk = (angwalk+(ANGLVL<<2)+ANG360) % ANG360; + hwalk = (FIXONE*ABS(upwalk))+(44l<<16)+(sintab[angwalk]/**ABS(speed)>>4*/); + //hwalk = ((FIXONE>>4)<>4*/); + } + handang = (handang+(speed*ANGLVL>>1)+ANG360) % ANG360; + //handh = fixmul(sintab[handang],speed>>4); + //} + if (animtrig<200) { + if (speed>0) { + if ((animtrig+=speed>>2) >= 128) animtrig -= 128; + } else { + if ((animtrig+=speed>>2) < 0) animtrig += 128; + } + switch (animtrig >> 5) { + case 0: + case 2: animcount = 0; break; + case 1: animcount = 3; break; + case 3: animcount = 2; + } + } + + } else { + if (GODMODE) { + angwalk = (angwalk+(ANGLVL<<2)+ANG360) % ANG360; + hwalk = (44l<<16)+sintab[angwalk]; + } else { + angwalk = 0; + hwalk = (FIXONE*ABS(upwalk))+(32l<<16); + } + if (animtrig<200) { + animtrig=0; + animcount=0; + } + } + + if (hitspeed>0) { + nx+=costab[hitangle]*hitspeed; + ny+=sintab[hitangle]*hitspeed; + vangang=angleadd(vangang,ANGLVL*12); + vangle = (int)fixmul((-sintab[vangang])*hitspeed/30,ANG30); + if (vangle<0) vangle+=ANG360; + hwalk += hitspeed*sintab[vangang>>1]; + hitspeed--; + } else + if (!hitspeed) { + if (vangle) { + if (vangle<=ANG90) vangle >>= 1; else + if ((vangle = ANG360-((ANG360-vangle)>>1)) == ANG360) vangle=0; + } else hitspeed--; + vangang = 0; + } + + if (animtrig>=200) { // sparo o colpito + if (--animtrig <= 200) { + animtrig = 0; + animcount = 0; + changefig(F_PLAYER,8); + } + } + + moveto(nx,ny,newang); + + Object *obj; + j = mover->index; + if (players<2) { + if ((i = ceilmap[j])==T_DOORSLOT || i>=T_TRANSP) { + if (windsound<0) + windsound=playsound(SND_WIND,SM_NORMVOL,SM_NORMVOL,0,SYSOWN,SFL_CONTINUE|SFL_FADE); + //windsound = play3Dsound(256l<id, + // SFL_CONTINUE|SFL_FADE|SFL_MULTI|SFL_FOLLOW /*& ~SFL_RAY*/); + } else + if (windsound>=0) + if (stopsound(windsound)) windsound=-1; + } + if ((i = /*mover->under*/IDMap[j]) >= 0) // it's under me ! + do { + obj = objectslist.get(i); + if (GETFLAG(obj->oflags,OFL_TAKEABLE)) + eventmanager.senddirect(EV_GET,i,mover->id,0,0); + } while ((i = obj->mover->underq(j)) >= 0); + } + place(); +} + +void Player::handle_event(TEvent &event) { + int msg = -1; + if (event.what != EV_KILL) Object::handle_event(event); + if (health<0) { + if (event.what==EV_SCODE && event.source==SC_MNNico) { + eventmanager.sendcom(EV_RESURRECT,mover->id); + changefig(F_PLAYER,8); animcount=0; + health=100+400; cecita=0; + eventmanager.sendshort(EV_UPDATEBAR,mover->id,0,IBR_HEALTH,0); + remove(); + SETFLAG(mover->flags,OMF_HITABLE|OMF_UNWALKABLE); + place(); + eventmanager.sendcom(EV_MESSAGE,MSG_RESURRECT); + } + return; + } + switch (event.what) { + case EV_ENDSOUND: + eventmanager.sendpos(EV_PLNOISE,mover->id,mover->x,mover->y,0); + break; + case EV_POISON: + if (GODMODE || health<=0 || health>100) break; + if ((cecita += event.data.msg.y<<5) > 384) cecita=384; + eventmanager.sendcom(EV_MESSAGE,MSG_POISONED); + //if ((score-=10)<0) score=0; + //eventmanager.sendshort(EV_UPDATEBAR,mover->id,0,IBR_SCORE,0); + case EV_HIT: + if (health<=0) break; + if (!GODMODE && health<=100 && event.data.msg.y>=4) { + if ((health-=event.data.msg.y)<0) { + health=0; + eventmanager.sendshort(EV_PLKILLED,mover->id,event.source,0,0); + // !!! attenzione Š short NON direct + } + hitangle = event.data.msg.x; + if ((hitspeed = event.data.msg.y) >= 26) hitspeed=26; + if (hitspeed>=10) play3Dsound(mover->x,mover->y,SND_COLPO2,0,mover->id,SFL_NORMAL); else + if (hitspeed>=6) play3Dsound(mover->x,mover->y,SND_COLPO1,0,mover->id,SFL_NORMAL); + changefig(F_PLAYER+32,2); + animcount=0; animtrig=220; + vangle = 0; + vangang = 0; + animpal(PAA_RED,hitspeed>>4); + eventmanager.sendshort(EV_UPDATEBAR,mover->id,0,IBR_FACEHIT|IBR_HEALTH,0); + } + break; + case EV_PLKILLED: + if (event.data.msg.dest == mover->id && + event.source != mover->id) { // il suicidio Š possibile + plkilled++; + eventmanager.sendshort(EV_UPDATEBAR,mover->id,0,IBR_PLKILLED,0); + } + break; + case EV_GET: + Object *object = objectslist.get(event.source); + if (object != NULL) { // OVVIO + char i = 1; + /* + switch (object->object_type) { + case OBJT_OBJECT: + */ + switch (object->figstart) { + case F_KEYELLOW: + if (!GETFLAG(keys,LCKT_L1)) { + SETFLAG(keys,LCKT_L1); + eventmanager.sendshort(EV_UPDATEBAR,mover->id,0,IBR_KEYS,0); + playsound(SND_KEYS,16,16,0,SYSOWN,SFL_FIXED); + animpal(PAA_YKEY,0); + eventmanager.sendcom(EV_MESSAGE,MSG_GOT_KEY_YELLOW); + //i++; + } else i--; + break; + case F_KEYRED: + if (!GETFLAG(keys,LCKT_L2)) { + SETFLAG(keys,LCKT_L2); + eventmanager.sendshort(EV_UPDATEBAR,mover->id,0,IBR_KEYS,0); + playsound(SND_KEYS,16,16,0,SYSOWN,SFL_FIXED); + animpal(PAA_RKEY,0); + eventmanager.sendcom(EV_MESSAGE,MSG_GOT_KEY_RED); + //i++; + } else i--; + break; + case F_FUCILE: + case F_MITRA: + case F_BAZOOKA: + byte arm; + switch(object->figstart) { + case F_FUCILE: arm = ARM_FUCILE; break; + case F_MITRA: arm = ARM_MITRA; break; + case F_BAZOOKA: arm = ARM_BAZOOKA; break; + } + char token = takearm(arm); + + if (token>1) { // arm & ammo (forse) + switch(arm) { + case ARM_FUCILE: msg=MSG_GOT_FUCILE; break; + case ARM_MITRA: msg=MSG_GOT_MITRA; break; + case ARM_BAZOOKA: msg=MSG_GOT_BAZOOKA; break; + } + animpal(PAA_ARM,1); + if (arm==ARM_BAZOOKA) { + playsound(SND_RISATA,0,0,0,SYSOWN,SFL_FIXED); + playsound(SND_CHARGE2,0,0,127,SYSOWN,SFL_FIXED); + eventmanager.sendshort(EV_UPDATEBAR,mover->id,0,IBR_SMILE,0); + } else + playsound(SND_CHARGE,0,0,127,SYSOWN,SFL_FIXED); + } else + if (token>0) { // ammo only + switch(arm) { + case ARM_FUCILE: msg=MSG_GOT_AMMO_FUCILE; break; + case ARM_MITRA: msg=MSG_GOT_AMMO_MITRA; break; + case ARM_BAZOOKA: msg=MSG_GOT_AMMO_BAZOOKA; break; + } + animpal(PAA_ARM,0); + if (arm==ARM_BAZOOKA) + playsound(SND_CHARGE2,0,0,0,SYSOWN,SFL_FIXED); + else + playsound(SND_CHARGE,0,0,0,SYSOWN,SFL_FIXED); + } else { + i--; + break; + } + eventmanager.sendshort(EV_UPDATEBAR,mover->id,0,IBR_ARMS,0); + if (msg>=0) eventmanager.sendcom(EV_MESSAGE,msg); + break; + case F_CARTUCCIA1: + case F_CARTUCCIA2: + case F_CARTUCCIA3: + case F_CARTUCCIA4: + switch(object->figstart) { + case F_CARTUCCIA1: + if (!takeammo(ARM_PISTOLA,ARM_ADDPISTOLA)) i--; + msg = MSG_GOT_AMMO_PISTOLA; + break; + case F_CARTUCCIA2: + if (!takeammo(ARM_FUCILE,ARM_ADDFUCILE)) i--; + msg = MSG_GOT_AMMO_FUCILE; + break; + case F_CARTUCCIA3: + if (!takeammo(ARM_MITRA,ARM_ADDMITRA)) i--; + msg = MSG_GOT_AMMO_MITRA; + break; + case F_CARTUCCIA4: + if (!takeammo(ARM_BAZOOKA,ARM_ADDBAZOOKA)) i--; + msg = MSG_GOT_AMMO_BAZOOKA; + break; + /* + case F_CARTUCCIA5: + break; + */ + } + if (i) { + eventmanager.sendshort(EV_UPDATEBAR,mover->id,0,IBR_ARMS,0); + if (msg>=0) eventmanager.sendcom(EV_MESSAGE,msg); + if (object->figstart == F_CARTUCCIA4) + playsound(SND_CHARGE2,0,0,0,SYSOWN,SFL_FIXED); + else + playsound(SND_CHARGE,0,0,0,SYSOWN,SFL_FIXED); + animpal(PAA_ARM,0); + } + break; + case F_FARMABIG: + case F_FARMALIT: + msg = MSG_GOT_FARMA_LIT; + if (health>=100) { // Non prende il kit medico + i--; break; + } + if (object->figstart == F_FARMABIG) { + health+=20; + msg = MSG_GOT_FARMA_BIG; + //animpal(PAA_GOLD,0); + } + health+=10; + if (health>100) health=100; + animpal(PAA_GOLD,0); + eventmanager.sendshort(EV_UPDATEBAR,mover->id,0,IBR_HEALTH,0); + playsound(SND_KEYS,16,16,0,SYSOWN,SFL_FIXED); + eventmanager.sendcom(EV_MESSAGE,msg); + //i++; + break; + case F_SOLDOBIG: + /* + if (!hardcount) { + animpal(PAA_HARD,0); + } + */ + if ((hardcount += 720) > 2160) hardcount = 2160; + playsound(SND_BONUS,0,0,0,SYSOWN,SFL_FIXED); + eventmanager.sendcom(EV_MESSAGE,MSG_GOT_BIGCOIN); + break; + case F_SOLDOLIT: + //score += 10; + animpal(PAA_GOLD,0); + //eventmanager.sendshort(EV_UPDATEBAR,mover->id,0,IBR_SCORE,0); + playsound(SND_KEYS,16,16,0,SYSOWN,SFL_FIXED); + eventmanager.sendcom(EV_MESSAGE,MSG_GOT_LITCOIN); + //i++; + break; + /* + } + break; + */ + //case OBJT_BONUS: + case F_BONUS: + //score += 100; + if (health<=100) { + health=100; + //animpal(PAA_GOD,0); + } + if ((health += 720) > 2160) health = 2160; + if (armflag && AFL_PISTOLA) + Armbull[ARM_PISTOLA-1] = ArmList[ARM_PISTOLA].max_ammo; + if (armflag && AFL_FUCILE) + Armbull[ARM_FUCILE-1] = ArmList[ARM_FUCILE].max_ammo; + if (armflag && AFL_MITRA) + Armbull[ARM_MITRA-1] = ArmList[ARM_MITRA].max_ammo; + if (armflag && AFL_BAZOOKA) + Armbull[ARM_BAZOOKA-1] = ArmList[ARM_BAZOOKA].max_ammo; + if (armflag && AFL_BOMB) + Armbull[ARM_BOMB-1] = ArmList[ARM_BOMB].max_ammo; + /* + if (armflag && AFL_BOMB) + Armbull[ARM_BOMB-1] = ARM_MAXBOMB; + */ + eventmanager.sendshort(EV_UPDATEBAR,mover->id,0, + IBR_SMILE|/*IBR_SCORE|*/IBR_HEALTH|IBR_ARMS,0); + playsound(SND_BONUS,0,0,0,SYSOWN,SFL_FIXED); + //animpal(PAA_GOLD,2); + eventmanager.sendcom(EV_MESSAGE,MSG_GOT_BONUS); + break; + case F_ANTIKAOS: + animpal(PAA_LIGHT,0); + playsound(SND_BONUS,0,0,0,SYSOWN,SFL_FIXED); + eventmanager.sendshort(EV_UPDATEBAR,mover->id,0,IBR_SMILE,0); + eventmanager.sendcom(EV_MESSAGE,MSG_GOT_KEY_ANTIKAOS); + break; + /* + case F_MOUSE: + angwalk = angleadd(angwalk,ANG180); + speed=0; + angspeed=0; + i++; + break; + */ + //case OBJT_OSSA: + case F_OSSALIT: + if (!GODMODE) { + if (GETFLAG(gameflags,GFL_NORANDOM)) + angwalk = angleadd(angwalk,ANG30); + else + angwalk = angleadd(angwalk,random(ANG30)<<1); + speed=(speed<<1)/3; + latspeed=(latspeed<<1)/3; + } + break; + case F_SLIMER+16: + case F_SPIDER+14: + case F_SOLDIER+30: + /* + case OBJT_SLIMER: + case OBJT_SPIDER: + case OBJT_SOLDIER: + */ + if (!GODMODE) { + upwalk=ABS(upwalk); + if (upwalk<8) upwalk+=2; + //if ((upwalk+=2)>8) upwalk=8; + } + i--; + break; + //case OBJT_BOMB: + case F_BOMB: + if (((Bomb *)object)->getownerid() == mover->id) { + i--; + break; + } + if (takeammo(ARM_BOMB,ARM_ADDBOMB)) { +#ifndef __SHAREWARE__ + SETFLAG(armflag,AFL_BOMB); +#endif + if (GETFLAG(object->oflags,OFL_ISACTOR)) + takeammo(ARM_BOMB,-ARM_ADDBOMB); + else { + eventmanager.sendshort(EV_UPDATEBAR,mover->id,0,IBR_ARMS,0); + playsound(SND_CHARGE,0,0,0,SYSOWN,SFL_FIXED); + animpal(PAA_ARM,0); + } + eventmanager.sendcom(EV_MESSAGE,MSG_GOT_BOMBA); + } else i--; + break; + } + if (i) { + eventmanager.senddirect(EV_GOT,mover->id,event.source,mover->angle,speed>>1); + //if (i==1) animpal(PAA_GOLD,0); + } + } + break; + case EV_SCODE: + switch (event.source) { + case SC_MNBGod: + //pflags = pflags ^ PFL_GOD; // toggles God mode + CHGFLAG(pflags,PFL_GOD); + if (GODMODE) { + animpal(PAA_GOD,0); + oldarms = armflag; + oldkeys = keys; +#ifndef __SHAREWARE__ + SETFLAG(armflag,AFL_PISTOLA|AFL_FUCILE|AFL_MITRA|AFL_BAZOOKA|AFL_BOMB); +#else + SETFLAG(armflag,AFL_PISTOLA|AFL_FUCILE|AFL_MITRA|AFL_BAZOOKA); +#endif + curarm = ARM_BAZOOKA; + SETFLAG(keys,LCKT_L1|LCKT_L2); + eventmanager.sendcom(EV_MESSAGE,MSG_GODMODE); + } else { + armflag = oldarms; + keys = oldkeys; + curarm = ARM_PISTOLA; + animpal(PAA_UNGOD,0); + } + eventmanager.sendshort(EV_UPDATEBAR,mover->id,0,IBR_ARMS|IBR_KEYS,0); + break; + case SC_MNNico: + health = 100+400; + eventmanager.sendshort(EV_UPDATEBAR,mover->id,0,IBR_HEALTH,0); + eventmanager.sendcom(EV_MESSAGE,MSG_INVINCIBLE); + break; + case SC_MNMaxy: +#ifndef __SHAREWARE__ + SETFLAG(armflag,AFL_PISTOLA|AFL_FUCILE|AFL_MITRA|AFL_BAZOOKA|AFL_BOMB); +#else + SETFLAG(armflag,AFL_PISTOLA|AFL_FUCILE|AFL_MITRA|AFL_BAZOOKA); +#endif + Armbull[ARM_PISTOLA-1] = ArmList[ARM_PISTOLA].max_ammo; + Armbull[ARM_FUCILE-1] = ArmList[ARM_FUCILE].max_ammo; + Armbull[ARM_MITRA-1] = ArmList[ARM_MITRA].max_ammo; + Armbull[ARM_BAZOOKA-1] = ArmList[ARM_BAZOOKA].max_ammo; + Armbull[ARM_BOMB-1] = ArmList[ARM_BOMB].max_ammo; + eventmanager.sendshort(EV_UPDATEBAR,mover->id,0,IBR_ARMS|IBR_SMILE,0); + break; + case SC_MNAndy: + SETFLAG(keys,LCKT_L1|LCKT_L2); + eventmanager.sendshort(EV_UPDATEBAR,mover->id,0,IBR_KEYS|IBR_SMILE,0); + break; + case SC_MNHard: + //if (!hardcount) animpal(PAA_HARD,0); + hardcount = 2160; + eventmanager.sendcom(EV_MESSAGE,MSG_HARDMODE); + break; + case SC_MNInvi: + mover->remove(); + CHGFLAG(mover->flags,OMF_HITABLE); + mover->place(); + if (GETFLAG(mover->flags,OMF_HITABLE)) + eventmanager.sendcom(EV_MESSAGE,MSG_HARDMODE); + break; + } + //eventmanager.sendshort(EV_UPDATEBAR,mover->id,0,IBR_SMILE,0); + break; + case EV_ADDSTAT: + updatestat(event.data.msg.x,event.data.msg.y); + break; + } +} + +void Player::makeboom(fixed x, fixed y, fixed z, int angle, int id, byte type) { + if (hardcount && curarm>0) { + eventmanager.sendpos(EV_BOOM,mover->id,x,y,40l); + delete mm_reserve(sizeof(FireBoom)); + objectslist.put(new FireBoom(x,y,z,angle,BOOM_MISSIL)); + quake=14; // 2 rullate + } else { + int btype = type, + fig; + if (id>=0) { + fig = objectslist.get(id)->figstart; + updatestat(STT_HIT,1); + if (fig>=F_PLAYER && fig<=F_MOUSE) { + btype = BOOM_BLOOD; + updatestat(STT_BLOOD,1); + } + } + if (btype!=BOOM_BLOOD || GETFLAG(gameflags,GFL_SHOWBLOOD)) { + delete mm_reserve(sizeof(FireBoom)); + objectslist.put(new FireBoom(x,y,z,angle,btype)); + if (btype==BOOM_BLOOD && fig0 && !Armbull[curarm-1]) return 0; + if (!CanFireActor::fire(angle)) return 0; + if (GODMODE && curarm) Armbull[curarm-1]++; + if (curarm) + eventmanager.sendshort(EV_UPDATEBAR,mover->id,0,IBR_ARMS,0); + + //armcharge = ArmList[curarm].charge; + switch (curarm) { + case ARM_ASCIA: break; + case ARM_PISTOLA: + updatestat(STT_FIRE,1); + play3Dsound(mover->x,mover->y,SND_PISTOLA,SM_NORMVOL,mover->id,SFL_NORMAL); + cx=mover->x; cy=mover->y; + alt = hwalk; + // vangle & hwalk !!!! + id = fireray(cx,cy,angle,vangle,dist,alt,mover->id); + if (id>-2) makeboom(cx,cy,alt,angle,id,BOOM_PALLOT); + if (id>=0) + eventmanager.senddirect(EV_HIT,mover->id,id, + angle,ArmList[ARM_PISTOLA].power); + // suono anonimo !!! + //play3Dsound(cx,cy,SND_PROIETTILE,20,20,SYSOWN,SFL_BASIC); + break; + case ARM_FUCILE: + updatestat(STT_FIRE,3); + play3Dsound(mover->x,mover->y,SND_FUCILE,SM_NORMVOL,mover->id,SFL_NORMAL); + cx=mover->x; cy=mover->y; + alt = hwalk; // !!!! + id = fireray(cx,cy,anglesub(angle,ANGLVL<<1),vangle,dist,alt,mover->id); + if (id>-2) makeboom(cx,cy,alt,angle,id,BOOM_PALLOT); + if (id>=0) + eventmanager.senddirect(EV_HIT,mover->id,id, + angle,ArmList[ARM_FUCILE].power); + cx=mover->x; cy=mover->y; + alt = hwalk; + id = fireray(cx,cy,angle,vangle,dist,alt,mover->id); + if (id>-2) { + makeboom(cx,cy,alt,angle,id,BOOM_PALLOT); + makeboom(cx,cy,alt+lshr6(dist),angle,id,BOOM_PALLOT); + makeboom(cx,cy,alt-lshr6(dist),angle,id,BOOM_PALLOT); + } + if (id>=0) + eventmanager.senddirect(EV_HIT,mover->id,id, + angle,ArmList[ARM_FUCILE].power); + // suono anonimo !!! + //play3Dsound(cx,cy,SND_PROIETTILE,28,28,SYSOWN,SFL_BASIC); + cx=mover->x; cy=mover->y; + alt = hwalk; + id = fireray(cx,cy,angleadd(angle,ANGLVL<<1),vangle,dist,alt,mover->id); + if (id>-2) makeboom(cx,cy,alt,angle,id,BOOM_PALLOT); + if (id>=0) + eventmanager.senddirect(EV_HIT,mover->id,id, + angle,ArmList[ARM_FUCILE].power); + if ((speed-=24)<-32) speed=-32; + break; + case ARM_MITRA: + updatestat(STT_FIRE,1); + play3Dsound(mover->x,mover->y,SND_MITRA,SM_NORMVOL,mover->id,SFL_NORMAL); + cx=mover->x; cy=mover->y; + alt = hwalk; + int ang = angle; + if (!GETFLAG(gameflags,GFL_NORANDOM)) + ang += (ANGLVL<<2)-random((ANGLVL<<3)+1); + if (ang<0) ang+=ANG360; else + if (ang>=ANG360) ang-=ANG360; + id = fireray(cx,cy,ang,vangle,dist,alt,mover->id); + // suono anonimo !!! + //play3Dsound(cx,cy,SND_PROIETTILE,24,24,SYSOWN,SFL_BASIC); + if (id>-2) makeboom(cx,cy,alt,angle,id,BOOM_PALLOT); + if (id>=0) + eventmanager.senddirect(EV_HIT,mover->id,id, + angle,ArmList[ARM_MITRA].power); + break; + case ARM_BAZOOKA: + //case ARM_FIREBALL: + updatestat(STT_FIRE,1); + cx=mover->x; cy=mover->y; + alt = hwalk; + fireray(cx,cy,angle,vangle,dist,alt,mover->id); + cx = costab[angle]; cy = sintab[angle]; + delete mm_reserve(sizeof(Fireball)); + object = new Fireball(mover->x+(cx<<4)/*+(-cy<<3)*/, + mover->y+(cy<<4)/*+(cx<<3)*/, + angle,/*vangle,*/F_MISSILE, + mover->z-(8l<id); + play3Dsound(mover->x,mover->y,SND_MISSILE,0,mover->id,SFL_NORMAL); + //object->changefig(F_MISSILE,8); + objectslist.put(object); + if ((speed-=16)<-16) speed=-16; + break; + case ARM_BOMB: + updatestat(STT_FIRE,1); + cx = costab[angle]; cy = sintab[angle]; + play3Dsound(mover->x,mover->y,SND_SLIMATT,0,mover->id,SFL_NORMAL); + delete mm_reserve(sizeof(Bomb)); + objectslist.put(new Bomb(mover->x+(cx<<4)/*+(-cy<<3)*/, + mover->y+(cy<<4)/*+(cx<<3)*/, + mover->z-(8l<id)); + break; + } + return 1; +} + +void Player::getdata(TPlayerData &data) { + //data.score = score; + data.health = health; + data.curarm = curarm; + data.keys = keys; + data.armflag = armflag; + fwmove(data.armbull,Armbull,sizeof(Armbull)); +} + +void Player::updatestat(int type, int num) { + switch(type) { + case STT_FIRE: fires+=num; break; + case STT_HIT: hits+=num; break; + case STT_BLOOD: blood+=num; break; + case STT_KILL: kills+=num; break; + case STT_TECNO: tecno+=num; break; + } +} + +void Player::getstats(long &_fires,long &_hits,long &_blood, + long &_tecno,int &_kills) { + _fires = fires; + _hits = hits; + _blood = blood; + _kills = kills; + _tecno = tecno; +} + +Player::~Player() { + //if (comtype == COM_SAVE) savepack(0x8000); +} \ No newline at end of file diff --git a/KaosSrc/setfirm.cpp b/KaosSrc/setfirm.cpp new file mode 100644 index 0000000..38278a5 --- /dev/null +++ b/KaosSrc/setfirm.cpp @@ -0,0 +1,126 @@ +/************************************************************************ + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + ************************************************************************/ + +#include "std.hpp" +#include "errorstr.hpp" +#include "xms.hpp" +#include "fastmem.hpp" +#include "mm4.hpp" +#include "crcio.hpp" +#include +#include +#include + +long far *ddf = NULL; +int ddfnum = 0; + +#define LEVSIZE 16410 +void far *ptr = new char[LEVSIZE]; + +void showhelp() { + printf("formato: SETFIRM