Discussion Forum for all things Microbee
6502 to Z80 Port - Printable Version

+- Discussion Forum for all things Microbee (https://microbeetechnology.com.au/forum)
+-- Forum: Microbee Forum (https://microbeetechnology.com.au/forum/forumdisplay.php?fid=1)
+--- Forum: Microbee Software and Documentation (https://microbeetechnology.com.au/forum/forumdisplay.php?fid=7)
+--- Thread: 6502 to Z80 Port (/showthread.php?tid=386)



6502 to Z80 Port - snake - 08-10-2021

Hey Guys,

This code runs on a Commodore PET, Any Idea what the Z80 Microbee equivalent would be?

BASIC: !BYTE $0B,$04,$01,$00,$9E,$31,$30,$33,$37,$00,$00,$00
;Adds BASIC line:  1 SYS 1037

TEMPO_TIMER !BYTE 00 ;used for counting down to the next tick

TILENAME:  !PET"tileset.pet"

MAPNAME:  !PET"level-a"

MSG_CANTMOVE !SCR"can't move that!",0


Cheers,

Snake...


RE: 6502 to Z80 Port - someone - 08-10-2021

In lieu of having the "1 SYS 1037 BASIC" line, you could formulate a MWBASIC'USR() statement.

For the PET Timer, you might be able to use the 50Hz VSYNC pin mod and write an associated ISR (interrupt service routine)
Otherwise install a Z80 CTC for higher resolutions.

You can use the microbee PCG for the tiles.

The map and msg can be directly ported.


RE: 6502 to Z80 Port - snake - 08-10-2021

I will be more specific

what are the Z80 Microbee equivalents for

!BYTE
!SCR
!PET


RE: 6502 to Z80 Port - someone - 09-10-2021

(08-10-2021, 02:47 PM)snake Wrote: I will be more specific

what are the Z80 Microbee equivalents for

!BYTE
!SCR
!PET

!BYTE - just means that some bytes are following.
As per the comments in your example:
$01, $00 = <integer word 1>
$9E = <token for PET BASIC SYS>
$31,$30,$33,$37 = "1037"

!PET - pseudo op for PETSCII String
!SCR  - pseudo op for screen code

These are do not have direct microbee equivalents thus you'll have to formulate your own solution.
 In addition to pure 6502 to Z80 porting, you also have to consider the hardware differences.