Charmaker - Character set generator The character set in the Spectrum looks a bit thin and unreadable, so I wrote this machine code program to create a BBC-like character set. The routine is loaded into memory at 768 bytes further on than where the character set will eventually be. The routine is then called at the start address. An example would be as follows: CLEAR 64511 LOAD *"M";1;"Charmaker" CODE 65280 PRINT USR 65280 This would create the character set starting at 64512 and set CHARS pointing to it. Program explanation ------------------- +--+--+--+--+--+--+--+--+ For each byte, the value is shifted | | | | | | | | | along to the left, then superimposed +--+--+--+--+--+--+--+--+ with the original value. This makes | |**|##|##|##|##| | | all uprights one pixel wider, making +--+--+--+--+--+--+--+--+ the overall character thicker. |**|##| | | |**|##| | +--+--+--+--+--+--+--+--+ |**|##| | | |**|##| | +--+--+--+--+--+--+--+--+ |**|##|##|##|##|##|##| | +--+--+--+--+--+--+--+--+ |**|##| | | |**|##| | +--+--+--+--+--+--+--+--+ |**|##| | | |**|##| | +--+--+--+--+--+--+--+--+ | | | | | | | | | +--+--+--+--+--+--+--+--+ ; CHARMAKER ORG #FF00 ; Any address, code is position independent START PUSH BC ; Get start address from the BC register and POP DE ; decrease it by 768 to get the start of the DEC D ; character set DEC D DEC D PUSH DE LD HL,15616 ; 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 LOOP LD A,(HL) ; Get the byte from the ROM PUSH BC ; Save the counters LD B,A ; Put the byte in B ADD A,A ; Shift A along one bit to the left OR B ; Superimpose the original value LD (DE),A ; and store in the RAM POP BC ; Get the counters back INC HL ; Increment the address pointers INC DE DEC C ; Decrement the first counter JR NZ,LOOP ; 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 get the right value LD (IY-3),D ; Store the high byte LD (IY-4),E ; then the low byte in CHARS RET ; and return.