Hello, I was wondering how I could implement jump tables, you know, stuff like this
Codemain:
LDA !Timer
ASL
TAX
JSR (Pointers,x)
DEC !Timer
RTL
Pointers:
dw UpdateMAP16Tiles
dw Return
dw UploadtoVRAM_44Tiles
dw UploadtoVRAM_42Tiles
dw UploadtoVRAM_42Tiles
dw DecompressGFXFiles
dw UploadtoVRAM_44Tiles
dw UploadtoVRAM_42Tiles
dw UploadtoVRAM_42Tiles
dw DecompressGFXFiles
Return:
RTS
in C++ where I'd have an array of functions that return a bool. I would keep executing the function that corresponds to the value of the index variable until it returns true, then increment the index variable and keep executing the next function until it returns true, and so on. Is it even possible to do something like that in C++ using good coding practices?
Follow Us On