mirror of
https://github.com/badvision/lawless-legends.git
synced 2025-01-23 05:29:50 +00:00
Merge branch 'master' of https://github.com/badvision/lawless-legends
This commit is contained in:
commit
1c3c7c6f8a
@ -18,5 +18,5 @@ Features:
|
||||
|
||||
Tools used:
|
||||
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
|
||||
|
BIN
Platform/C64/demos/2d-demo-2016-01-14.prg
Normal file
BIN
Platform/C64/demos/2d-demo-2016-01-14.prg
Normal file
Binary file not shown.
@ -51,6 +51,10 @@ mapOffsetPointer_HI = $34
|
||||
playerPosition_LO = $35
|
||||
playerPosition_HI = $36
|
||||
|
||||
outputCursor = $37
|
||||
wordCursor = $38
|
||||
ignoreNextCharacterFlag = $39
|
||||
|
||||
BANK_START_ADDR=$4000 ;$4000 - $7FFF
|
||||
SCREEN=$6000 ;Bitmap range: $6000 - $7F3F
|
||||
SCREEN_VIDEO_RAM=$5C00 ;Screen Video RAM range: $5C00 - $5FFF
|
||||
@ -283,7 +287,8 @@ jmp *
|
||||
.binary "binary/colormem.PRG",2,64*4
|
||||
|
||||
*=FONTS
|
||||
.binary "binary/fonts.PRG",2,8*26+8*26+8*3
|
||||
.binary "binary/fonts.map",0,8*8*130
|
||||
|
||||
|
||||
*=MAP_DATA
|
||||
;.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
|
||||
Raster_Indicator_Key_Pressed
|
||||
.byte 0
|
||||
.byte $FF
|
Binary file not shown.
@ -44,12 +44,10 @@ TEXT_POINTERS ;(LO/HI)
|
||||
|
||||
TEXTS
|
||||
text1
|
||||
.byte 26, 54, 18, 20, 1, 19, 11, 4, 54, 1, 17, 4, 4, 25, 4, 54
|
||||
.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
|
||||
.binary "../texts/text01.asm"
|
||||
.byte $FF
|
||||
|
||||
text2
|
||||
.byte 26, 54, 2, 7, 4, 18, 19, 52
|
||||
.binary "../texts/text02.asm"
|
||||
.byte $FF
|
||||
|
||||
|
@ -1,21 +1,100 @@
|
||||
drawText
|
||||
|
||||
stx textPointer+1
|
||||
sty textPointer+2
|
||||
stx preTextPointer+1
|
||||
sty preTextPointer+2
|
||||
|
||||
lda #$FF
|
||||
sta textCursor
|
||||
sta outputCursor
|
||||
|
||||
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
|
||||
|
||||
drawTextLoop
|
||||
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
|
||||
inx
|
||||
ldy textCursor
|
||||
textPointer
|
||||
lda $1234,y
|
||||
cmp #$FF
|
||||
cmp #$FF ;end of text
|
||||
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
|
||||
|
||||
ldy textCursor
|
||||
ldy outputCursor
|
||||
|
||||
lda textPortTable_LO,y
|
||||
sta textPortPointer+1
|
||||
@ -38,8 +117,8 @@ letter
|
||||
ldy #8
|
||||
-
|
||||
|
||||
;Switch colour on for this letter
|
||||
lda #1
|
||||
;Switch colour on for this letter
|
||||
lda #1
|
||||
textPortColor
|
||||
sta $1234
|
||||
|
||||
@ -49,11 +128,35 @@ textPortPointer
|
||||
sta $1234,y
|
||||
dey
|
||||
bne -
|
||||
jmp drawWordLoop
|
||||
|
||||
jmp drawTextLoop
|
||||
|
||||
drawTextDone
|
||||
|
||||
preTextPointer
|
||||
lda $1234,y
|
||||
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
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
searchText
|
||||
|
||||
;Clear old text
|
||||
ldy #15
|
||||
ldy #16
|
||||
lda #0
|
||||
-
|
||||
.for step=0, step<=15, step=step+1
|
||||
|
@ -1,36 +1,36 @@
|
||||
fontsTable_LO
|
||||
.for l=0, l<=60, l=l+1
|
||||
.for l=0, l<=130, l=l+1
|
||||
.byte <FONTS+l*8-1
|
||||
.next
|
||||
|
||||
fontsTable_HI
|
||||
.for l=0, l<=60, l=l+1
|
||||
.for l=0, l<=130, l=l+1
|
||||
.byte >FONTS+l*8-1
|
||||
.next
|
||||
|
||||
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
|
||||
.byte <TEXTPORT_BITMAP_OFFSET+SCREEN-1+step*320+l*8
|
||||
.next
|
||||
.next
|
||||
|
||||
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
|
||||
.byte >TEXTPORT_BITMAP_OFFSET+SCREEN-1+step*320+l*8
|
||||
.next
|
||||
.next
|
||||
|
||||
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
|
||||
.byte <TEXTPORT_SCREEN_OFFSET+SCREEN_COLOR_RAM+step*40+l
|
||||
.next
|
||||
.next
|
||||
|
||||
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
|
||||
.byte >TEXTPORT_SCREEN_OFFSET+SCREEN_COLOR_RAM+step*40+l
|
||||
.next
|
||||
|
2
Platform/C64/src/texts/text01.asm
Normal file
2
Platform/C64/src/texts/text01.asm
Normal 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.
|
1
Platform/C64/src/texts/text02.asm
Normal file
1
Platform/C64/src/texts/text02.asm
Normal file
@ -0,0 +1 @@
|
||||
The wooden bridge rattles from the rush of water just below.
|
Loading…
x
Reference in New Issue
Block a user