This commit is contained in:
Martin Haye 2016-01-18 13:11:51 -08:00
commit 1c3c7c6f8a
10 changed files with 134 additions and 24 deletions

View File

@ -18,5 +18,5 @@ Features:
Tools used: Tools used:
64tass compiler 64tass compiler
GangEd for tiles (data saved separately as videomem, colormem and bitmap) and fonts GangEd and Pixcen used for tiles (data saved separately as videomem, colormem and bitmap), bitmap part for fonts saved under fonts.map filename
SpritePad for sprites SpritePad for sprites

Binary file not shown.

View File

@ -51,6 +51,10 @@ mapOffsetPointer_HI = $34
playerPosition_LO = $35 playerPosition_LO = $35
playerPosition_HI = $36 playerPosition_HI = $36
outputCursor = $37
wordCursor = $38
ignoreNextCharacterFlag = $39
BANK_START_ADDR=$4000 ;$4000 - $7FFF BANK_START_ADDR=$4000 ;$4000 - $7FFF
SCREEN=$6000 ;Bitmap range: $6000 - $7F3F SCREEN=$6000 ;Bitmap range: $6000 - $7F3F
SCREEN_VIDEO_RAM=$5C00 ;Screen Video RAM range: $5C00 - $5FFF SCREEN_VIDEO_RAM=$5C00 ;Screen Video RAM range: $5C00 - $5FFF
@ -283,7 +287,8 @@ jmp *
.binary "binary/colormem.PRG",2,64*4 .binary "binary/colormem.PRG",2,64*4
*=FONTS *=FONTS
.binary "binary/fonts.PRG",2,8*26+8*26+8*3 .binary "binary/fonts.map",0,8*8*130
*=MAP_DATA *=MAP_DATA
;.binary "binary/map.bin" ;TODO: As we have no map file yet, let's use fake map for test purposes ;.binary "binary/map.bin" ;TODO: As we have no map file yet, let's use fake map for test purposes
@ -296,3 +301,4 @@ Raster_Indicator
.byte 0 .byte 0
Raster_Indicator_Key_Pressed Raster_Indicator_Key_Pressed
.byte 0 .byte 0
.byte $FF

View File

@ -44,12 +44,10 @@ TEXT_POINTERS ;(LO/HI)
TEXTS TEXTS
text1 text1
.byte 26, 54, 18, 20, 1, 19, 11, 4, 54, 1, 17, 4, 4, 25, 4, 54 .binary "../texts/text01.asm"
.byte 18, 19, 8, 17, 18, 54, 3, 20, 18, 19, 54, 54, 54, 54, 54, 54
.byte 0, 2, 17, 14, 18, 18, 54, 19, 7, 4, 54, 3, 17, 24, 54, 54
.byte 3, 4, 18, 4, 17, 19, 54, 5, 11, 14, 14, 17, 52
.byte $FF .byte $FF
text2 text2
.byte 26, 54, 2, 7, 4, 18, 19, 52 .binary "../texts/text02.asm"
.byte $FF .byte $FF

View File

