6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Sun Nov 24, 2024 8:06 pm

All times are UTC




Post new topic Reply to topic  [ 1 post ] 
Author Message
PostPosted: Sun Oct 08, 2006 4:24 pm 
Offline

Joined: Sat Jan 04, 2003 10:03 pm
Posts: 1706
. . . sort of.

See http://www.falvotech.com/tmp/screenshot.png for the current screenshot of the K2 emulator running.

I should point out that there is no actual Forth software running in ROM just yet -- I needed some text to print to the screen for testing purposes, and couldn't think of anything more impressive than the boot-up banner itself. :)

Code to print a single line of text is as follows:

Code:
.proc DrawMeSomeText
;
; Set the string pointer into the input pseudo-register #0
;
    lda #msg
    sta I0
    stz I0+2
;
; Set string length here
;
    lda #msgLength
    sta I1
;
; Set drawing coordinates
;
    stz leftEdge
    lda #5*80   ; 80 bytes per scanline
    sta topEdge
;
; Reset the font bitmap pointer, and render!
;
    jsr DisplayUseSystemFont
    jmp DisplayXorText
.endproc

.rodata

msg:
    .byte "Look ma, this is subscript!!"
msgLength = *-msg


Note that a string's horizontal coordinate is expressed in terms of characters, since this is easiest for the 65816 to handle. The vertical component, however, is expressed in pixels, since the hardware is fully capable of supporting it (as there is no text mode, it can draw text on any scanline in the framebuffer's bitmap).

As you can see from the screenshot, rendering double-height characters is easy too. Instead of calling DisplayXorText, just invoke DisplayXorTextDouble. Everything else is the same.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 64 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to: