; THICKCHARS 1.00 ; =============== ; May 1986, Graham Harston ; Make a thicker Spectrum character set ; Based on original Charmaker ; Puts character set underneath RAMTOP ; use: LOAD "ThickChars"CODE:RANDOMISE USR 23296 ; or *ThickChars on JGHROM CHARS EQU #5C36 STKEND EQU #5C65 RAMTOP EQU #5CB2 ERRSP EQU #5C3D ORG #5B00 ; Load to transient command space START LD HL,(CHARS) ; Get pointer to font LD A,H INC H ; Point to ' ' character CP #40 ; Is font already in RAM? JR NC,SETFONT ; Jump to update font in RAM LD HL,(STKEND) ; Top of BASIC data LD DE,1024 ; Check for 768 + 256 bytes ADD HL,DE JR C,OUTMEM ; >#FFFF, not enough free memory SBC HL,SP ; Find space JR C,COPYSTK ; Enough free space, continue OUTMEM RST #08 ; Generate an error DEFB #03 ; Out of memory COPYSTK LD BC,#FD00 ; We want to claim 768 bytes above the stack LD HL,0 ADD HL,SP ; HL=old stack bottom EX DE,HL ; DE=old stack bottom PUSH BC POP HL ; HL=-768 ADD HL,SP ; HL=new stack bottom LD SP,HL ; Move SP to new position PUSH BC ; Save -768 for later PUSH HL ; Save new SP for later LD HL,(RAMTOP) ; Get top of stack AND A SBC HL,DE ; HL=stack length PUSH HL POP BC ; BC=stack length POP HL EX DE,HL ; DE=newSP, HL=oldSP LDIR ; Copy stack to new position POP BC ; Get -768 back LD HL,(ERRSP) ADD HL,BC LD (ERRSP),HL ; Drop ERRSP down 768 bytes LD HL,(RAMTOP) ADD HL,BC LD (RAMTOP),HL ; Drop RAMTOP down 768 bytes ; Drop through with HL=space above stack for new font ; Copy modified font to RAM at HL ; ------------------------------- SETFONT EX DE,HL ; DE=start of new font PUSH DE LD HL,#3D00 ; Start of the character set in ROM LD B,3 ; Loop round for 3 sets of 256 LOOP1 LD C,0 ; Loop round 226 times LOOP2 LD A,(HL) ; Get the byte from the ROM ADD A,A ; Shift A along one bit to the left OR (HL) ; Superimpose with the original value LD (DE),A ; and store in RAM INC HL ; Increment the address pointers INC DE DEC C ; Decrement the first counter JR NZ,LOOP2 ; Loop back if it's not zero DJNZ LOOP1 ; Decrement the second counter and loop back POP DE ; Get the start of the character set back DEC D ; Decrease by 256 to point to CHR$0 LD (CHARS),DE ; Point CHARS to new font RET ; and return.