Search found 338 matches

by Bill B
01 Aug 2022 08:52
Forum: PROGRAMMING
Topic: Interrupts in com files
Replies: 5
Views: 89

Re: Interrupts in com files

The CTC (like most Z80 peripherals) is really only designed to work with mode 2 interrupts. Something like: ctc0 equ 0x08 cfgctc: di im 2 ld a, #0xC5 out (ctc0), a ; Counter mode, interrupt, time constant follows. ld a, #1 out (ctc0), a ; Interrupt on every VDP pulse ld hl, #ijtbl ld a, l out (ctc0)...
by Bill B
31 Jul 2022 08:35
Forum: PROGRAMMING
Topic: Interrupts in com files
Replies: 5
Views: 89

Re: Interrupts in com files

Interrupts from VDP or CTC? Have you set the interrupt enable bit on the VDP if that is what you are using? Have you configured the CTC to generate an interrupt, either on a pulse from the VDP, or on a time elapsed? Which interrupt mode is the Z80 in? What is the I register set to? What interrupt ve...
by Bill B
23 Jul 2022 21:29
Forum: PROGRAMMING
Topic: Latest on C dev for the MTX SDCC etc,
Replies: 31
Views: 1111

Re: Latest on C dev for the MTX SDCC etc,

I have started a new thread with the latest version.
by Bill B
23 Jul 2022 21:27
Forum: PROGRAMMING
Topic: MTXLib
Replies: 1
Views: 79

MTXLib

I have started a new thread for this, so that I can have the first topic, which I can keep updated with any revisions, where they can be easily found. This is a follow up of a request from Jim for an easy environment in which to develop programs for the MTX using C. In response I suggested using the...
by Bill B
07 Jul 2022 17:27
Forum: PROGRAMMING
Topic: Latest on C dev for the MTX SDCC etc,
Replies: 31
Views: 1111

Re: Latest on C dev for the MTX SDCC etc,

More interrupt fun and games. It turns out that the way MEMU emulates the Z80 HALT instruction was breaking the way the execution speed is controlled. :( Although MEMU normally attempts to run at a realistic speed, it only does so on average. Individual Z80 instructions do not take the correct amoun...
by Bill B
05 Jul 2022 21:47
Forum: PROGRAMMING
Topic: Latest on C dev for the MTX SDCC etc,
Replies: 31
Views: 1111

Re: Latest on C dev for the MTX SDCC etc,

Kudos to Dave for finding the first bug :oops:

The count down in the pause routine was broken. New version attached.

I will also update the MTX_Projects zip file in the earlier post.
by Bill B
05 Jul 2022 14:57
Forum: PROGRAMMING
Topic: Latest on C dev for the MTX SDCC etc,
Replies: 31
Views: 1111

Re: Latest on C dev for the MTX SDCC etc,

Dave pointed out that Code::Blocks is capable of displaying context sensitive help. Thanks Dave. I have now provided context sensitive help for the MTXLib routines. To enable this: Replace the contents of "MTX_Projects\MTXLib\docs" with the contents of the attached "docs.zip". Op...
by Bill B
04 Jul 2022 22:10
Forum: PROGRAMMING
Topic: Latest on C dev for the MTX SDCC etc,
Replies: 31
Views: 1111

Re: Latest on C dev for the MTX SDCC etc,

On the subject of MEMU, during this development, I discovered a small issue. MEMU has a feature where you can specify a *,RUN file on the end of the command line, and MEMU will automatically load and run the file, without having to type USER RUN "FILENAME.RUN". I use this to automatically ...
by Bill B
04 Jul 2022 20:02
Forum: PROGRAMMING
Topic: Latest on C dev for the MTX SDCC etc,
Replies: 31
Views: 1111

Re: Latest on C dev for the MTX SDCC etc,

I have not tried to program or use Python as yet but it looks good Python is only used to convert the Intel Hex files produced by SDCC into MTX RUN files. I could instead have written a small program in C to do that, but then I would have to maintain separate versions for Windows and Linux. Using P...
by Bill B
03 Jul 2022 17:02
Forum: PROGRAMMING
Topic: Latest on C dev for the MTX SDCC etc,
Replies: 31
Views: 1111

Re: Latest on C dev for the MTX SDCC etc,

I now have something working that attempts to satisfy Jim's request. It uses: Python SDCC Code::Blocks Install all of the above, then download and unzip the attached MTX_Projects.zip. Instructions for using Code::Blocks to build MTX programs are in file "MTX_Projects\MTXLib\docs\codeblocks.html...