Galactic Conquest: GCFONT.PAS (drop in LoadFont replacement) (Announce)
> As I was also feeling nice this morning. This is a "drop in" unit which I
> would suggest you keep separate which you can use to as a direct
> replacement for your existing LoadFont procedure in GCUNIT.PAS. What you
> need to do is delete your existing LoadFont procedure from GCUNIT
> (remembering to remove the LoadFont reference from implementation as well)
> then simply add "GCFONT" to your uses section of GCUNIT.PAS, GCTITLE.PAS,
> GCINIT.PAS, GALCON.PAS:
>
> > Unit GCfont;
> {Freeware - please re-use as appropriate}
> {Provided by Richard L. James for Galcon}
>
> {VERSION 1.0.0 -- RELEASE DATE: 25 June 2010}
> {PROGRAM LAST REVISED ON: 25 June 2010/0900}
> {PROGRAM LENGTH AS OF LAST REVISION: 72}
>
> {-------------------------------------------------------------------------}
>
> INTERFACE
>
> Procedure LoadFont(DummyFilename:string); {DummyFilename for old proc
> refs}
>
> {-------------------------------------------------------------------------}
>
> IMPLEMENTATION
>
> {-------------------------------------------------------------------------}
>
> {$L intvfont.obj}
> procedure intvfont; external; {fool TP as $L is supposed to be for code
> only}
>
> {-------------------------------------------------------------------------}
>
> Procedure LoadFont(DummyFilename:string);
>
> Begin
> Asm
> push bp {Save BP as Turbo Pascal requires us to preserve
> it}
> mov ax, 0500h {AH = 05h Set active display page / AL = page
> number}
> int 10h {function 1110h below requires page 0 to be
> active}
> mov ax, seg intvfont {function 1110h expects ES:BP -> user font table}
> mov es, ax {Set ES to point to the segment of our font data}
> mov ax, offset intvfont+$63 {Add 63h to skip over the INTVFONT
> header}
> mov bp, ax {Set BP to point to the offset of our font data}
> mov cx, 100h {256d} {CX = Number of patters we wish to load}
> xor dx, dx {0d} {DX = character offset into map 2 block}
> xor bl, bl {0d} {BL = block to load in map 2}
> mov bh, 10h {16d} {BH = number of bytes per character pattern}
> mov ax, 1110h {text chargen
> http://www.ctyme.com/intr/rb-0142.htm}
> int 10h {Load user-specified patterns (PS,EGA,VGA)}
> pop bp {Restore BP}
> End;
> End;
>
> {-------------------------------------------------------------------------}
> Begin
> {LoadFont('');} {uncomment this line if required-do NOT place after
> below}
>
> {Important - the following 2 lines should be the LAST lines of this
> UNIT}
> { do not remove them as this will STOP TP linking in our
> font}
> { or worse in the case of exit will attempt to "execute"
> data}
> Exit; {Exit to ensure TP never executes the line below}
> intvfont; {the following line MUST never be called
> directly}
> End.
> {-------------------------------------------------------------------------}
>
>
Works like a charm! I appreciate the use of this code. Question... is there any way to modify this to pass the object name as a parameter (maybe via dummyfilename?). I'm toying around with the idea of loading multiple fonts within the game (ie: font switching/animation). I can make multiple procedures in the unit (one for each font), but wondered if there were a simpler way to just pass in the name of the obj (and .obj file...would be identical).
> Running aPACK on the the above GALCON.EXE reduces it to just 30,811 bytes:
> > This copy of aPACK is freeware.
> Packing code -> 30811 bytes
> Done ... compression ratio: 53% (65360 bytes -> 31088 bytes)
>
aPACK isn't working on my system, as I have a 64-bit OS. I'll try to dig up a 32-bit one to see if it works on that.
Other updates --
I'm hoping to have this done within a week or so, as I'm headed north with our newborn to introduce him to my family (2 months old already!) I'm hoping to take the final version 9 of this game to give to my brother as a gift to him. My time has practically disappeared though, so I may just fix a couple really small things in the game and call version 9 done.
Updated link for downloading the game (we had to change our website name):
http://www.godhasanswers.com/main/media/gc/
I will post updates to that directory.
I've looked into the "copyright" stuff. Per the latest GPL (under "copyleft" requirements), my code has to specify a copyright date. I've modified the copyright symbol to be a reverse C in a circle (for copyleft) but everything else already fits within the guidelines of GPL. I've also updated the GPL comments in the code and updated the GPL text file included with the game.
I've confirmed the code I've borrowed and modified from other authors has been used within their guidelines, and credit given in both code and game.
I'm working on revamping the player creation page.
I'm working on updating the text file to remove weird characters.
I'm working on updating the game's documentation to include updates to the game.
I've decided not to worry about adding in-game help for now.
I'm looking into using different keyboard handling, but I may simply use the Ctrl-Break code I have for popping up a window to quit the game (including during all-CPU wars).
Complete thread:
- Galactic Conquest v9 beta 55 - sinclaj1, 29.12.2009, 20:53 (Announce)
![Open in board view [Board]](img/board_d.gif)
![Open in mix view [Mix]](img/mix_d.gif)
- Galactic Conquest v9 beta 55 - Rugxulo, 29.12.2009, 22:05
- Galactic Conquest v9 beta 55 - Deniska, 07.01.2010, 00:53
- Galactic Conquest v9 beta 55 - sinclaj1, 07.01.2010, 05:46
- Galactic Conquest v9 beta 55 - sinclaj1, 08.05.2010, 04:21
- Galactic Conquest v9 beta 55 - Arjay, 08.05.2010, 15:07
- Galactic Conquest v9 beta 55 - rr, 08.05.2010, 21:06
- Galactic Conquest v9 beta 55 - additional feedback - Arjay, 09.05.2010, 21:26
- Galactic Conquest v9 beta 55 - additional feedback - sinclaj1, 13.05.2010, 05:58
- Galactic Conquest v9 beta 55 - additional feedback - Arjay, 19.05.2010, 17:27
- Galactic Conquest v9 beta 55 - additional feedback - sinclaj1, 24.06.2010, 16:01
- Congratulations / Galactic Conquest v9 beta 55 - Arjay, 25.06.2010, 03:37
- Galactic Conquest: GCFONT.PAS (drop in LoadFont replacement) - Arjay, 25.06.2010, 10:16
- Galactic Conquest: GCFONT.PAS (drop in LoadFont replacement) - Arjay, 25.06.2010, 12:20
- Galactic Conquest: GCFONT.PAS (drop in LoadFont replacement) - sinclaj1, 26.10.2010, 05:56
- Galactic Conquest: GCFONT.PAS (drop in LoadFont replacement) - Arjay, 26.10.2010, 11:57
- Galactic Conquest: GCFONT.PAS (drop in LoadFont replacement) - sinclaj1, 26.10.2010, 13:59
- Galactic Conquest: GCFONT.PAS (drop in LoadFont replacement) - rr, 26.10.2010, 21:13
- Galactic Conquest: GCFONT.PAS (drop in LoadFont replacement) - sinclaj1, 26.10.2010, 13:59
- Galactic Conquest: GCFONT.PAS (drop in LoadFont replacement) - rr, 26.10.2010, 21:07
- Galactic Conquest: GCFONT.PAS (drop in LoadFont replacement) - Rugxulo, 27.10.2010, 23:43
- Galactic Conquest: GCFONT.PAS (drop in LoadFont replacement) - Arjay, 26.10.2010, 11:57
- Congratulations / Galactic Conquest v9 beta 55 - Rugxulo, 26.06.2010, 14:59
- Galactic Conquest v9 file compression / UPX vs aPACK - Arjay, 27.06.2010, 00:11
- Galactic Conquest v9 file compression / UPX vs aPACK - Rugxulo, 27.06.2010, 08:10
- TP5_2COM - an example of how to generate a COM file from TP5 - Arjay, 27.06.2010, 13:30
- Galactic Conquest v9 file compression / UPX vs aPACK - Arjay, 27.06.2010, 14:00
- Galactic Conquest v9 file compression / UPX vs aPACK - Rugxulo, 28.06.2010, 06:45
- early Turbo Pascal quirks - Rugxulo, 28.06.2010, 07:02
- Galactic Conquest v9 file compression / UPX vs aPACK - Rugxulo, 28.06.2010, 06:45
- Galactic Conquest v9 file compression / UPX vs aPACK - Rugxulo, 27.06.2010, 08:10
- Galactic Conquest v9 file compression / UPX vs aPACK - Arjay, 27.06.2010, 00:11
- Galactic Conquest: GCFONT.PAS (drop in LoadFont replacement) - Arjay, 25.06.2010, 10:16
- Congratulations / Galactic Conquest v9 beta 55 - Arjay, 25.06.2010, 03:37
- Galactic Conquest v9 beta 55 - additional feedback - sinclaj1, 24.06.2010, 16:01
- Galactic Conquest v9 beta 55 - additional feedback - Arjay, 19.05.2010, 17:27
- Galactic Conquest v9 beta 55 - additional feedback - sinclaj1, 13.05.2010, 05:58
Mix view