I know this comes up from time to time and I've looked through the forum for clues and one post had something promising but I'm stuck.
I'm starting to learn machine code and I'm pretty good now but I want to be able to do something like the 'nova' prgram does and that's put some thing on the screen the whole time. To do this i need to 'hook' the screen routine and call my code after it's drawn.
There's a post that has some code by Dr Beep and I've tried this but it doesn't work. What I think it does is change the ix register to point to the new routine so it is called instead of the ROM code and you do what you need to do in there as well as calling the ROM code that would have run anyways.
I use EO and in the debugger after I've run the code the IX register has recovered it's old value and my code isn't being called. Stepping through the ROM is difficult for me and a bit confusing. I've tried it before asking for help....
Here's the code I'm basing my stuff on:
Code: Select all
programmestart: LD IX,mycode loop: ; wait for vsync ; do some things jp loop mycode CALL #281 ; the normal IX routine myprog CALL mystuff ; end CALL #292 CALL #220 LD IX,mycode JP #2A4 mystuff: do my stuff ret