mirror of
https://github.com/a2-4am/4cade.git
synced 2024-11-27 08:50:01 +00:00
simpler format for pages of text
This commit is contained in:
parent
52142a0e20
commit
983f5f9b06
@ -1,4 +1,4 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
tr "\*\~\<\>\$\%" "\020\021\010\025\016\017" < "$1" | sed '/^\[/d' > "$2"
|
tr "\*\~\<\>\$\%" "\020\021\010\025\016\017" < "$1" | \
|
||||||
dd if=/dev/zero bs=1 count=1 2>/dev/null >> "$2"
|
awk '!/^\[/ { printf "%c%s", length, $0 } END { printf "\xFF" }' > "$2"
|
||||||
|
@ -11,7 +11,7 @@ FX.ALL=Type(06),AuxType(6000),Access(C3)
|
|||||||
DFX.IDX=Type(06),AuxType(6000),Access(C3)
|
DFX.IDX=Type(06),AuxType(6000),Access(C3)
|
||||||
DFX.ALL=Type(06),AuxType(6000),Access(C3)
|
DFX.ALL=Type(06),AuxType(6000),Access(C3)
|
||||||
GAMEHELP.IDX=Type(06),AuxType(6000),Access(C3)
|
GAMEHELP.IDX=Type(06),AuxType(6000),Access(C3)
|
||||||
GAMEHELP.ALL=Type(04),AuxType(6000),Access(C3)
|
GAMEHELP.ALL=Type(06),AuxType(6000),Access(C3)
|
||||||
SLIDESHOW.IDX=Type(06),AuxType(4000),Access(C3)
|
SLIDESHOW.IDX=Type(06),AuxType(4000),Access(C3)
|
||||||
SLIDESHOW.ALL=Type(06),AuxType(0800),Access(C3)
|
SLIDESHOW.ALL=Type(06),AuxType(0800),Access(C3)
|
||||||
PRELAUNCH.IDX=Type(06),AuxType(6000),Access(C3)
|
PRELAUNCH.IDX=Type(06),AuxType(6000),Access(C3)
|
||||||
@ -19,8 +19,8 @@ PRELAUNCH.ALL=Type(06),AuxType(0106),Access(C3)
|
|||||||
COVER=Type(06),AuxType(2000),Access(C3)
|
COVER=Type(06),AuxType(2000),Access(C3)
|
||||||
TITLE=Type(06),AuxType(2000),Access(C3)
|
TITLE=Type(06),AuxType(2000),Access(C3)
|
||||||
HELP=Type(06),AuxType(2000),Access(C3)
|
HELP=Type(06),AuxType(2000),Access(C3)
|
||||||
CREDITS=Type(04),AuxType(6000),Access(C3)
|
CREDITS=Type(06),AuxType(6000),Access(C3)
|
||||||
HELPTEXT=Type(04),AuxType(6000),Access(C3)
|
HELPTEXT=Type(06),AuxType(6000),Access(C3)
|
||||||
DECRUNCH=Type(06),AuxType(0200),Access(C3)
|
DECRUNCH=Type(06),AuxType(0200),Access(C3)
|
||||||
JOYSTICK=Type(06),AuxType(0800),Access(C3)
|
JOYSTICK=Type(06),AuxType(0800),Access(C3)
|
||||||
Finder.Data=Type(C9),AuxType(0000),Access(E7)
|
Finder.Data=Type(C9),AuxType(0000),Access(E7)
|
||||||
|
@ -17,7 +17,7 @@
|
|||||||
; D000..D3FF - ProRWTS data
|
; D000..D3FF - ProRWTS data
|
||||||
; D400..D66F - ProRWTS code
|
; D400..D66F - ProRWTS code
|
||||||
; D670..DB91 - HGR font code & ProRWTS glue code
|
; D670..DB91 - HGR font code & ProRWTS glue code
|
||||||
; DB72..DB81 - backup of stack (during gameplay and self-running demos)
|
; DB61..DB70 - backup of stack (during gameplay and self-running demos)
|
||||||
; ...unused...
|
; ...unused...
|
||||||
; DBB4..DBFF - (de)acceleration function
|
; DBB4..DBFF - (de)acceleration function
|
||||||
; DC00..DFFF - HGR font data
|
; DC00..DFFF - HGR font data
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
;license:MIT
|
;license:MIT
|
||||||
;(c) 2018-2020 by 4am
|
;(c) 2018-2021 by 4am
|
||||||
;
|
;
|
||||||
; hi-res font drawing routines
|
; hi-res font drawing routines
|
||||||
;
|
;
|
||||||
@ -9,7 +9,8 @@
|
|||||||
;
|
;
|
||||||
|
|
||||||
DrawPageInternal
|
DrawPageInternal
|
||||||
; A/Y contains address of character buffer
|
; A/Y contains address of array of length-prefixed strings
|
||||||
|
; length #$FF terminates
|
||||||
; X contains 0-indexed left margin (HTAB)
|
; X contains 0-indexed left margin (HTAB)
|
||||||
; carry bit clear -> draw on page 1
|
; carry bit clear -> draw on page 1
|
||||||
; carry bit set -> draw on page 2
|
; carry bit set -> draw on page 2
|
||||||
@ -18,7 +19,7 @@ DrawPageInternal
|
|||||||
; clobbers PTR
|
; clobbers PTR
|
||||||
; clobbers $FF
|
; clobbers $FF
|
||||||
; clobbers A/X/Y
|
; clobbers A/X/Y
|
||||||
; preserves all flags, by a quirk of implementation
|
; preserves all flags
|
||||||
php
|
php
|
||||||
stx $FF
|
stx $FF
|
||||||
ldx #0
|
ldx #0
|
||||||
@ -28,32 +29,22 @@ DrawPageInternal
|
|||||||
lda $FF
|
lda $FF
|
||||||
sta HTAB
|
sta HTAB
|
||||||
ldy #0
|
ldy #0
|
||||||
@parseLine
|
lda (PTR), y ; A = length of line, or #$FF
|
||||||
lda (PTR), y
|
bmi PLP_AND_RTS ; if #$FF then we're done
|
||||||
beq @donePage
|
tax ; X = length of line
|
||||||
cmp #$0A
|
|
||||||
beq @doneParsingLine
|
|
||||||
iny
|
|
||||||
bne @parseLine
|
|
||||||
@doneParsingLine
|
|
||||||
sty SAVE
|
|
||||||
tya
|
|
||||||
beq @skip
|
|
||||||
ldx SAVE
|
|
||||||
+LD16 PTR
|
|
||||||
plp
|
plp
|
||||||
php
|
php ; C = whatever was passed in
|
||||||
jsr DrawBufferInternal
|
pha ; save length
|
||||||
@skip inc SAVE ; skip carriage return
|
jsr DrawStringSuperInternal
|
||||||
lda SAVE ; advance PTR to start of next line
|
pla ; A = length of line
|
||||||
clc
|
clc ; advance PTR to start of next line
|
||||||
adc PTR
|
adc PTR
|
||||||
sta PTR
|
sta PTR
|
||||||
bcc +
|
bcc +
|
||||||
inc PTR+1
|
inc PTR+1
|
||||||
+ inc VTAB ; this will print 255 lines if you give it
|
+ inc VTAB ; this will print 255 lines if you give
|
||||||
bne @drawLine ; 255 lines, so don't do that
|
bne @drawLine ; it 255 lines, because this is assembly
|
||||||
@donePage
|
PLP_AND_RTS
|
||||||
plp
|
plp
|
||||||
rts
|
rts
|
||||||
|
|
||||||
@ -82,7 +73,6 @@ DrawCenteredStringInternal
|
|||||||
; clobbers A/X/Y
|
; clobbers A/X/Y
|
||||||
; clobbers PTR/PTR+1
|
; clobbers PTR/PTR+1
|
||||||
+ST16 PTR
|
+ST16 PTR
|
||||||
|
|
||||||
ldy #0
|
ldy #0
|
||||||
php
|
php
|
||||||
lda #40
|
lda #40
|
||||||
@ -102,10 +92,10 @@ DrawStringInternal
|
|||||||
; clobbers A/X/Y
|
; clobbers A/X/Y
|
||||||
; clobbers PTR/PTR+1
|
; clobbers PTR/PTR+1
|
||||||
+ST16 PTR
|
+ST16 PTR
|
||||||
|
|
||||||
ldy #0
|
ldy #0
|
||||||
+ lda (PTR),y
|
+ lda (PTR),y
|
||||||
tax
|
tax
|
||||||
|
DrawStringSuperInternal
|
||||||
inc PTR
|
inc PTR
|
||||||
bne +
|
bne +
|
||||||
inc PTR+1
|
inc PTR+1
|
||||||
@ -115,7 +105,7 @@ DrawStringInternal
|
|||||||
|
|
||||||
DrawBufferInternal
|
DrawBufferInternal
|
||||||
; A/Y contains address of character buffer
|
; A/Y contains address of character buffer
|
||||||
; X contains buffer length (1..40)
|
; X contains buffer length (0..40)
|
||||||
; carry bit clear -> draw on page 1
|
; carry bit clear -> draw on page 1
|
||||||
; carry bit set -> draw on page 2
|
; carry bit set -> draw on page 2
|
||||||
; characters MUST have high bit off (0x00..0x7F)
|
; characters MUST have high bit off (0x00..0x7F)
|
||||||
@ -129,6 +119,7 @@ DrawBufferInternal
|
|||||||
+ST16 DBISrc+1
|
+ST16 DBISrc+1
|
||||||
php
|
php
|
||||||
dex
|
dex
|
||||||
|
bmi PLP_AND_RTS ; empty string
|
||||||
lda VTAB
|
lda VTAB
|
||||||
asl
|
asl
|
||||||
asl
|
asl
|
||||||
|
Loading…
Reference in New Issue
Block a user