Search found 11 matches
- Sat Apr 13, 2024 2:27 pm
- Forum: Programming
- Topic: Bank switching issue
- Replies: 38
- Views: 1400
Re: Bank switching issue
if you want to use system vars for your code, you will need your own interrupt handler. ROM handler expects IY to point to sysvars area, and hopes to find some sysvars there (FRAMES, keyboard state). also, if you are using RST #10 for printing, you will need sysvars too (and some other ROM routines...
- Fri Apr 12, 2024 1:06 pm
- Forum: Programming
- Topic: Bank switching issue
- Replies: 38
- Views: 1400
Re: Bank switching issue
OK, I can't quite visualise how that works but you say it does so that's good. I would've thought if graphics data is banked in at $c000 then your screen, in another bank at $c000, is not available. So copying from one to another means you're having to copy bytes to a temp buffer first or hold your...
- Tue Apr 09, 2024 4:40 pm
- Forum: Programming
- Topic: Bank switching issue
- Replies: 38
- Views: 1400
Re: Bank switching issue
Incredibly detailed advice. Thanks everyone! So I have it sort of working now. I have code at $8000, Graphics Data at $C000 Bank 0, and Draw screen at $C000 Bank 1. The paging in and out of different banks within my draw routine seems to work, and sprites are appearing on the screen as they should. ...
- Thu Apr 04, 2024 11:21 am
- Forum: Programming
- Topic: Bank switching issue
- Replies: 38
- Views: 1400
Re: Bank switching issue
I changed the stack to another place and the calls are working fine now. :) Screen is now at $C000 and graphics data is at $B000 Anything you write to the top third of the screen will have to be mirrored at $C000 in bank 7 , otherwise it won't appear when you swap in the alternate screen. Same for a...
- Thu Apr 04, 2024 8:52 am
- Forum: Programming
- Topic: Bank switching issue
- Replies: 38
- Views: 1400
Re: Bank switching issue
you prolly have the stack somewhere around $FF00, or something. so when you switched the banks, the window [$C000..$FFFF] moved to another memory region… and your stack stays in the old one. ;-) just remember that memory area [$C000..$FFFF] is affected by switch, and design your code around that. A...
- Wed Apr 03, 2024 9:41 am
- Forum: Programming
- Topic: Bank switching issue
- Replies: 38
- Views: 1400
Re: Bank switching issue
Thanks for the info everyone. That makes things much clearer. I was aware that the Z80 can only see 64K of RAM at any one time, but wasn't sure just how it all worked. All interrupts are disabled, but I found that the OUT was affecting the stack's RET address in the subroutine, but it's fine if I ba...
- Tue Apr 02, 2024 11:10 am
- Forum: Programming
- Topic: Bank switching issue
- Replies: 38
- Views: 1400
Bank switching issue
I'm struggling a bit with bank switching on the 128K, so I'd be grateful for some clarification on a few things. I'm using this subroutine to switch banks: BANKPORT = $7FFD BANKPORTPREV = $5B5C SWITCHBANK: ;--------------------------- ld a,(BANKPORTPREV) ; Previous value of port and $F8 or e ; Selec...
- Tue Mar 12, 2024 10:46 am
- Forum: Programming
- Topic: Measuring frames/VSYNC
- Replies: 10
- Views: 809
Re: Measuring frames/VSYNC
Apologies for getting back a little late but I was away at the weekend.
Thanks for all the great replies and examples! Plenty to chew on here.
Thanks for all the great replies and examples! Plenty to chew on here.
- Sat Mar 09, 2024 10:53 am
- Forum: Programming
- Topic: Measuring frames/VSYNC
- Replies: 10
- Views: 809
Re: Measuring frames/VSYNC
Thanks for the replies folks! One thing to bear in mind is that, unlike the Amiga, you're don't really have to worry about someone having a faster CPU. So a lot of the time HALT on it's own will suffice. Yeah that was a problem. I coded for the 68000 only, but folk were using all sorts of turbo-acce...
- Sat Mar 09, 2024 9:36 am
- Forum: Programming
- Topic: Measuring frames/VSYNC
- Replies: 10
- Views: 809
Measuring frames/VSYNC
Hi Folks! So I've been experimenting with timing and screen syncing with a soft double buffer. The code below seems like the most common way, but I'm not quite sure it's efficient? The HALT stops any additional screen tearing but it could just be unnecessary waiting (it all currently sits at the top...
- Thu Mar 07, 2024 2:38 pm
- Forum: Announcements
- Topic: Introduce yourself!
- Replies: 684
- Views: 188067
Re: Introduce yourself!
Hi all! So I've just come fresh from converting Final Fight to the Amiga ECS, and now I want to have a go at making something in Z80. I chose the ZX Spectrum because I find 1-Bit pixel art quite easy to do, plus I had a Speccy in the 80s so it's in my heart. I've been at it a week now and it's all g...