Log inRegister an accountBrowse CSDbHelp & documentationFacts & StatisticsThe forumsAvailable RSS-feeds on CSDbSupport CSDb Commodore 64 Scene Database
You are not logged in - nap
CSDb User Forums


Forums > C64 Coding > Generate better looking chars from ROM
2018-03-15 23:03
jamiefuller
Account closed

Registered: Mar 2018
Posts: 25
Generate better looking chars from ROM

Hi All,

I'm trying to create a font using the smallest amount of ram possible, It doesn't have to be the best font in the world but just something that looks at least a little different from the standard font.

This is the best I have come up with so far (71 bytes), it copies the font from ROM and "translates" parts of the font to make it look slightly different.



*=$0900
main
        inc $DC0E
        lda $01
        and #$fb
        sta $01

        ldy #$01
@lp1    ldx #$00
@lp2    lda $d000,x
        cmp #$76
        bne *+4
        lda #$7A
        cmp #$60
        bne *+4
        lda #$70
        cmp #$66
        bne *+4
        lda #$72
        cmp #$6C
        bne *+4
        lda #$74
        cmp #$6e
        bne *+4
        lda #$76
@lp3    sta $3000,x
        inx
        bne @lp2
        inc @lp2+2
        inc @lp3+2
        dey
        bpl @lp1

        lda $01
        ora #$04
        sta $01
        dec $DC0E

        rts


Any suggestions for improving/reducing size?
2018-03-16 01:13
Oswald

Registered: Apr 2002
Posts: 5017
lda $d000,x
cmp #$40
bcc +
ora #$10
+ sta $3000,x
2018-03-16 01:42
Cruzer

Registered: Dec 2001
Posts: 1048
Looks a bit like, but better than the one I used in the end part of Incoherent Nightmare



The code was also much simpler. This fetched one char from ROM to a sprite:
	ldx #$07
!:	
load:	lda $d008,x
	sta tmp
	asl
	and #$f0
	ora tmp
	sta (txtDestPnt),y
	dey
	dey
	dey
	dex
	bpl !-
2018-03-16 10:18
Repose

Registered: Oct 2010
Posts: 222
Funny, I was just thinking about this! I want to morph the ROM into a half-sized charset. I wonder if I could just pick 3 columns from it...
2018-03-16 10:24
jamiefuller
Account closed

Registered: Mar 2018
Posts: 25
Thank you Micropenis and Cruzer!

those are both great methods.

Both of the suggested methods are 24 bytes smaller than my original code.

I've tried all 3 and generated an example below of the font created, would love to hear a vote on peoples favourite? Top, Middle or bottom?

2018-03-16 10:26
Tao

Registered: Aug 2002
Posts: 115
Some of my TRIAD-intros (such as TRIAD "Tao intro 1") use a modified version of the ROM-font.
2018-03-16 11:20
Freddie

Registered: Jan 2004
Posts: 71
Quote: Thank you Micropenis and Cruzer!

those are both great methods.

Both of the suggested methods are 24 bytes smaller than my original code.

I've tried all 3 and generated an example below of the font created, would love to hear a vote on peoples favourite? Top, Middle or bottom?



I vote for number 3, looks really good.
2018-03-16 11:59
jamiefuller
Account closed

Registered: Mar 2018
Posts: 25
I've made a small tweak to my code and have come up with this, using the smaller two generation routines even after re-writing and adding my tweak its still smaller than my original code (by 5 bytes)

2018-03-16 12:58
lft

Registered: Jul 2007
Posts: 369
Of the three examples in post #5, the top one is my favourite. Compare the M's in "COMMODORE" for instance.

Anyway, this should totally be a compo.
2018-03-16 17:43
Compyx

Registered: Jan 2005
Posts: 631
Too bad about the 'small size' requirement. I'd just pixel a charset and then write a script generating "LDA $Dxxx: EOR #$xx: STA $2xxx" for every byte in the charset that's different.

Could even optimize it a bit, using multiple STA's for the same value.

Worst case scenario is 8 bytes of code for each byte of charset, plus 1 for RTS.
2018-03-16 18:10
spider-j

Registered: Oct 2004
Posts: 444
Compyx: that is indeed an interesting approach. Especially as the code generation could be automated with a crossdev tool.
 
... 10 posts hidden. Click here to view all posts....
 
Previous - 1 | 2 - Next
RefreshSubscribe to this thread:

You need to be logged in to post in the forum.

Search the forum:
Search   for   in  
All times are CET.
Search CSDb
Advanced
Users Online
icon/The Silents, Sp..
Apollyon/ALD
jeroen1328
Acidchild/Padua
Scooby/G★P/Light
daimansion
WVL/Xenon
Guests online: 128
Top Demos
1 Next Level  (9.8)
2 Mojo  (9.7)
3 Coma Light 13  (9.7)
4 Edge of Disgrace  (9.6)
5 Comaland 100%  (9.6)
6 No Bounds  (9.6)
7 Uncensored  (9.6)
8 The Ghost  (9.6)
9 Wonderland XIV  (9.6)
10 Bromance  (9.6)
Top onefile Demos
1 It's More Fun to Com..  (9.8)
2 Party Elk 2  (9.7)
3 Cubic Dream  (9.6)
4 Copper Booze  (9.5)
5 Rainbow Connection  (9.5)
6 TRSAC, Gabber & Pebe..  (9.5)
7 Onscreen 5k  (9.5)
8 Wafer Demo  (9.5)
9 Dawnfall V1.1  (9.5)
10 Quadrants  (9.5)
Top Groups
1 Oxyron  (9.3)
2 Nostalgia  (9.3)
3 Booze Design  (9.3)
4 Censor Design  (9.3)
5 Crest  (9.3)
Top Fullscreen Graphicians
1 Carrion  (9.8)
2 Joe  (9.8)
3 Duce  (9.8)
4 Mirage  (9.7)
5 Facet  (9.7)

Home - Disclaimer
Copyright © No Name 2001-2024
Page generated in: 0.043 sec.