


So, I will talk about integrating IRQ handling, and in a follow up post Marko will talk about how he got the PS/2 controller talking to the keyboard.

Also, typematic rate and delay could not be set, as couldn’t the states of the keyboard LEDs.Īlthough mid- to long term, we likely might “upgrade” to USB anyway, but not without having done PS/2 right first. The PS/2 controller had no way of talking to the keyboard and had to rely for the keyboard to initialize itself properly.The PS/2 controller had no way of signalling that there has been a new keystroke, the buffer had to be polled via SPI.The next step will be to save BASIC programs in ASCII format by setting VEC_OUT accordingly and triggering a LIST command.
#6502 EMULATOR EHBASIC SOFTWARE#
Now we’re ready to feed almost any BASIC source to EhBasic, which will make porting existing BASIC software pretty easy. Otherwise, the input would be echoed by the interpreter loop, resulting in the program being listed during load. Jmp LAB_1319 cleanup and Return to BASICĪlso, outvec dummy ist just an empty subroutine which we set the output vector VEC_OUT to, in order to suppress output while loading. SMB7 OPXMDM set upper bit in flag (print Ready msg) Instead, we implemented a wrapper, which will read a byte from the file and pass it to EhBasic, and restore the vectors when EOF is reached: fread_wrapper:īcs #KEY_LF replace with "basic end of line" That’s the reason we did not point the vector directly to fat_fread_byte. But then what? The input vector still points to fread_wrapper, how do we get control back? So, our LOAD command is implemented like this: LAB_LOAD:Īll it does is changing the in and output vectors and then returning back to the interpreter, which then begins to read characters from VEC_IN until the file is read. The input vector should be restored and the file closed when the file end is reached or an error is encountered.īasically the interpreter would read characters and interpret them, just like them being typed in, but instead they will be read from the file. To load an ASCII program redirect the character input vector to read from your filesystem and return to the main interpreter loop.
#6502 EMULATOR EHBASIC HOW TO#
This is the way EhBasic’s late creator, Lee Davison, preferred, and suggested how to implement this: So clearly, the better approach is to read the BASIC program as source in it’s ASCII representation. While this works well, this approach has the major disadvantage that the saved program will be incompatible with other versions of EhBasic or even with our own when the token list is changed, which happens when adding new commands. We used this in EhBasic to save and load BASIC programs by dumping and reloading it’s binary representation from memory. In the past, we only could read or write a file as a whole, relative to the location in memory where the according pointer pointed to. Still it doesn't stop me lurking around the forum and looking for inspiration and ideas, (and there are plenty), but I do like to go through the struggle bit without admitting defeat, if I can.Since our implementation of FAT32 now supports reading a file byte for byte, a little rework of the file handling in our version of EhBasic is in order. Of course this is a hobbyist viewpoint, a luxury I expect that those that earn their keep by doing this cant afford-(sadly). I don't actually have a REAL use for all the devices I've interfaced and built, it was done for the most part just for the sense of satisfaction of doing it. those hours and hours of head banging are the reason I (usually) write my own 'routines' rather than look for libraries, design my own hardware, then redesign etc etc until- it works and hey- its all my own work- the satisfaction.

That looks like something the cat disemboweled when it's done. Totally the opposite to building your own creation with all it's mysterious problems, mistakes, frustration, head banging. A nice virgin new PCB, all the components, no hunting around for parts, a few relaxing hours "painting by numbers" and best of all it generally works when its built, all development problems sorted out for you!