@ -1,21 +1,100 @@
drawText drawText
stx textPointer+1 stx textPointer+1
sty textPointer+2 sty textPointer+2
stx preTextPointer+1
sty preTextPointer+2
lda #$FF lda #$FF
sta textCursor sta textCursor
sta outputCursor
drawTextLoop ldx #0 ;x is for pre-drawing calculation if each word will fit in currently drawn line
stx ignoreNextCharacterFlag
;Check if the next word fits in current line
preDrawTextInit
stx wordCursor
preDrawTextLoop
ldy textCursor
preDrawTextLoop2
iny
inx
jsr preTextPointer
cmp #$FF
bne +
jmp drawWord
+
cmp #$20
bne +
jmp drawWord
+
cmp #13 ;ignore this character as this is the part of breakline: chr(13) and chr(10)
bne +
dex
jmp preDrawTextLoop2
+
cmp #10
bne +
ldx #0
jmp drawWord
+
cpx #16
bcc ++ ;skip if word fits in line
ldx #0
stx wordCursor
;Check if next character is the space character so we don't need then to break the line
iny
jsr preTextPointer
cmp #$20
beq +
jsr breakLine
jmp drawWord
+
inc ignoreNextCharacterFlag
jmp drawWord
+
jmp preDrawTextLoop2
drawWord
ldx wordCursor
drawWordLoop
inc outputCursor
drawWordLoop2
inc textCursor inc textCursor
inx
ldy textCursor ldy textCursor
textPointer textPointer
lda $1234,y lda $1234,y
cmp #$FF cmp #$FF ;end of text
beq drawTextDone beq drawTextDone
cmp #13 ;ignore this character as this is the part of breakline: chr(13) and chr(10)
bne +
jmp drawWordLoop2
+
cmp #10 ;next line
bne +
jsr eatNextCharacter
ldx #0
jsr breakLine
jmp preDrawTextInit
+
cmp #$20
bne +
jsr eatNextCharacter
jmp preDrawTextInit
+
sta letter+1 sta letter+1
ldy textCursor ldy outputCursor
lda textPortTable_LO,y lda textPortTable_LO,y
sta textPortPointer+1 sta textPortPointer+1
@ -49,11 +128,35 @@ textPortPointer
sta $1234,y sta $1234,y
dey dey
bne - bne -
jmp drawWordLoop
jmp drawTextLoop preTextPointer
lda $1234,y
drawTextDone
rts rts
breakLine
clc
lda outputCursor
lsr
lsr
lsr
lsr
asl
asl
asl
asl
adc #15
sta outputCursor
rts
eatNextCharacter
lda ignoreNextCharacterFlag
beq +
dec outputCursor
dec ignoreNextCharacterFlag
+
rts
drawTextDone
rts

View File

@ -2,7 +2,7 @@
searchText searchText
;Clear old text ;Clear old text
ldy #15 ldy #16
lda #0 lda #0
- -
.for step=0, step<=15, step=step+1 .for step=0, step<=15, step=step+1

View File

@ -1,36 +1,36 @@
fontsTable_LO fontsTable_LO
.for l=0, l<=60, l=l+1 .for l=0, l<=130, l=l+1
.byte <FONTS+l*8-1 .byte <FONTS+l*8-1
.next .next
fontsTable_HI fontsTable_HI
.for l=0, l<=60, l=l+1 .for l=0, l<=130, l=l+1
.byte >FONTS+l*8-1 .byte >FONTS+l*8-1
.next .next
textPortTable_LO textPortTable_LO
.for step=0, step<=13, step=step+1 .for step=0, step<=15, step=step+1
.for l=0, l<=15, l=l+1 .for l=0, l<=15, l=l+1
.byte <TEXTPORT_BITMAP_OFFSET+SCREEN-1+step*320+l*8 .byte <TEXTPORT_BITMAP_OFFSET+SCREEN-1+step*320+l*8
.next .next
.next .next
textPortTable_HI textPortTable_HI
.for step=0, step<=13, step=step+1 .for step=0, step<=15, step=step+1
.for l=0, l<=15, l=l+1 .for l=0, l<=15, l=l+1
.byte >TEXTPORT_BITMAP_OFFSET+SCREEN-1+step*320+l*8 .byte >TEXTPORT_BITMAP_OFFSET+SCREEN-1+step*320+l*8
.next .next
.next .next
textPortColorTable_LO textPortColorTable_LO
.for step=0, step<=13, step=step+1 .for step=0, step<=15, step=step+1
.for l=0, l<=15, l=l+1 .for l=0, l<=15, l=l+1
.byte <TEXTPORT_SCREEN_OFFSET+SCREEN_COLOR_RAM+step*40+l .byte <TEXTPORT_SCREEN_OFFSET+SCREEN_COLOR_RAM+step*40+l
.next .next
.next .next
textPortColorTable_HI textPortColorTable_HI
.for step=0, step<=13, step=step+1 .for step=0, step<=15, step=step+1
.for l=0, l<=15, l=l+1 .for l=0, l<=15, l=l+1
.byte >TEXTPORT_SCREEN_OFFSET+SCREEN_COLOR_RAM+step*40+l .byte >TEXTPORT_SCREEN_OFFSET+SCREEN_COLOR_RAM+step*40+l
.next .next

View File

@ -0,0 +1,2 @@
A subtle breeze stirs dust across the dry desert floor.
You stand at the end of the long trail from Fresno California to the Sierra Nevada Mountains.

View File

@ -0,0 +1 @@
The wooden bridge rattles from the rush of water just below.