| |
TheWarCriminal Account closed
Registered: May 2011 Posts: 30 |
keep top 2 rows of screen from vertical scrolling
I lost my code from years ago that would keep the top 2 rows of the character screen (1024+80) from vertical scrolling with no flickering. I used it for the BBS I was creating back then. With recent devs in CBASE not performing how I would like it too I have started back recoding that BBS but I need 2 very important things. First off is a no vertical scroll on the top 2 rows. I know CBASE has one but it flickers and is compiled. Would like one in ML or someone point me in a starting direction. The 2nd one is a date ML routine. I know how to check the time and convert it into a readable format but the timer does not hold a date so it keeps resetting at 24hr. Since I am coding this BBS for WinVice is there a way to get the info from the emulated RTC?
I know this sounds like I have no clue what I am doing but when you have been away from c64 coding for 3 decades you loose the knowledge. Just getting reacquainted with BASIC V2 is a hazzle when you are so used to VB.NET behind code. One oh the things that constantly get me is the string setup: BASIC V2 is string$ where as VB.NET is $string. Which ever company decided to screw around with the context should have left it alone.
Any help would be appreciated in this. (I have searched the forums here, Google and Internet Archive c64 Books) |
|
... 28 posts hidden. Click here to view all posts.... |
| |
ChristopherJam
Registered: Aug 2004 Posts: 1370 |
Quoting TheWarCriminal The 2nd one is a date ML routine. I know how to check the time and convert it into a readable format but the timer does not hold a date so it keeps resetting at 24hr. Since I am coding this BBS for WinVice is there a way to get the info from the emulated RTC?
VICE emulates the original hardware, which only tracks the time and not a date, so no there is not.
If you're planning on running the BBS continuously, you do however have the option of having your 'get date' routine log what time you last called it, and on next call see if it's "earlier in the day" than the previous call, which you could then use as a cue to increment the date before you return. |
| |
ChristopherJam
Registered: Aug 2004 Posts: 1370 |
As for the reverse not working, you can replace the inner loop
with
SHOWTEXT
lda #$00
sta TEXTP
GTEXT
lda TEXTP
cmp #$01+79
beq EXITTEXT
ldx TEXTP
lda TEXTm,x
clc
adc #192
sta TEXTOUTPUT,x
inc TEXTP
jmp GTEXT
EXITTEXT
Note the "#" before the 192, and the CLC on the line before.
You can also save a few instructions by doing this:
SHOWTEXT
lda #$00
sta TEXTP
GTEXT
ldx TEXTP
cpx #$01+79
beq EXITTEXT
lda TEXTm,x
clc
adc #192
sta TEXTOUTPUT,x
inc TEXTP
jmp GTEXT
EXITTEXT
or, shorter again
SHOWTEXT
ldx #$00
stx TEXTP
GTEXT
cpx #$01+79
beq EXITTEXT
lda TEXTm,x
clc
adc #192
sta TEXTOUTPUT,x
inx
jmp GTEXT
EXITTEXT
then you can drop TEXTP altogether, and move the comparison to the end, and you can almost certainly replace the clc/adc with an EOR, cutting it down to
SHOWTEXT
ldx #$00
GTEXT
lda TEXTm,x
eor #192
sta TEXTOUTPUT,x
inx
cpx #80
bne GTEXT
Hope that helps. |
| |
Krill
Registered: Apr 2002 Posts: 2825 |
If that dubious ADC is intended to invert characters defined as screen codes and copied directly to screen memory, shouldn't it rather be EOR #$80? :) |
| |
ChristopherJam
Registered: Aug 2004 Posts: 1370 |
I'm guessing it's also meant to be converting from some other rep to screencodes?
Also, best way to avoid the flicker at the top is probably to clone the kernal routines then patch them to remove the first two rows from the area updated by the scroll code.. |
| |
chatGPZ
Registered: Dec 2001 Posts: 11100 |
Don't forget to patch the HOME location too |
| |
Krill
Registered: Apr 2002 Posts: 2825 |
Quoting GroepazDon't forget to patch the HOME location too Or just have prints all ordinary on 40x25, but with a split that would optionally display a hires bitmap in the top two rows (no $d800 issue). Or, well, border sprites! |
| |
chatGPZ
Registered: Dec 2001 Posts: 11100 |
Oh yeah, border sprites with RS232 NMI going on \o/ |
| |
ChristopherJam
Registered: Aug 2004 Posts: 1370 |
Quoting KrillQuoting GroepazDon't forget to patch the HOME location too Or just have prints all ordinary on 40x25, but with a split that would optionally display a hires bitmap in the top two rows (no $d800 issue).
Yes, I think Silver Dream already mentioned raster splits.
(much as you already mentioned stealing the kernal routine - though I was thinking more, disable ROM and patch the kernal routine, so scroll is still triggered by character printing as usual)
Nice idea using hires bitmap to avoid d800 issues though!
I'm still unclear as to whether he wants to do smooth scrolling or just the usual row resolution scrolling. |
| |
Krill
Registered: Apr 2002 Posts: 2825 |
Quoting ChristopherJamthough I was thinking more, disable ROM and patch the kernal routine, so scroll is still triggered by character printing as usual Somebody mentioned memory being tight, so i guess hooking into the CHROUT vector and doing some interception and custom scroll etc. seems more feasible than hogging 8 KB for pretty much the same functionality. =) |
| |
Krill
Registered: Apr 2002 Posts: 2825 |
Quoting GroepazOh yeah, border sprites with RS232 NMI going on \o/ Same problem as with a raster split, no? But can be turned off for transfers.
And i guess you wouldn't really use actual NMI but poll the flag from mainline thread instead (for maximum transfer speed)? |
Previous - 1 | 2 | 3 | 4 | 5 - Next |