mirror of
https://github.com/cc65/cc65.git
synced 2024-06-07 23:29:39 +00:00
Creativison changes.
This change includes some cleanups, removal of mainargs.s (game console programs never have arguments), and a workaround for a problem I'm seeing. The problem is that sometimes (in fact, more often than not) the clrscr() call in testcode/lib/joy-test.c writes some garbage chars on the screen (most often a "P"). Could be my hardware (I haven't seen it on MAME), but to me the root cause is still unknown.
This commit is contained in:
parent
0bbe4f56a5
commit
a3d8829be9
|
@ -10,10 +10,10 @@ CURSOR_X = $3C
|
||||||
CURSOR_Y = $3D
|
CURSOR_Y = $3D
|
||||||
|
|
||||||
;** VDP
|
;** VDP
|
||||||
VDP_CONTROL_W = $3001
|
|
||||||
VDP_DATA_W = $3000
|
|
||||||
VDP_STATUS_R = $2001
|
|
||||||
VDP_DATA_R = $2000
|
VDP_DATA_R = $2000
|
||||||
|
VDP_STATUS_R = $2001
|
||||||
|
VDP_DATA_W = $3000
|
||||||
|
VDP_CONTROL_W = $3001
|
||||||
|
|
||||||
;** PIA
|
;** PIA
|
||||||
PIA0_DATA = $1000
|
PIA0_DATA = $1000
|
||||||
|
@ -58,3 +58,4 @@ JOY_NNW = $4A
|
||||||
BIOS_IRQ1_ADDR = $FF3F
|
BIOS_IRQ1_ADDR = $FF3F
|
||||||
BIOS_IRQ2_ADDR = $FF52
|
BIOS_IRQ2_ADDR = $FF52
|
||||||
BIOS_NMI_RESET_ADDR = $F808
|
BIOS_NMI_RESET_ADDR = $F808
|
||||||
|
BIOS_WRITE_VDP_REG = $FE1F
|
||||||
|
|
|
@ -4,7 +4,7 @@ SYMBOLS {
|
||||||
MEMORY {
|
MEMORY {
|
||||||
ZP: file = "", define = yes, start = $0020, size = $00E0;
|
ZP: file = "", define = yes, start = $0020, size = $00E0;
|
||||||
RAM: file = "", define = yes, start = $01FA, size = $0206;
|
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 {
|
SEGMENTS {
|
||||||
ZEROPAGE: load = ZP, type = zp;
|
ZEROPAGE: load = ZP, type = zp;
|
||||||
|
|
|
@ -18,7 +18,7 @@ _clrscr:
|
||||||
lda #$50 ; VRAM offset high ($10 OR $40)
|
lda #$50 ; VRAM offset high ($10 OR $40)
|
||||||
sta VDP_CONTROL_W
|
sta VDP_CONTROL_W
|
||||||
|
|
||||||
lda #$C0 ; Space from ROM setup
|
lda #$40 ; Space char from ROM setup
|
||||||
|
|
||||||
ldx #0
|
ldx #0
|
||||||
ldy #3
|
ldy #3
|
||||||
|
@ -34,8 +34,8 @@ L1: sta VDP_DATA_W
|
||||||
lda #0
|
lda #0
|
||||||
sta CURSOR_X
|
sta CURSOR_X
|
||||||
sta CURSOR_Y
|
sta CURSOR_Y
|
||||||
sta <SCREEN_PTR
|
sta SCREEN_PTR
|
||||||
lda #$10
|
lda #$10
|
||||||
sta >SCREEN_PTR
|
sta SCREEN_PTR+1
|
||||||
|
|
||||||
rts
|
rts
|
||||||
|
|
|
@ -96,8 +96,8 @@ BAD_CHAR:
|
||||||
jmp plot
|
jmp plot
|
||||||
|
|
||||||
;-----------------------------------------------------------------------------
|
;-----------------------------------------------------------------------------
|
||||||
; Initialize the conio subsystem. Code goes into the INIT segment, which may
|
; Initialize the conio subsystem. "INIT" segment is nothing special on the
|
||||||
; be reused after startup.
|
; Creativision, it is part of the "ROM" memory.
|
||||||
|
|
||||||
.segment "INIT"
|
.segment "INIT"
|
||||||
|
|
||||||
|
@ -122,4 +122,4 @@ LL: lda boxchars,x
|
||||||
bne LL
|
bne LL
|
||||||
|
|
||||||
cli
|
cli
|
||||||
jmp plot
|
jmp plot
|
||||||
|
|
|
@ -31,9 +31,6 @@ entry:
|
||||||
ldx #<__RAM_START__ - 1
|
ldx #<__RAM_START__ - 1
|
||||||
txs
|
txs
|
||||||
|
|
||||||
; Start interrupts
|
|
||||||
cli
|
|
||||||
|
|
||||||
; Clear the BSS data
|
; Clear the BSS data
|
||||||
jsr zerobss
|
jsr zerobss
|
||||||
|
|
||||||
|
@ -49,13 +46,21 @@ entry:
|
||||||
; Call module constructors
|
; Call module constructors
|
||||||
jsr initlib
|
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()
|
; Call main()
|
||||||
jsr callmain
|
jsr callmain
|
||||||
|
|
||||||
; Call module destructors. This is also the _exit entry.
|
; Call module destructors. This is also the _exit entry.
|
||||||
_exit: jsr donelib
|
_exit: jsr donelib
|
||||||
|
|
||||||
; TODO: Replace with some sort of reset
|
; A Creativision program isn't supposed to exit.
|
||||||
loop: jmp loop
|
loop: jmp loop
|
||||||
|
|
||||||
; ------------------------------------------------------------------------
|
; ------------------------------------------------------------------------
|
||||||
|
@ -81,7 +86,7 @@ irq2: jmp BIOS_IRQ2_ADDR
|
||||||
; VDP Setup
|
; VDP Setup
|
||||||
; This sets to Graphics Mode 1
|
; This sets to Graphics Mode 1
|
||||||
.byte $00 ; Register 0
|
.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 $04 ; Register 2 Name Table at $1000 - $12FF
|
||||||
.byte $60 ; Register 3 Colour Table at $1800 - $181F
|
.byte $60 ; Register 3 Colour Table at $1800 - $181F
|
||||||
.byte $00 ; Register 4 Pattern Table at $0000 - $07FF
|
.byte $00 ; Register 4 Pattern Table at $0000 - $07FF
|
||||||
|
|
|
@ -1,22 +0,0 @@
|
||||||
;
|
|
||||||
; 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
|
|
Loading…
Reference in New Issue
Block a user