1
0
mirror of https://github.com/cc65/cc65.git synced 2025-01-15 22:30:04 +00:00

Added screen initialization on Apple GEOS.

git-svn-id: svn://svn.cc65.org/cc65/trunk@5568 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
ol.sc 2012-02-28 21:24:17 +00:00
parent 204aba1577
commit f6825b244a

View File

@ -7,41 +7,61 @@
.export _exit .export _exit
.export __STARTUP__ : absolute = 1 ; Mark as startup .export __STARTUP__ : absolute = 1 ; Mark as startup
.import __VLIR0_START__, __VLIR0_SIZE__ ; Linker generated .import __VLIR0_START__, __VLIR0_SIZE__ ; Linker generated
.import __STACKSIZE__ ; Linker generated .import __STACKSIZE__, __BACKBUFSIZE__ ; Linker generated
.import initlib, donelib .import initlib, donelib
.import callmain .import callmain
.import zerobss .import zerobss
.importzp sp .importzp sp
.include "jumptab.inc" .include "jumptab.inc"
.include "geossym.inc"
.include "const.inc"
; ------------------------------------------------------------------------ ; ------------------------------------------------------------------------
; Place the startup code in a special segment. ; Place the startup code in a special segment.
.segment "STARTUP" .segment "STARTUP"
; Clear the BSS data ; GEOS 64/128 initializes the screen before starting an application while
; Apple GEOS does not. In order to provide identical startup conditions
; we initialize the screen here on Apple GEOS. For the same reason we set
; the pattern and dispBufferOn even on GEOS 64/128 although we don't use
; them here.
lda #2 ; Checkerboard pattern
jsr SetPattern
lda #<(ST_WR_FORE | .MIN (ST_WR_BACK, __BACKBUFSIZE__))
sta dispBufferOn
.ifdef __GEOS_APPLE__
jsr i_Rectangle
.byte 0
.byte SC_PIX_HEIGHT-1
.word 0
.word SC_PIX_WIDTH-1
.endif
; Clear the BSS data.
jsr zerobss jsr zerobss
; Setup stack ; Setup stack.
lda #<(__VLIR0_START__ + __VLIR0_SIZE__ + __STACKSIZE__) lda #<(__VLIR0_START__ + __VLIR0_SIZE__ + __STACKSIZE__)
ldx #>(__VLIR0_START__ + __VLIR0_SIZE__ + __STACKSIZE__)
sta sp sta sp
lda #>(__VLIR0_START__ + __VLIR0_SIZE__ + __STACKSIZE__) stx sp+1
sta sp+1 ; Set argument stack ptr
; Call module constructors ; Call module constructors.
jsr initlib jsr initlib
; Push arguments and call main() ; Push arguments and call main().
cli cli
jsr callmain jsr callmain
; Call module destructors. ; Call module destructors.
_exit: jsr donelib ; Run module destructors _exit: jsr donelib
jmp EnterDeskTop ; return control to the system jmp EnterDeskTop ; Return control to the system