lawless-legends/Platform/Apple/virtual/src/plasma/gameloop.pla

65 lines
1.5 KiB
Plaintext
Raw Normal View History

;==================================================================================================
2014-06-25 15:47:28 +00:00
; Handy constants.
const FALSE = 0
const TRUE = !FALSE
;==================================================================================================
2014-06-25 15:47:28 +00:00
; Hardware addresses.
const keyboard = $C000
const keystrobe = $C010
;==================================================================================================
; Strings.
byte hellostr[] = "Hello, world.\n"
;==================================================================================================
; Definitions used by assembly code
asm __defs
!SOURCE "../plvm02zp.inc"
INTERP = $03D0
LCRDEN = $C080
LCWTEN = $C081
ROMEN = $C082
LCRWEN = $C083
LCBNK2 = $00
LCBNK1 = $08
end
;==================================================================================================
; Print a string
asm puts
TXA
PHA
LDA ESTKL,X
2014-06-25 15:47:28 +00:00
STA TMPL
LDA ESTKH,X
2014-06-25 15:47:28 +00:00
STA TMPH
LDY #0
LDA (TMPL),Y
2014-06-25 15:47:28 +00:00
TAX
INY
2014-06-25 15:47:28 +00:00
BIT ROMEN
- LDA (TMPL),Y
ORA #$80
JSR $FDED
INY
DEX
BNE -
2014-06-25 15:47:28 +00:00
BIT LCRDEN+LCBNK2
PLA
TAX
brk
2014-06-25 15:47:28 +00:00
RTS
end
;==================================================================================================
2014-06-25 15:47:28 +00:00
; Main loop.
;
def func()
puts(@hellostr)
end
func()
func()
2014-06-25 15:47:28 +00:00
done