An odd BASIC INPUT problem

Reports of emulation bugs discovered in CCS64.

Moderator: Håkan Sundell

Post Reply
nicknicknickandnick
Posts: 17
Joined: Thu Jan 22, 2004 10:24 am

An odd BASIC INPUT problem

Post by nicknicknickandnick »

I posted this some time ago at the Lemon forum, but I figured it would not be out of place here:

I transfered some of my mathematical BASIC programs from floppy to the PC to use in emulators, but I noticed that some don't work as they should with CCS64.

I isolated a line that CCS64 did not like. Let's say that the { symbol represents the symbol you get if you type SHIFT with the move-cursor-right key on the C64 within quotes (which should give the effect of moving one space to the left with the INPUT and PRINT commands). For some reason, if I have a line such as INPUT"!{{";N in a program, when any number is entered for the input, the message ?REDO FROM START appears. The program is stuck like this -- any attempt to enter a number gives that message.

VICE has no such problem. Is this a bug with CCS64 or what?

By the way, the reason I have such an input line is to put the ! symbol at the left of the screen and have the user enter a number that appears right next to the ! symbol. I read there's a way to get rid of the ? that shows with INPUT lines, so I know I could just program it differently, but what I am curious about here is why CCS64 handles my INPUT line differently than my real C64 and VICE.
Stuart Toomer
Site Co-Admin
Posts: 786
Joined: Wed Aug 20, 2003 2:46 pm
Location: East Yorkshire, England

Post by Stuart Toomer »

Try another version of BASIC.ROM first. I'll keep an eye on this.
Kind regards,

Stuart Toomer.
nicknicknickandnick
Posts: 17
Joined: Thu Jan 22, 2004 10:24 am

Post by nicknicknickandnick »

OK, I tried VICE's basic file, renamed it basic.rom and put it into CCS64's folder. The effect is still there.

Next I replaced the kernal.rom file with VICE's. That fixed it -- the effect disappeared.
iAN CooG/HF
Posts: 12
Joined: Sat Jan 03, 2004 11:42 pm
Contact:

Post by iAN CooG/HF »

nicknicknickandnick wrote:Next I replaced the kernal.rom file with VICE's. That fixed it -- the effect disappeared.

Another rev.2 kernal bug, then. Vice uses a rev.3 and many games/demos in CCS work correctly only with this.
What happens in vice if you put the CCS kernal? same bug?
-=[]=--- iAN CooG ---=[]=-
nicknicknickandnick
Posts: 17
Joined: Thu Jan 22, 2004 10:24 am

Post by nicknicknickandnick »

Yes -- I tried VICE with the CCS kernal, and that caused VICE to show the effect too.
StevenRoy
Posts: 66
Joined: Mon Sep 15, 2003 7:14 am
Contact:

Post by StevenRoy »

This sounds to me like a line-linking problem related to cursoring off the left side of the screen. That would be a C64 Kernal bug rather than an emulation bug. Obviously, switching to a newer ROM revision fixes it.

However, if there's any chance that you may distribute your program, you will probably want more compatibility. One possible workaround would be to put a space before the exclamation point, which would cause the prompt to look like "?!". The question mark can easily be hidden, though, with some fiddling with the horizontal scrolling register. However, other print statements would need to be changed, too, since the leftmost column of the screen is hidden. I'm not even sure that this will get around the problem!

More practical, although more complex, is to have a subroutine that uses GET to handle input. This is what I'd recommend, as it gives you full control over the prompt, what input to handle, and even the cursor if you really want to impress people.

I should probably get a copy of all the different ROM revisions so I can test them with the game I'm working on. It sounds to me like CCS64 has R2, Vice comes with R3... Do I hear R1 anywhere?
Image
nicknicknickandnick
Posts: 17
Joined: Thu Jan 22, 2004 10:24 am

Post by nicknicknickandnick »

Thanks for the answers. I found a really simple thing I could do to be rid of the question mark with an INPUT statement: POKE 19,1 then the INPUT statement, then POKE 19,0 to restore the default.
Stuart Toomer
Site Co-Admin
Posts: 786
Joined: Wed Aug 20, 2003 2:46 pm
Location: East Yorkshire, England

Post by Stuart Toomer »

Yes, CCS64 comes with Revision 2 of the ROMs, and as we know, some bugs are fixed in the Revision 3 ROMs; so it's preferable to use the more up-to-date revisions.

Some versions of the 1541 ROM also fix/introduce other bugs, but that's more of a nightmare...
Kind regards,

Stuart Toomer.
Post Reply