Author Topic: Interrupt Routine not RETurning  (Read 11252 times)

0 Members and 2 Guests are viewing this topic.

Offline Excelseo

  • LV2 Member (Next: 40)
  • **
  • Posts: 21
  • Rating: +0/-0
    • View Profile
Re: Interrupt Routine not RETurning
« Reply #15 on: August 26, 2016, 02:31:40 pm »
Code: [Select]
  di
  ld a,$99
  ld i,a
  ld hl,$9900
  ld de, $9901
  ld (hl),$9A
  ld bc,256
  ldir
  ld ix,$9A9A
  ld (ix+0),$C3
  ld hl,Interrupt
  ld (ix+1),l
  ld (ix+2),h
  im 2
  ld a,%00001011
  out (3),a
  ld e,$FF
  ei
Loop:
  jr Loop
Interrupt:
  di
  xor a
  out (3),a
  ld a,$26
  out ($10),a
  call WasteTime
  ld a,$9C
  out ($10),a
  call WasteTime
  ld a,e
  srl a
  srl a
  out ($11),a
  dec e
  ld a,%00001011
  out (3),a
  ei
  ret
WasteTime:
  ld l,10
WasteLoop:
  nop
  nop
  nop
  nop
  dec l
  jr nz,WasteLoop
  ret

My code as it is currently, by request of Sorunome. Thanks Eems for the link.

Edit Sorunome: added code-tags
« Last Edit: August 26, 2016, 02:32:32 pm by Sorunome »

Offline Sorunome

  • Fox Fox Fox Fox Fox Fox Fox!
  • Support Staff
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 7920
  • Rating: +374/-13
  • Derpy Hooves
    • View Profile
    • My website! (You might lose the game)
Re: Interrupt Routine not RETurning
« Reply #16 on: August 26, 2016, 03:06:11 pm »
So, I just assembled your code into program with spasm-ng and it does what expected, outputs an 8-pixel block which are keep on changing because of dec e

In my other programs i also called once, before starting interrupts:
Code: [Select]
xor a
out (4),a
That basically sets the speed of the hardware timers. Maybe adding that would work?

EDIT: this is what it is looking like for me:

THE GAME
Also, check out my website
If OmnomIRC is screwed up, blame me!
Click here to give me an internet!

Offline Excelseo

  • LV2 Member (Next: 40)
  • **
  • Posts: 21
  • Rating: +0/-0
    • View Profile
Re: Interrupt Routine not RETurning
« Reply #17 on: August 26, 2016, 03:41:18 pm »
Thanks! It's working now. The output to port 4 finally did it. Thank you all for the help!

Offline Sorunome

  • Fox Fox Fox Fox Fox Fox Fox!
  • Support Staff
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 7920
  • Rating: +374/-13
  • Derpy Hooves
    • View Profile
    • My website! (You might lose the game)
Re: Interrupt Routine not RETurning
« Reply #18 on: August 26, 2016, 03:45:46 pm »
In case you need any more information on port 4 you can find it here: http://wikiti.brandonw.net/index.php?title=83Plus:Ports:04

THE GAME
Also, check out my website
If OmnomIRC is screwed up, blame me!
Click here to give me an internet!