CURSOR_Y = $3D
;** VDP
-VDP_CONTROL_W = $3001
-VDP_DATA_W = $3000
-VDP_STATUS_R = $2001
VDP_DATA_R = $2000
+VDP_STATUS_R = $2001
+VDP_DATA_W = $3000
+VDP_CONTROL_W = $3001
;** PIA
PIA0_DATA = $1000
BIOS_IRQ1_ADDR = $FF3F
BIOS_IRQ2_ADDR = $FF52
BIOS_NMI_RESET_ADDR = $F808
+BIOS_WRITE_VDP_REG = $FE1F
MEMORY {
ZP: file = "", define = yes, start = $0020, size = $00E0;
RAM: file = "", define = yes, start = $01FA, size = $0206;
- ROM: file = %O, define = yes, start = $B000, size = $1000;
+ ROM: file = %O, define = yes, start = $B000, size = $1000, fill = yes, fillval = $FF;
}
SEGMENTS {
ZEROPAGE: load = ZP, type = zp;
lda #$50 ; VRAM offset high ($10 OR $40)
sta VDP_CONTROL_W
- lda #$C0 ; Space from ROM setup
+ lda #$40 ; Space char from ROM setup
ldx #0
ldy #3
lda #0
sta CURSOR_X
sta CURSOR_Y
- sta <SCREEN_PTR
+ sta SCREEN_PTR
lda #$10
- sta >SCREEN_PTR
+ sta SCREEN_PTR+1
rts
jmp plot
;-----------------------------------------------------------------------------
-; Initialize the conio subsystem. Code goes into the INIT segment, which may
-; be reused after startup.
+; Initialize the conio subsystem. "INIT" segment is nothing special on the
+; Creativision, it is part of the "ROM" memory.
.segment "INIT"
bne LL
cli
- jmp plot
+ jmp plot
ldx #<__RAM_START__ - 1
txs
- ; Start interrupts
- cli
-
; Clear the BSS data
jsr zerobss
; Call module constructors
jsr initlib
+ ; enable vertical blank interrupts in the display controller
+ lda #$E0 ; 16K RAM, Active Display, Mode 1, VBI enabled
+ ldx #$01 ; Register 1
+ jsr BIOS_WRITE_VDP_REG
+
+ ; Start interrupts
+ cli
+
; Call main()
jsr callmain
; Call module destructors. This is also the _exit entry.
_exit: jsr donelib
- ; TODO: Replace with some sort of reset
+ ; A Creativision program isn't supposed to exit.
loop: jmp loop
; ------------------------------------------------------------------------
; VDP Setup
; This sets to Graphics Mode 1
.byte $00 ; Register 0
- .byte $E0 ; Register 1 16K RAM, Active Display, Mode 1, VBI enabled
+ .byte $C0 ; Register 1 16K RAM, Active Display, Mode 1, VBI disabled
.byte $04 ; Register 2 Name Table at $1000 - $12FF
.byte $60 ; Register 3 Colour Table at $1800 - $181F
.byte $00 ; Register 4 Pattern Table at $0000 - $07FF
+++ /dev/null
-;
-; Ullrich von Bassewitz, 2003-03-07
-;
-; Setup arguments for main
-;
-
-
- .constructor initmainargs, 24
- .import __argc, __argv
-
-
-;---------------------------------------------------------------------------
-; Get possible command-line arguments. Goes into the special INIT segment,
-; which may be reused after the startup code is run
-
-.segment "INIT"
-
-.proc initmainargs
-
- rts
-
-.endproc