I sitched to an other part were we can talk code.FedePede04 wrote:Thanks, i love to see others code,
you can always learn something from it.
There are some interesting bits in the code I think. Let me give you a quick tour.
SET.C: this is the main file. Here is the game logic.
SET_DATA.C: this file is generated by SET.C When DEVELOPMENT is defined all data is loaded from their original files (PI3 files, FNT files etc.) . The data is converted into structures used in the game and then saved to this file by the function save_all_data().
SETSTLOW.C: Sets the resolution to ST low. Should work for ST, Ste, Mega STe, TT and Falcon.
PROPRINT.C: routine for printing proportional text in a given box. The text can be left, right, center or justified aligned. The part of the string that didn't fit in the box is returned.
MAKEFONT.C: used to generate a proportional font.
CRC_CODE.S: generated a 32 bit CRC code. Used in the save files.
KEYBOARD.S: keyboard and mouse driver.
LOADER_N.S and RELOCATE.S: the loader system. The compiled program is added to relocate.s to get a position independent file. This file is compressed with ARJBETA.TTP, the compressed data is extracted with UNARJPR.TTP and merged with loader_n.s which contains the depacker.
NYHRAND.S: the random generator. Linear congruential generator, x = (ax+c) mod m, m = 2^32, a = 1103515245, c = 12345
PPRNF.S: the actual print routines of PROPRINT.C
PRINT.S: a relic, the original non proportional print routines
SET_FAST.S: all assembly routines for the game. Most of it is graphics output like card drawing routines and menu drawing routines but also the timer interrupt routine for the score.
Hans Wessels