MiniMemoryTester/src/strings.s

140 lines
3.9 KiB
ArmAsm
Raw Normal View History

2015-03-04 20:21:36 +00:00
**** MACROS
* GOXY #x;#y
* PRINTXY #x;#y;StringAddrWord
2015-03-11 18:28:45 +00:00
* PRINTSTRING #addr
2015-03-04 20:21:36 +00:00
**** FUNCTIONS
2015-03-01 19:44:56 +00:00
* GoXY
* PrintStringsX
* PrintString
2015-09-25 20:31:13 +00:00
PRINTSTRING MAC
lda #]1
ldy #>]1
jsr PrintString
<<<
GOXY MAC
ldx ]1
ldy ]2
stx $24
sty $25
jsr VTAB
<<<
PRINTXY MAC
ldx ]1
ldy ]2
stx $24
sty $25
jsr VTAB
lda #]3
ldy #>]3
jsr PrintString
<<<
GoXY stx $24
sty $25
jsr VTAB
rts
2015-03-01 19:44:56 +00:00
2015-03-04 20:21:36 +00:00
* lda #MainMenuStrs
* ldy #>MainMenuStrs
* ldx #05 ; horiz pos
2015-09-25 20:31:13 +00:00
PrintStringsX stx _printstringsx_horiz
2015-03-01 19:44:56 +00:00
2015-09-25 20:31:13 +00:00
sta $0
sty $1
:loop lda _printstringsx_horiz
sta $24
lda $0 ; slower, but allows API reuse
ldy $1
jsr PrintString ; y is last val
iny
lda ($0),y
beq :done
tya ; not done so add strlen to source ptr
clc
adc $0
sta $0
bcc :nocarry
inc $1
:nocarry bra :loop
2015-03-01 19:44:56 +00:00
2015-09-25 20:31:13 +00:00
:done rts
2015-03-01 19:44:56 +00:00
2015-09-25 20:31:13 +00:00
_printstringsx_horiz db 00
2015-03-01 19:44:56 +00:00
* PrintString (A=Low Byte, Y=High Byte)
2015-09-25 20:31:13 +00:00
PrintString sta :loop+1
sty :loop+2
ldy #0
:loop lda $FFFF,y ; dummy bytes
beq :done
jsr COUT
iny
bra :loop
:done rts
LOG MAC
lda #]1
ldy #>]1
jsr ConsoleLog
<<<
_consoleBottom = #23
* Write out to console window
ConsoleLog pha
phy
lda #0 ;settings to bottom-left of window
sta $24
lda #_consoleBottom-1
sta $25
jsr VTAB
lda #$8D ;pre-fix CR
jsr COUT
ply
pla
jsr PrintString
rts
* Set console windowing
WinConsole lda #3
sta $20 ;left edge
lda #75
sta $21 ;width
lda #17
sta $22 ;top edge
lda #_consoleBottom
sta $23 ;bottom edge
rts
* Set info windowing
WinInfo lda #52
sta $20 ;left edge
lda #26
sta $21 ;width
lda #5
sta $22 ;top edge
lda #16
sta $23 ;bottom edge
rts
* Restore full screen windowing
WinFull stz $20
stz $22
lda #80
sta $21
lda #24
sta $23
rts
2015-03-01 19:44:56 +00:00