is there any reason for commodore basic 4.0 (ripped of the pet 8032) not to work on a WDC65C02
as in it makes it through ALL of the tests (addressline test, full memory test with all values, rom checksum), the 2 so far fully implemented cbm kernal functions (chrout and chrin) work, in fact the whole thing works -on the emulator- and nicely allows for entering basic programs (although the so-far missing keyboard buffer makes backspace a bit tricky
but that emulates the NMOS instruction set..
when running it on the actual hardware however, it gets to this point:
ifndef cbmB1
;
; Display "xxx COMMODORE BASIC xxx"
;
LDA #>CBMBAS
LDY #<CBMBAS
JSR OPSTRA
endif
;
; Calculate and display free space value
;
LDA HMEPTR
SEC
SBC TXSPTR
TAX
LDA HMEPTR+1
SBC TXSPTR+1
JSR A3C59
;
; Display " BYTES FREE"
;
LDA #>FREEK
LDY #<FREEK
JSR OPSTRA
prints out the CBMBAS string *** COMMODORE BASIC 4.0 BLA BLA ***
prints out the 2 trailing (and translated for normal terminals by the bios/kernal code) CRLF's
then on the emulator it nicely comes up with 32KB basic bytes free. but on the 65c02 board it magically prints out an extra CR (yet again translated to CRLF by the bios) and then dies.
the JSR A3C59 is a huge subroutine that prints the number in A and X as a decimal (actually as a 6 byte floating point if i read this correctly, but it shows as decimal
my suspicion at this point is that the 65C02 does 'something different'.. causing it to crap up somewhere in that huge subroutine calling 2 other subroutines and dying along the way, resulting in the extra enter somehow.
set up traps in the emulator to check for any other operation (basic trying to access i/o directly, trying to read or write to rom locations, that sorta thing) none of that happening. basic nicely calls kernal functions (mainly chrout, chrin and 'stop' (not implemented yet as clearly the documentation is lacking, also the only documentation was actually for the c64
probably doesn't need carry and zero set upon return to 'stop' but an actual jump to warm start, as none of the code that calls it handles it's return value in any way within basic).
now, at least cbm basic v4 actually -gets- to the "commodore basic v4' screen.
basic v2 either fell staight through to warmstart, printed ready, and then crapped up after entering the first letter (sometimes a line)
(basically all commodore basics are the exact same code with a bunch of ifdef's all over the place... my suspicion is that 'somewhere in something called by the coldboot routine' there is something 65c02's can't do the same way 6502's do
literally pulled all chips but the acia out and the effect remains the same.
an actual nmos 6502B gets 'a bit further' (somehow skips the vendor/version header, skips the 'xxxx bytes free' and falls through to warmboot, printing 'ready.' and BREAK, and then crapping up with binary diarrea but that is to be expected as it can't possibly drive boards this size full of cmos inputs directly (heck an nmos 6502 can't even drive an nmos board this size without pullups and bus drivers all over the place
but doesn't have enough power to drive the addressdecoding and the sram (and probably the 65c51) and therefore fails the memory test - not very reliable results there.
if people did get unmodified commodore pet basic's to work on 65C02 boards then i blame that crappy veroboard pretending to be a 74hc139 until the real ones arrive