From: mrdudz Date: Mon, 13 Jul 2015 10:10:09 +0000 (+0200) Subject: added imports for conio init to conio functions, so the constructor will get linked... X-Git-Tag: V2.16~231^2~24 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=515a61a302a1923de5816c8418f0af56bb4dc77e;p=cc65 added imports for conio init to conio functions, so the constructor will get linked and called automatically --- diff --git a/libsrc/pce/clrscr.s b/libsrc/pce/clrscr.s index 93628ddd8..59fda4f2e 100644 --- a/libsrc/pce/clrscr.s +++ b/libsrc/pce/clrscr.s @@ -23,3 +23,8 @@ colloop: lda #' ' rts +;------------------------------------------------------------------------------- +; force the init constructor to be imported + + .import initconio +conio_init = initconio diff --git a/libsrc/pce/color.s b/libsrc/pce/color.s index 0ec35f5b3..03d93b186 100644 --- a/libsrc/pce/color.s +++ b/libsrc/pce/color.s @@ -55,3 +55,9 @@ colors: ; G R B .word ((7<<6)+(4<<3)+(4)) ; d light green .word ((4<<6)+(4<<3)+(7)) ; e light blue .word ((6<<6)+(6<<3)+(6)) ; f light gray + +;------------------------------------------------------------------------------- +; force the init constructor to be imported + + .import initconio +conio_init = initconio diff --git a/libsrc/pce/cputc.s b/libsrc/pce/cputc.s index ec63b7565..e503ee6f2 100644 --- a/libsrc/pce/cputc.s +++ b/libsrc/pce/cputc.s @@ -91,3 +91,9 @@ putchar: staio VDC_DATA_HI rts + +;------------------------------------------------------------------------------- +; force the init constructor to be imported + + .import initconio +conio_init = initconio diff --git a/libsrc/pce/crt0.s b/libsrc/pce/crt0.s index eab27ba5c..e67039d43 100644 --- a/libsrc/pce/crt0.s +++ b/libsrc/pce/crt0.s @@ -149,10 +149,6 @@ start: ; Call module constructors jsr initlib - ;; FIXME: this should be called from a constructor instead - .import initconio - jsr initconio - ; Pass an empty command line jsr push0 ; argc jsr push0 ; argv diff --git a/libsrc/pce/gotoxy.s b/libsrc/pce/gotoxy.s index 24f917cd6..c6b937177 100644 --- a/libsrc/pce/gotoxy.s +++ b/libsrc/pce/gotoxy.s @@ -13,4 +13,9 @@ _gotoxy: sta CURS_X ; Set X jmp plot ; Set the cursor position +;------------------------------------------------------------------------------- +; force the init constructor to be imported + + .import initconio +conio_init = initconio diff --git a/libsrc/pce/kplot.s b/libsrc/pce/kplot.s index beb151a7b..eb4e79e04 100644 --- a/libsrc/pce/kplot.s +++ b/libsrc/pce/kplot.s @@ -29,4 +29,9 @@ _plothi: .byte >($0000+(line*$80)) .endrepeat +;------------------------------------------------------------------------------- +; force the init constructor to be imported + + .import initconio +conio_init = initconio diff --git a/libsrc/pce/readme.txt b/libsrc/pce/readme.txt index cd91de97a..c7b3aed3d 100644 --- a/libsrc/pce/readme.txt +++ b/libsrc/pce/readme.txt @@ -13,12 +13,11 @@ get_tv() is missing some graphical petscii chars should get added to the charset -conio-init should get initialized from a constructor rather than always get -called from crt0 (which for some reason doesnt work) -> see conio.s, it should -get linked if _any_ of the conio function is used - interruptor support in crt0 (and cfg) is missing +conio lacks support for different screen sizes, which could be used with +different video modes + -------------------------------------------------------------------------------- a good emulator to use for PC-Engine is "mednafen" (mednafen.sourceforge.net) diff --git a/libsrc/pce/revers.s b/libsrc/pce/revers.s index c39a9f843..d3e6f8930 100644 --- a/libsrc/pce/revers.s +++ b/libsrc/pce/revers.s @@ -1,5 +1,13 @@ +; FIXME: actual revers output is not supported yet + .export _revers _revers: lda #0 rts + +;------------------------------------------------------------------------------- +; force the init constructor to be imported + + .import initconio +conio_init = initconio diff --git a/libsrc/pce/scrsize.s b/libsrc/pce/scrsize.s index 6e2b84a41..254676aae 100644 --- a/libsrc/pce/scrsize.s +++ b/libsrc/pce/scrsize.s @@ -8,6 +8,8 @@ _screensize: ldy ysize rts +; FIXME: changing the video mode allows for different screen sizes + .rodata .export xsize, ysize diff --git a/testcode/lib/pce/conio.c b/testcode/lib/pce/conio.c index 0c5c89c57..993d93597 100644 --- a/testcode/lib/pce/conio.c +++ b/testcode/lib/pce/conio.c @@ -42,7 +42,7 @@ void main(void) gotoxy(0,8); clk = clock(); cprintf("clock: %08lx", clk); - + for (i = 0; i < 4; ++i) { gotoxy(0, 12 + i); @@ -58,4 +58,4 @@ void main(void) } } for(;;); -} \ No newline at end of file +}